Compare commits

..

66 Commits

Author SHA1 Message Date
7079e870f8 [nvim] :W-:w :Q-:q aliases 2025-11-28 22:22:00 +03:00
Dmitrii Chumak
4fe6739d9d [nvim] avante plugin 2025-08-31 12:57:05 +03:00
Dmitrii Chumak
2fa073ea87 Merge branch 'master' of https://git.venya.tech/mega_venik/dotfiles 2025-07-24 18:05:38 +03:00
Dmitrii Chumak
880bbd18e0 [vim] migration to 0.11 and native lsp client 2025-07-24 18:04:28 +03:00
ebe143ee28 Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2025-07-04 00:52:24 +03:00
ba7cec969f [nvim] smth 2025-07-04 00:52:22 +03:00
Dmitrii Chumak
e2bdd71b08 gitignore 2025-06-02 14:32:15 +03:00
Dmitry Chumak
966b7c74ef [shell] alias to listen mac ports 2025-05-29 13:45:45 +05:00
Dmitry Chumak
a3c78dfcba [alacritty] fontsize conflict fix 2025-05-25 23:20:05 +03:00
Dmitry Chumak
622ae698cd Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2025-05-25 23:19:26 +03:00
Dmitry Chumak
6a20ac709a [alacritty] fontsize increase + mac docs 2025-05-25 23:18:57 +03:00
Dmitry Chumak
386257dd6e [tmux] #3 command prompt color fix 2025-05-25 23:18:05 +03:00
e0f933c26c [alacritty] font size decrease 2025-05-01 22:45:08 +03:00
Dmitry Chumak
352a8c3c97 [nvim] codecompanion plugin 2025-04-23 21:20:22 +03:00
Dmitry Chumak
bcba0e372a Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2025-04-23 20:21:18 +03:00
Dmitry Chumak
909acaa69f alacritty fixes 2025-04-23 20:21:06 +03:00
Dmitrii Chumak
72b38584ef [nvim] telescope for references + ya gopls config 2025-04-08 19:56:17 +03:00
Dmitrii Chumak
3e4452cf24 Merge branch 'master' of https://git.venya.tech/mega_venik/dotfiles 2025-04-08 19:53:30 +03:00
Dmitry Chumak
04aef1e179 alacritty alt fixes for mac + togglemaximized 2025-04-08 19:46:07 +03:00
Dmitry Chumak
bcca54a031 alacritty colorscheme + vim cursor bgcolor 2025-04-08 11:31:06 +03:00
Dmitry Chumak
491aae86da alacritty moved to dir + themes submodule 2025-04-07 15:59:19 +03:00
Dmitry Chumak
d271383341 alacritty renamed + macos bindings remap 2025-04-07 15:34:36 +03:00
90f29dcec2 alacritty config 2025-04-07 14:28:04 +03:00
Dmitrii Chumak
186bb40650 [nvim] disabled editorconfig, added cue.lua 2025-03-25 20:12:19 +03:00
de04ddd511 [nvim] func to add descriptions to keymap opts tables 2025-03-16 21:35:17 +03:00
836a80c332 [nvim] symbols navigation plugin, tabs navigation keymap 2025-03-16 20:04:02 +03:00
8de9883cbe [nvim] kinda fixed gitsigns public url 2025-03-13 22:46:05 +03:00
Dmitry Chumak
5b562a12da [nvim] gitsigns 2025-03-13 19:48:19 +03:00
Dmitry Chumak
63250216bb [nvim] Ctrl-hjkl to move between panes 2025-03-11 12:35:47 +03:00
Dmitry Chumak
4bf35a7004 [nvim] which-key plugin added, pyright fixed 2025-03-10 22:09:13 +03:00
Dmitry Chumak
4a89901c68 [nvim] added pyright lsp 2025-03-10 16:58:39 +03:00
Dmitry Chumak
957a62b72e [nvim] enabled current line highlight 2025-03-09 21:54:17 +03:00
860e52b19d [nvim] removed unused border variable 2025-03-09 21:18:22 +03:00
3dd4270e9b merge 2025-03-09 21:06:42 +03:00
db287b99f2 [vim] go support 2025-03-09 21:01:58 +03:00
f8deaa5f64 neovim install link 2025-03-09 21:01:18 +03:00
e1ce4b2fa8 gdscript support added 2025-03-09 21:00:41 +03:00
972a43b01f neovim config 2025-03-09 20:59:55 +03:00
Dmitry Chumak
d8a74ec472 system-dependant coc-settings 2025-02-27 20:32:38 +03:00
Dmitry Chumak
6c69e5e6eb Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2025-02-27 19:26:43 +03:00
Dmitry Chumak
993dbd7fa1 updates from ya macbook 2025-02-27 19:26:30 +03:00
bdab2117f3 Add README.md 2024-08-05 12:07:17 +00:00
Dmitry Chumak
3ca34914a5 Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2024-07-31 15:04:09 +03:00
Dmitry Chumak
108fdaae99 [vim] vim-go, vim-terraform 2024-07-31 15:03:54 +03:00
274c9f2bab [shell] eng locale for lazygit alias 2024-07-28 16:29:33 +03:00
9876c30d6d [shell] moved to a single directory + alias.sh 2024-07-28 16:18:45 +03:00
Dmitry Chumak
2de1ebcfef [zsh] reverted check of the zshrc_local existance 2024-07-13 20:03:20 +03:00
Dmitry Chumak
9b60dd3c82 [vim] added coc-go 2024-07-13 20:02:44 +03:00
Dmitry Chumak
84c92e76a2 [zsh] fixed local config import 2024-07-13 18:21:57 +03:00
Dmitry Chumak
34de0841b9 Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2024-07-11 12:57:50 +03:00
Dmitry Chumak
2dd4b82d87 [zsh] eval brew 2024-07-11 12:56:46 +03:00
Dmitry Chumak
98f19403cc [tmux] copy to clipboard separated for linux and mac 2024-07-05 12:28:41 +03:00
Dmitry Chumak
a72751e4f0 [vim] removed coc-flutter 2024-07-05 12:20:52 +03:00
c5981f5eb2 [zsh] fix importing local config 2024-07-04 21:48:46 +03:00
2ae741def7 [zsh] git status in prompt 2024-07-04 21:44:40 +03:00
835fad3214 Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2024-07-04 20:56:25 +03:00
9d23b67d7a [tmux] fix startup error "no window found" 2024-07-04 20:55:32 +03:00
e0c8deda25 [bash] added bash configs for linux setups 2024-07-04 20:54:57 +03:00
09eba0e76e [zsh] ignore repeated duplicates 2024-07-04 20:42:03 +03:00
d8763db08d [tmux] increased scrollback up to 10k lines 2024-07-04 20:28:05 +03:00
26528c66e1 zsh tmux history sharing 2024-07-04 20:27:39 +03:00
b36d591496 [vim] yaml.ansible ftplugin 2024-03-21 12:09:22 +03:00
c04e8f79a5 Merge branch 'master' of git.venya.tech:mega_venik/dotfiles 2023-09-30 00:54:19 +03:00
e672a42060 [tmux] added alternative window nav hotkeys 2023-09-30 00:53:58 +03:00
04964316e8 [vim] vim-sneak plugin added 2023-09-30 00:09:42 +03:00
98799dc3a6 disabling fokin inlay typehints for coc 2023-09-30 00:09:19 +03:00
42 changed files with 1732 additions and 19 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*.swp
*.swo
.netrwhist

3
.gitmodules vendored
View File

@@ -5,3 +5,6 @@
[submodule "dotbot-asdf"]
path = dotbot-asdf
url = https://github.com/sobolevn/dotbot-asdf.git
[submodule "alacritty/themes"]
path = alacritty/themes
url = https://github.com/alacritty/alacritty-theme.git

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
### Firefox
Для более вменяемого плавного скролла на вейланде включаем параметр `apz.gtk.kinetic_scroll.enabled`, а `apz.fling_friction` выставляем в 0.008. [Источник](https://support.mozilla.org/bm/questions/1437281).

114
alacritty/alacritty.toml Normal file
View File

@@ -0,0 +1,114 @@
colors.draw_bold_text_with_bright_colors = false
#custom_cursor_colors = true
[general]
import = [
"~/.config/alacritty/themes/themes/hardhacker.toml"
]
live_config_reload = true
[window]
option_as_alt = "Both" # fixing Alt for MacOS
dynamic_padding = true
decorations = "None"
startup_mode = "Maximized"
opacity = 0.95
blur = true
[window.dimensions]
columns = 100
lines = 85
[window.padding]
x = 10
y = 5
[scrolling]
history = 0
multiplier = 3
[font]
size = 14
# use_thin_strokes = true
# on mac - https://petar.dev/notes/crisp-fonts-alacritty/
[font.normal]
family = "RecMonoLinear Nerd Font Mono"
style = "Regular"
[font.bold]
family = "RecMonoLinear Nerd Font Mono"
style = "Bold"
[font.italic]
family = "RecMonoLinear Nerd Font Mono"
style = "Regular Italic"
[font.offset]
x = 0
y = 3
[font.glyph_offset]
x = 0
y = 0
[colors.cursor]
text = 'CellBackground'
cursor = '#c7ccd1'
[bell]
animation = "EaseOutExpo"
color = "0xffffff"
duration = 0
[mouse]
hide_when_typing = false
[cursor]
style = "Block"
unfocused_hollow = true
[keyboard]
bindings = [
{ key = "A", mods = "Command", chars = "\u0001" },
{ key = "C", mods = "Command", chars = "\u0003" },
{ key = "D", mods = "Command", chars = "\u0004" },
{ key = "E", mods = "Command", chars = "\u0005" },
# to make Command-H work in MacOS one need to go to
# Settings > keyboard > Hotkeys > Apps' hotkeys
# and create some other hotkey for Alacritty's
# "Hide alacritty"
{ key = "H", mods = "Command", chars = "\u0008" },
{ key = "I", mods = "Command", chars = "\u0009" },
{ key = "J", mods = "Command", chars = "\u000a" },
{ key = "K", mods = "Command", chars = "\u000b" },
{ key = "L", mods = "Command", chars = "\u000c" },
{ key = "O", mods = "Command", chars = "\u000f" },
{ key = "R", mods = "Command", chars = "\u0012" },
{ key = "T", mods = "Command", chars = "\u0014" },
{ key = "U", mods = "Command", chars = "\u0015" },
{ key = "W", mods = "Command", chars = "\u0017" },
{ key = "X", mods = "Command", chars = "\u0018" },
{ key = "Y", mods = "Command", chars = "\u0019" },
{ key = "Z", mods = "Command", chars = "\u001a" },
# Ctrl-LeftArrow escape sequence, ^[[1;5D
# \u001b: ESCAPE character
# \u005b: LEFT SQUARE BRACKET [
# \u0031: DIGIT ONE 1
# \u003b: SEMICOLON ;
# \u0035: DIGIT FIVE 5
# \u0044: LATIN CAPITAL LETTER D
{ key = "ArrowLeft", mods = "Command", chars = "\u001b\u005b\u0031\u003b\u0035\u0044" },
# Ctrl-RightArrow escape sequence, ^[[1;5D
# ^[[1;5C 27 0033 0x1b
# 91 0133 0x5b
# 49 0061 0x31
# 59 0073 0x3b
# 53 0065 0x35
# 67 0103 0x43
{ key = "ArrowRight", mods = "Command", chars = "\u001b\u005b\u0031\u003b\u0035\u0043" },
{ key = "ArrowDown", mods = "Command", chars = "\u001b\u005b\u0031\u003b\u0035\u0042" },
{ key = "F", mods = "Control", action = "ToggleMaximized" },
]

1
alacritty/themes Submodule

Submodule alacritty/themes added at 86c578469e

611
git/git-prompt.sh Normal file
View File

@@ -0,0 +1,611 @@
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
# 2) Add the following line to your .bashrc/.zshrc:
# source ~/.git-prompt.sh
# 3a) Change your PS1 to call __git_ps1 as
# command-substitution:
# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
# ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
# the optional argument will be used as format string.
# 3b) Alternatively, for a slightly faster prompt, __git_ps1 can
# be used for PROMPT_COMMAND in Bash or for precmd() in Zsh
# with two parameters, <pre> and <post>, which are strings
# you would put in $PS1 before and after the status string
# generated by the git-prompt machinery. e.g.
# Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
# will show username, at-sign, host, colon, cwd, then
# various status string, followed by dollar and SP, as
# your prompt.
# ZSH: precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
# will show username, pipe, then various status string,
# followed by colon, cwd, dollar and SP, as your prompt.
# Optionally, you can supply a third argument with a printf
# format string to finetune the output of the branch status
#
# The repository status will be displayed only if you are currently in a
# git repository. The %s token is the placeholder for the shown status.
#
# The prompt status always includes the current branch name.
#
# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
# unstaged (*) and staged (+) changes will be shown next to the branch
# name. You can configure this per-repository with the
# bash.showDirtyState variable, which defaults to true once
# GIT_PS1_SHOWDIRTYSTATE is enabled.
#
# You can also see if currently something is stashed, by setting
# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
# then a '$' will be shown next to the branch name.
#
# If you would like to see if there're untracked files, then you can set
# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
# files, then a '%' will be shown next to the branch name. You can
# configure this per-repository with the bash.showUntrackedFiles
# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
# enabled.
#
# If you would like to see the difference between HEAD and its upstream,
# set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">"
# indicates you are ahead, "<>" indicates you have diverged and "="
# indicates that there is no difference. You can further control
# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
# of values:
#
# verbose show number of commits ahead/behind (+/-) upstream
# name if verbose, then also show the upstream abbrev name
# legacy don't use the '--count' option available in recent
# versions of git-rev-list
# git always compare HEAD to @{upstream}
# svn always compare HEAD to your SVN upstream
#
# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
# find one, or @{upstream} otherwise. Once you have set
# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
# setting the bash.showUpstream config variable.
#
# You can change the separator between the branch name and the above
# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
# is SP.
#
# When there is an in-progress operation such as a merge, rebase,
# revert, cherry-pick, or bisect, the prompt will include information
# related to the operation, often in the form "|<OPERATION-NAME>".
#
# When the repository has a sparse-checkout, a notification of the form
# "|SPARSE" will be included in the prompt. This can be shortened to a
# single '?' character by setting GIT_PS1_COMPRESSSPARSESTATE, or omitted
# by setting GIT_PS1_OMITSPARSESTATE.
#
# If you would like to see a notification on the prompt when there are
# unresolved conflicts, set GIT_PS1_SHOWCONFLICTSTATE to "yes". The
# prompt will include "|CONFLICT".
#
# If you would like to see more information about the identity of
# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
# to one of these values:
#
# contains relative to newer annotated tag (v1.6.3.2~35)
# branch relative to newer tag or branch (master~4)
# describe relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
# tag relative to any older tag (v1.6.3.1-13-gdd42c2f)
# default exactly matching tag
#
# If you would like a colored hint about the current dirty state, set
# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
# the colored output of "git status -sb".
#
# If you would like __git_ps1 to do nothing in the case when the current
# directory is set up to be ignored by git, then set
# GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the
# repository level by setting bash.hideIfPwdIgnored to "false".
# check whether printf supports -v
__git_printf_supports_v=
printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1
# stores the divergence from upstream in $p
# used by GIT_PS1_SHOWUPSTREAM
__git_ps1_show_upstream ()
{
local key value
local svn_remote svn_url_pattern count n
local upstream_type=git legacy="" verbose="" name=""
svn_remote=()
# get some config options from git-config
local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
while read -r key value; do
case "$key" in
bash.showupstream)
GIT_PS1_SHOWUPSTREAM="$value"
if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
p=""
return
fi
;;
svn-remote.*.url)
svn_remote[$((${#svn_remote[@]} + 1))]="$value"
svn_url_pattern="$svn_url_pattern\\|$value"
upstream_type=svn+git # default upstream type is SVN if available, else git
;;
esac
done <<< "$output"
# parse configuration values
local option
for option in ${GIT_PS1_SHOWUPSTREAM-}; do
case "$option" in
git|svn) upstream_type="$option" ;;
verbose) verbose=1 ;;
legacy) legacy=1 ;;
name) name=1 ;;
esac
done
# Find our upstream type
case "$upstream_type" in
git) upstream_type="@{upstream}" ;;
svn*)
# get the upstream from the "git-svn-id: ..." in a commit message
# (git-svn uses essentially the same procedure internally)
local -a svn_upstream
svn_upstream=($(git log --first-parent -1 \
--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
if [[ 0 -ne ${#svn_upstream[@]} ]]; then
svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
svn_upstream=${svn_upstream%@*}
local n_stop="${#svn_remote[@]}"
for ((n=1; n <= n_stop; n++)); do
svn_upstream=${svn_upstream#${svn_remote[$n]}}
done
if [[ -z "$svn_upstream" ]]; then
# default branch name for checkouts with no layout:
upstream_type=${GIT_SVN_ID:-git-svn}
else
upstream_type=${svn_upstream#/}
fi
elif [[ "svn+git" = "$upstream_type" ]]; then
upstream_type="@{upstream}"
fi
;;
esac
# Find how many commits we are ahead/behind our upstream
if [[ -z "$legacy" ]]; then
count="$(git rev-list --count --left-right \
"$upstream_type"...HEAD 2>/dev/null)"
else
# produce equivalent output to --count for older versions of git
local commits
if commits="$(git rev-list --left-right "$upstream_type"...HEAD 2>/dev/null)"
then
local commit behind=0 ahead=0
for commit in $commits
do
case "$commit" in
"<"*) ((behind++)) ;;
*) ((ahead++)) ;;
esac
done
count="$behind $ahead"
else
count=""
fi
fi
# calculate the result
if [[ -z "$verbose" ]]; then
case "$count" in
"") # no upstream
p="" ;;
"0 0") # equal to upstream
p="=" ;;
"0 "*) # ahead of upstream
p=">" ;;
*" 0") # behind upstream
p="<" ;;
*) # diverged from upstream
p="<>" ;;
esac
else # verbose, set upstream instead of p
case "$count" in
"") # no upstream
upstream="" ;;
"0 0") # equal to upstream
upstream="|u=" ;;
"0 "*) # ahead of upstream
upstream="|u+${count#0 }" ;;
*" 0") # behind upstream
upstream="|u-${count% 0}" ;;
*) # diverged from upstream
upstream="|u+${count#* }-${count% *}" ;;
esac
if [[ -n "$count" && -n "$name" ]]; then
__git_ps1_upstream_name=$(git rev-parse \
--abbrev-ref "$upstream_type" 2>/dev/null)
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
upstream="$upstream \${__git_ps1_upstream_name}"
else
upstream="$upstream ${__git_ps1_upstream_name}"
# not needed anymore; keep user's
# environment clean
unset __git_ps1_upstream_name
fi
fi
fi
}
# Helper function that is meant to be called from __git_ps1. It
# injects color codes into the appropriate gitstring variables used
# to build a gitstring. Colored variables are responsible for clearing
# their own color.
__git_ps1_colorize_gitstring ()
{
if [[ -n ${ZSH_VERSION-} ]]; then
local c_red='%F{red}'
local c_green='%F{green}'
local c_lblue='%F{blue}'
local c_clear='%f'
else
# Using \001 and \002 around colors is necessary to prevent
# issues with command line editing/browsing/completion!
local c_red=$'\001\e[31m\002'
local c_green=$'\001\e[32m\002'
local c_lblue=$'\001\e[1;34m\002'
local c_clear=$'\001\e[0m\002'
fi
local bad_color=$c_red
local ok_color=$c_green
local flags_color="$c_lblue"
local branch_color=""
if [ $detached = no ]; then
branch_color="$ok_color"
else
branch_color="$bad_color"
fi
if [ -n "$c" ]; then
c="$branch_color$c$c_clear"
fi
b="$branch_color$b$c_clear"
if [ -n "$w" ]; then
w="$bad_color$w$c_clear"
fi
if [ -n "$i" ]; then
i="$ok_color$i$c_clear"
fi
if [ -n "$s" ]; then
s="$flags_color$s$c_clear"
fi
if [ -n "$u" ]; then
u="$bad_color$u$c_clear"
fi
}
# Helper function to read the first line of a file into a variable.
# __git_eread requires 2 arguments, the file path and the name of the
# variable, in that order.
__git_eread ()
{
test -r "$1" && IFS=$'\r\n' read -r "$2" <"$1"
}
# see if a cherry-pick or revert is in progress, if the user has committed a
# conflict resolution with 'git commit' in the middle of a sequence of picks or
# reverts then CHERRY_PICK_HEAD/REVERT_HEAD will not exist so we have to read
# the todo file.
__git_sequencer_status ()
{
local todo
if test -f "$g/CHERRY_PICK_HEAD"
then
r="|CHERRY-PICKING"
return 0;
elif test -f "$g/REVERT_HEAD"
then
r="|REVERTING"
return 0;
elif __git_eread "$g/sequencer/todo" todo
then
case "$todo" in
p[\ \ ]|pick[\ \ ]*)
r="|CHERRY-PICKING"
return 0
;;
revert[\ \ ]*)
r="|REVERTING"
return 0
;;
esac
fi
return 1
}
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# when called from PS1 using command substitution
# in this mode it prints text to add to bash PS1 prompt (includes branch name)
#
# __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc)
# in that case it _sets_ PS1. The arguments are parts of a PS1 string.
# when two arguments are given, the first is prepended and the second appended
# to the state string when assigned to PS1.
# The optional third parameter will be used as printf format string to further
# customize the output of the git-status string.
# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
__git_ps1 ()
{
# preserve exit status
local exit=$?
local pcmode=no
local detached=no
local ps1pc_start='\u@\h:\w '
local ps1pc_end='\$ '
local printf_format=' (%s)'
case "$#" in
2|3) pcmode=yes
ps1pc_start="$1"
ps1pc_end="$2"
printf_format="${3:-$printf_format}"
# set PS1 to a plain prompt so that we can
# simply return early if the prompt should not
# be decorated
PS1="$ps1pc_start$ps1pc_end"
;;
0|1) printf_format="${1:-$printf_format}"
;;
*) return $exit
;;
esac
# ps1_expanded: This variable is set to 'yes' if the shell
# subjects the value of PS1 to parameter expansion:
#
# * bash does unless the promptvars option is disabled
# * zsh does not unless the PROMPT_SUBST option is set
# * POSIX shells always do
#
# If the shell would expand the contents of PS1 when drawing
# the prompt, a raw ref name must not be included in PS1.
# This protects the user from arbitrary code execution via
# specially crafted ref names. For example, a ref named
# 'refs/heads/$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' might cause the
# shell to execute 'sudo rm -rf /' when the prompt is drawn.
#
# Instead, the ref name should be placed in a separate global
# variable (in the __git_ps1_* namespace to avoid colliding
# with the user's environment) and that variable should be
# referenced from PS1. For example:
#
# __git_ps1_foo=$(do_something_to_get_ref_name)
# PS1="...stuff...\${__git_ps1_foo}...stuff..."
#
# If the shell does not expand the contents of PS1, the raw
# ref name must be included in PS1.
#
# The value of this variable is only relevant when in pcmode.
#
# Assume that the shell follows the POSIX specification and
# expands PS1 unless determined otherwise. (This is more
# likely to be correct if the user has a non-bash, non-zsh
# shell and safer than the alternative if the assumption is
# incorrect.)
#
local ps1_expanded=yes
[ -z "${ZSH_VERSION-}" ] || [[ -o PROMPT_SUBST ]] || ps1_expanded=no
[ -z "${BASH_VERSION-}" ] || shopt -q promptvars || ps1_expanded=no
local repo_info rev_parse_exit_code
repo_info="$(git rev-parse --git-dir --is-inside-git-dir \
--is-bare-repository --is-inside-work-tree --show-ref-format \
--short HEAD 2>/dev/null)"
rev_parse_exit_code="$?"
if [ -z "$repo_info" ]; then
return $exit
fi
local short_sha=""
if [ "$rev_parse_exit_code" = "0" ]; then
short_sha="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
fi
local ref_format="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
local inside_worktree="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
local bare_repo="${repo_info##*$'\n'}"
repo_info="${repo_info%$'\n'*}"
local inside_gitdir="${repo_info##*$'\n'}"
local g="${repo_info%$'\n'*}"
if [ "true" = "$inside_worktree" ] &&
[ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] &&
[ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
git check-ignore -q .
then
return $exit
fi
local sparse=""
if [ -z "${GIT_PS1_COMPRESSSPARSESTATE-}" ] &&
[ -z "${GIT_PS1_OMITSPARSESTATE-}" ] &&
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
sparse="|SPARSE"
fi
local r=""
local b=""
local step=""
local total=""
if [ -d "$g/rebase-merge" ]; then
__git_eread "$g/rebase-merge/head-name" b
__git_eread "$g/rebase-merge/msgnum" step
__git_eread "$g/rebase-merge/end" total
r="|REBASE"
else
if [ -d "$g/rebase-apply" ]; then
__git_eread "$g/rebase-apply/next" step
__git_eread "$g/rebase-apply/last" total
if [ -f "$g/rebase-apply/rebasing" ]; then
__git_eread "$g/rebase-apply/head-name" b
r="|REBASE"
elif [ -f "$g/rebase-apply/applying" ]; then
r="|AM"
else
r="|AM/REBASE"
fi
elif [ -f "$g/MERGE_HEAD" ]; then
r="|MERGING"
elif __git_sequencer_status; then
:
elif [ -f "$g/BISECT_LOG" ]; then
r="|BISECTING"
fi
if [ -n "$b" ]; then
:
elif [ -h "$g/HEAD" ]; then
# symlink symbolic ref
b="$(git symbolic-ref HEAD 2>/dev/null)"
else
local head=""
case "$ref_format" in
files)
if ! __git_eread "$g/HEAD" head; then
return $exit
fi
if [[ $head == "ref: "* ]]; then
head="${head#ref: }"
else
head=""
fi
;;
*)
head="$(git symbolic-ref HEAD 2>/dev/null)"
;;
esac
if test -z "$head"; then
detached=yes
b="$(
case "${GIT_PS1_DESCRIBE_STYLE-}" in
(contains)
git describe --contains HEAD ;;
(branch)
git describe --contains --all HEAD ;;
(tag)
git describe --tags HEAD ;;
(describe)
git describe HEAD ;;
(* | default)
git describe --tags --exact-match HEAD ;;
esac 2>/dev/null)" ||
b="$short_sha..."
b="($b)"
else
b="$head"
fi
fi
fi
if [ -n "$step" ] && [ -n "$total" ]; then
r="$r $step/$total"
fi
local conflict="" # state indicator for unresolved conflicts
if [[ "${GIT_PS1_SHOWCONFLICTSTATE-}" == "yes" ]] &&
[[ $(git ls-files --unmerged 2>/dev/null) ]]; then
conflict="|CONFLICT"
fi
local w=""
local i=""
local s=""
local u=""
local h=""
local c=""
local p="" # short version of upstream state indicator
local upstream="" # verbose version of upstream state indicator
if [ "true" = "$inside_gitdir" ]; then
if [ "true" = "$bare_repo" ]; then
c="BARE:"
else
b="GIT_DIR!"
fi
elif [ "true" = "$inside_worktree" ]; then
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
[ "$(git config --bool bash.showDirtyState)" != "false" ]
then
git diff --no-ext-diff --quiet || w="*"
git diff --no-ext-diff --cached --quiet || i="+"
if [ -z "$short_sha" ] && [ -z "$i" ]; then
i="#"
fi
fi
if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
git rev-parse --verify --quiet refs/stash >/dev/null
then
s="$"
fi
if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
[ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null
then
u="%${ZSH_VERSION+%}"
fi
if [ -n "${GIT_PS1_COMPRESSSPARSESTATE-}" ] &&
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
h="?"
fi
if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
__git_ps1_show_upstream
fi
fi
local z="${GIT_PS1_STATESEPARATOR-" "}"
b=${b##refs/heads/}
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
__git_ps1_branch_name=$b
b="\${__git_ps1_branch_name}"
fi
if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
__git_ps1_colorize_gitstring
fi
local f="$h$w$i$s$u$p"
local gitstring="$c$b${f:+$z$f}${sparse}$r${upstream}${conflict}"
if [ $pcmode = yes ]; then
if [ "${__git_printf_supports_v-}" != yes ]; then
gitstring=$(printf -- "$printf_format" "$gitstring")
else
printf -v gitstring -- "$printf_format" "$gitstring"
fi
PS1="$ps1pc_start$gitstring$ps1pc_end"
else
printf -- "$printf_format" "$gitstring"
fi
return $exit
}

View File

@@ -7,7 +7,10 @@
- link:
~/.tmux.conf: tmux.conf
~/.vim: vim
~/.zshrc: zsh/zshrc
~/.zshrc: shell/zsh/zshrc
~/.bashrc: shell/bash/bashrc
~/.config/nvim: nvim
~/.config/alacritty: alacritty
- asdf:
- plugin: vim

View File

@@ -0,0 +1,3 @@
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4
vim.opt_local.expandtab = false

View File

@@ -0,0 +1 @@
vim.cmd [[autocmd BufWritePre *.go lua vim.lsp.buf.format()]]

View File

@@ -0,0 +1,14 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "javascript", "javascriptreact" },
-- callback = function()
-- -- Your JS/JSX settings here
-- vim.bo.tabstop = 2
-- vim.bo.shiftwidth = 2
-- vim.bo.softtabstop = 2
-- vim.bo.expandtab = true
-- end
-- })

View File

@@ -0,0 +1,7 @@
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.json",
callback = function()
-- vim.cmd([[%!jq . 2>/dev/null || cat]])
vim.cmd([[%!jq . ]])
end,
})

View File

@@ -0,0 +1,4 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true

View File

@@ -0,0 +1,4 @@
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
vim.opt_local.expandtab = true

5
nvim/init.lua Normal file
View File

@@ -0,0 +1,5 @@
require("funcs")
require("options")
require("keymap")
require("plugins/init")
require("lsp-config")

21
nvim/lazy-lock.json Normal file
View File

@@ -0,0 +1,21 @@
{
"LuaSnip": { "branch": "master", "commit": "3d5bced1b9ae69fa3f9b1942e28af5dbc537f946" },
"avante.nvim": { "branch": "main", "commit": "2fc63d4128d2dc2fef0913c7480b4586959ebe4e" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "e52e640b7befd8113b3350f46e8cfcfe98fcf730" },
"codecompanion.nvim": { "branch": "main", "commit": "e23e8e5a5643b089607f21f576f6e63174cc44dc" },
"fzf-lua": { "branch": "main", "commit": "4ee42b241e57b77b4f3c61a018f496219f246901" },
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"outline.nvim": { "branch": "main", "commit": "0eb9289ab39c91caf8b3ed0e3a17764809d69558" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "7bf55ed0ff5be182ad3301cff266581fc1c56cce" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

25
nvim/lsp/basedpyright.lua Normal file
View File

@@ -0,0 +1,25 @@
return {
cmd = { 'basedpyright-langserver', '--stdio' },
filetypes = { 'python' },
root_markers = {
'pyrightconfig.json',
'ya.make',
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
},
settings = {
python = {
analysis = {
autoSearchPaths = false,
useLibraryCodeForTypes = true,
diagnosticMode = 'openFilesOnly',
include = {
}
},
},
},
}

25
nvim/lsp/bashls.lua Normal file
View File

@@ -0,0 +1,25 @@
return {
cmd = { 'bash-language-server', 'start' },
filetypes = { 'bash', 'sh', 'zsh' },
root_markers = { '.git', vim.uv.cwd() },
settings = {
bashIde = {
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
-- Modern formatting options (requires shfmt)
tabSize = 2,
insertSpaces = true,
-- Enable comprehensive features like Ruby LSP
enableSourceErrorDiagnostics = true,
enableCodeLens = true,
includeAllWorkspaceSymbols = true,
-- Background analysis for better performance
backgroundAnalysisMaxFiles = 500,
-- ShellCheck integration for linting
shellcheckPath = 'shellcheck',
shellcheckArguments = {
'--shell=bash',
'--format=json',
},
},
},
}

20
nvim/lsp/gopls.lua Normal file
View File

@@ -0,0 +1,20 @@
return {
cmd = { "/home/dmchumak/.ya/tools/v3/gopls-linux/gopls" },
filetypes = { "go", "gotempl", "gowork", "gomod" },
root_markers = { "ya.make", "YAOWNERS", ".arcadia.root", ".cloudia.root", "go.work", "go.mod", ".git" },
-- settings = {
-- gopls = {
-- completeUnimported = true,
-- usePlaceholders = true,
-- analyses = {
-- unusedparams = true,
-- },
-- ["ui.inlayhint.hints"] = {
-- compositeLiteralFields = true,
-- constantValues = true,
-- parameterNames = true,
-- rangeVariableTypes = true,
-- },
-- },
-- },
}

33
nvim/lsp/lua_ls.lua Normal file
View File

@@ -0,0 +1,33 @@
return {
cmd = { "lua-language-server" },
root_markers = { ".luarc.json", ".git", "init.lua" },
filetypes = { "lua" },
settings = {
Lua = {
format = {
enable = true,
defaultConfig = {
indent_style = "space",
indent_size = "2",
}
},
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
}
}
}

19
nvim/lua/funcs.lua Normal file
View File

@@ -0,0 +1,19 @@
function Contains(list, element)
for _, v in ipairs(list) do
if element == v then
return true
end
end
return false
end
---comment
---@param list table
---@param key string
---@param value any
---@return table
function Append(list, key, value)
local new_list = {unpack(list)}
new_list[key] = value
return new_list
end

5
nvim/lua/keymap.lua Normal file
View File

@@ -0,0 +1,5 @@
vim.g.mapleader = " "
vim.keymap.set("n", "<space><space>", "<cmd> :noh<CR>", { desc = "Clear search highlighting" })
-- Find and replace visual selection using CTRL-r
vim.keymap.set("v", "<C-r>", "\"hy:%s/<C-r>h//gc<left><left><left>")

75
nvim/lua/lsp-config.lua Normal file
View File

@@ -0,0 +1,75 @@
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
'lua_ls',
'gopls',
'bashls',
'basedpyright',
},
automatic_installation = true,
automatic_enable = false
})
local opts = { noremap = true, silent = true }
local keymap = vim.keymap.set
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)
local bufnr = ev.buf
local bufopts = { noremap = true, silent = true, buffer = bufnr }
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if not client then
return
end
local lsp = vim.lsp
local function opt(desc, others)
return vim.tbl_extend("force", bufopts, { desc = desc }, others or {})
end
-- See `:help vim.lsp.*` for documentation on any of the below functions
keymap("n", "gD", lsp.buf.declaration, opt('[G]o to [d]eclaration'))
keymap("n", "gd", lsp.buf.definition, opt("[G]o to [d]efinition"))
keymap("n", "<leader>D", lsp.buf.type_definition, opt("Go to Type [D]efinition"))
keymap("n", "K", lsp.buf.hover, bufopts)
keymap("n", "gi", lsp.buf.implementation, opt("[G]o to [i]mplementation"))
keymap("n", "gr", require'telescope.builtin'.lsp_references, opt("[G]o to [r]eferences"))
keymap("n", "<C-k>", lsp.buf.signature_help, bufopts)
keymap("n", "<leader>wa", lsp.buf.add_workspace_folder, bufopts)
keymap("n", "<leader>wr", lsp.buf.remove_workspace_folder, bufopts)
keymap("n", "<leader>wl", function()
print(vim.inspect(lsp.buf.list_workspace_folders()))
end, bufopts)
keymap("n", "<leader>rn", lsp.buf.rename, opt("[l]sp [R]ename"))
keymap("n", "<leader>lc", lsp.buf.code_action, opt("[l]sp [C]ode Action"))
keymap("n", "<leader>lf", function()
lsp.buf.format({
async = true,
})
end, opt("[l]sp [f]ormat buffer"))
end
})
-- Add the border on hover and on signature help popup window
vim.o.winborder = 'rounded'
-- Add border to the diagnostic popup window
vim.diagnostic.config({
virtual_text = {
prefix = '', -- Could be '●', '▎', 'x', '■', , 
},
signs = false, -- Show signs in the gutter
underline = true,
update_in_insert = false, -- Don't update diagnostics in insert mode
severity_sort = true, -- Sort diagnostics by severity
jump = { float = true },
})
keymap("n", "<leader>e", vim.diagnostic.open_float, opts)
keymap("n", "<leader>q", vim.diagnostic.setloclist, opts)
vim.lsp.enable("lua_ls")
vim.lsp.enable("bashls")
vim.lsp.enable("gopls")
vim.lsp.enable("basedpyright")

49
nvim/lua/options.lua Normal file
View File

@@ -0,0 +1,49 @@
vim.g.editorconfig = false
IsYandex = Contains({"i113855042", "dmchumak-dev.sas.yp-c.yandex.net"}, vim.fn.hostname())
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- case insensitive search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- show line numbers
vim.opt.number = true
vim.opt.relativenumber = false
vim.opt.cursorline = true
-- show trailing whitespace
vim.opt.list = true
vim.opt.listchars = {
tab = '',
multispace = '',
trail = '·',
extends = '',
precedes = ''
}
vim.cmd([[match errorMsg /\s\+$/]])
-- Configuring movement between panes
-- using Ctrl/Cmd-hjkl
vim.keymap.set("n", "<C-h>", "<C-w>h")
vim.keymap.set("n", "<C-j>", "<C-w>j")
vim.keymap.set("n", "<C-k>", "<C-w>k")
vim.keymap.set("n", "<C-l>", "<C-w>l")
-- Keymap to copy to system buffer
vim.keymap.set('n','<leader>y','"+yy')
vim.keymap.set('v','<leader>y','"+y')
-- Keymap to navigate between tabs
vim.keymap.set('n', 'H', 'gT')
vim.keymap.set('n', 'L', 'gt')
-- Makeing :W and :Q work same as :w and :q
vim.cmd("command! -bar -nargs=* -complete=file -range=% -bang W <line1>,<line2>write<bang> <args>")
vim.cmd("command! -bar -nargs=* -complete=file -range=% -bang Write <line1>,<line2>write<bang> <args>")
vim.cmd("command! -bar -nargs=* -complete=file -range=% -bang Wq <line1>,<line2>wq<bang> <args>")
vim.cmd("command! -bar -bang Q quit<bang>")
vim.cmd("command! -bar -bang Qall qall<bang>")
vim.cmd("command! -bar -bang Qa qall<bang>")

View File

@@ -0,0 +1,37 @@
require("codecompanion").setup({
strategies = {
chat = {
adapter = "deepseek",
},
inline = {
adapter = "deepseek",
},
cmd = {
adapter = "deepseek",
}
},
adapters = {
deepseek = function()
return require("codecompanion.adapters").extend("deepseek", {
env = {
api_key = (function()
local path = os.getenv("HOME") .. "/.config/deepseek_api_key"
local file = io.open(path, "r")
if not file then
vim.notify("Deepseek API key not found at " .. path, vim.log.levels.WARN)
return nil
end
local content = file:read("*a"):gsub("%s+", "")
file:close()
return content
end)(),
},
schema = {
model = {
default = "deepseek-chat",
},
},
})
end,
},
})

View File

@@ -0,0 +1,62 @@
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
-- Set up nvim-cmp
local cmp = require('cmp')
local luasnip = require('luasnip')
local select_opts = { behavior = cmp.SelectBehavior.Select }
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
preselect = cmp.PreselectMode.None;
window = {
documentation = cmp.config.window.bordered(),
completion = { border = 'rounded' }
},
formatting = {
fields = { 'menu', 'abbr', 'kind' },
format = function(entry, item)
local menu_icon = {
nvim_lsp = 'λ',
luasnip = '',
buffer = 'Ω',
path = '🖫',
}
item.menu = menu_icon[entry.source.name]
return item
end,
},
mapping = {
-- Trigger completion menu with <Tab>
['<Tab>'] = cmp.mapping(function(fallback)
local col = vim.fn.col('.') - 1
if cmp.visible() then
cmp.select_next_item(select_opts)
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
fallback()
else
cmp.complete()
end
end, { 'i', 's' }),
-- Trigger completion menu with <C-Space>
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), -- Open completion menu
-- Navigate completion menu with <C-n> and <C-p>
['<C-n>'] = cmp.mapping.select_next_item(), -- Next item
['<C-p>'] = cmp.mapping.select_prev_item(), -- Previous item
-- Confirm selection with <CR> (Enter)
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Confirm selection
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' }, -- LSP source
{ name = 'buffer' }, -- Buffer source
{ name = 'path' }, -- Path source
{ name = 'luasnip' }, -- Path source
}),
})

View File

@@ -0,0 +1,22 @@
require('gitsigns').setup(
{
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '-' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '-' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
}
)
vim.keymap.set('n', '<leader>vb', ':Gitsigns blame_line<CR>', {desc = "Blame current line (git/arc)"})

134
nvim/lua/plugins/init.lua Normal file
View File

@@ -0,0 +1,134 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
{
'projekt0n/github-nvim-theme',
name = 'github-theme',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require('github-theme').setup({
-- ...
})
-- vim.cmd('colorscheme github_light_colorblind')
-- vim.cmd('colorscheme github_light')
vim.cmd('colorscheme github_dark_colorblind')
-- vim.cmd('colorscheme github_dark')
end,
},
{
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
},
{
'hrsh7th/nvim-cmp', -- Auto-completion plugin
dependencies = {
'hrsh7th/cmp-nvim-lsp', -- LSP source for nvim-cmp
'hrsh7th/cmp-buffer', -- Buffer source for nvim-cmp
'hrsh7th/cmp-path', -- Path source for nvim-cmp
'L3MON4D3/LuaSnip',
},
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
preset = "modern",
show_help = false, -- workaround for border glitch https://github.com/folke/which-key.nvim/issues/967#issuecomment-2842309305
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
},
-- GitSigns
{
(not IsYandex) and "lewis6991/gitsigns.nvim" or nil,
dir = (IsYandex) and "~/arcadia/contrib/tier1/gitsigns.arc.nvim" or nil,
},
{
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
outline_window = {
position = "left",
}
-- Your setup opts here
},
},
{
"olimorris/codecompanion.nvim",
opts = {},
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
},
{
"yetone/avante.nvim",
build = vim.fn.has("win32") ~= 0
and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make",
event = "VeryLazy",
version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = {
provider = "yadeepseek",
providers = {
yadeepseek = {
__inherited_from = "openai",
api_key_name = "cmd:cat ~/.config/eliza_api_key",
endpoint = "https://api.eliza.yandex.net/raw/internal/deepseek/v1",
model = "deepseek-0324",
},
},
},
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
-- "stevearc/dressing.nvim", -- for input provider dressing
-- "folke/snacks.nvim", -- for input provider snacks
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
},
}
}
require("lazy").setup(plugins)
vim.cmd([[
set termguicolors
hi Cursor guifg=red guibg=green
set guicursor=n-v-c:block-Cursor/lCursor,i-ci-ve:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,o:hor50-Cursor/lCursor,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175-Cursor/lCursor
]])
require("plugins/telescope")
require("plugins/completions")
require("plugins/gitsigns")
require("plugins/codecompanion")

View File

@@ -0,0 +1,20 @@
require("telescope").setup {
extensions = {
file_browser = {
initial_mode = "normal",
-- ...
},
},
}
require("telescope").load_extension "file_browser"
-- require("telescope").load_extension "find_files"
-- vim.keymap.set("n", "<space>fb", ":Telescope file_browser<CR>")
-- open file_browser with the path of the current buffer
vim.keymap.set("n", "<space>fb", ":Telescope file_browser path=%:p:h select_buffer=true<CR>")
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>b', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })

248
nvim/lua/ytils.lua Normal file
View File

@@ -0,0 +1,248 @@
local M = {}
local NIL = "<NIL>"
local unpack = table.unpack or unpack
M.ARC_REPO_ROOT_ENV = "ARC_ROOT"
M._arc_repo_roots = {
"/home/dmchumak/arcadia/",
}
local is_windows = vim.loop.os_uname().version:match("Windows")
M.table = (function()
-- finds the index of value in the table
---@param t table
---@param value any
---@return integer?
local function find(t, value)
for ix, ix_value in ipairs(t) do
if ix_value == value then
return ix
end
end
return nil
end
return {
find = find,
}
end)()
M.path = (function()
-- stolen form
-- https://github.com/neovim/nvim-lspconfig/tree/71b39616b14c152da34fcc787fa27f09bf280e72/lua/lspconfig/util.lua#L124
local function is_fs_root(path)
if is_windows then
return path:match("^%a:$")
else
return path == "/"
end
end
-- stolen from https://github.com/neovim/nvim-lspconfig/tree/71b39616b14c152da34fcc787fa27f09bf280e72/lua/lspconfig/util.lua#L142
---@param path string
---@return string?
local function dirname(path)
local strip_dir_pat = "/([^/]+)$"
local strip_sep_pat = "/$"
if not path or #path == 0 then
return
end
local result = path:gsub(strip_sep_pat, ""):gsub(strip_dir_pat, "")
if #result == 0 then
if is_windows then
return path:sub(1, 2):upper()
else
return "/"
end
end
return result
end
return {
is_fs_root = is_fs_root,
dirname = dirname,
}
end)()
if os.getenv(M.ARC_REPO_ROOT_ENV) then
table.insert(M._arc_repo_roots, 1, os.getenv(M.ARC_REPO_ROOT_ENV))
end
function M.is_inside_arc(path)
for _, prefix in ipairs(M._arc_repo_roots) do
if path:find(prefix, 1, true) == 1 then
return true
end
end
return false
end
function M.is_ok_root_dir(path)
-- local util = require("dgronskiy_nvim.util")
if M.path.is_fs_root(path) then
return false
end
if path == os.getenv("HOME") then
return false
end
-- No-Go's:
-- * /data/a/trunk
-- * /data/a/dev
-- * /data/a/MLDWH-XXX
local path_and_parent = { path, M.path.dirname(path) }
for _, check_against in ipairs(M._arc_repo_roots) do
if M.table.find(path_and_parent, check_against) then
return false
end
end
return true
end
-- TODO: move ok_root_dirs into global config file
-- root_dir function in terms of `lspconfig`. Get inspiration here:
-- https://github.com/neovim/nvim-lspconfig/tree/bfdf2e91e7297a54bcc09d3e092a12bff69a1cf4/lua/lspconfig/util.lua#L268
function M.guarded_pyright_root_directory(startpath)
local is_inside_arc = M.is_inside_arc(startpath)
local root_dir = nil
if is_inside_arc then
local util = require("lspconfig.util")
root_dir = util.root_pattern("pyrightconfig.json")(startpath)
else
-- use default from here
-- https://github.com/neovim/nvim-lspconfig/blob/d1871c84b218931cc758dbbde1fec8e90c6d465c/lua/lspconfig/configs/pyright.lua#L47
root_dir = require("lspconfig.configs.pyright").default_config.root_dir(startpath)
end
local is_ok_root_dir = M.is_ok_root_dir(root_dir)
root_dir = is_ok_root_dir and root_dir or nil
-- if not M.is_ok_root_dir(root_dir) then
-- logger:warn("patching
-- vim.notify(
-- "Inside Arc="
-- .. tostring(is_inside_arc)
-- .. "\nFile= "
-- .. startpath
-- .. "\nRoot dir= "
-- .. root_dir
-- .. "\n\nPatching root_dir to nil"
-- )
-- root_dir = nil
-- end
return root_dir
end
-- func! GetArcanumLink(mode)
-- let l:root = system("arc root")
-- let l:link = "https://a.yandex-team.ru/arc_vcs/" . expand("%:p")[len(l:root):]
-- if a:mode == "normal"
-- return l:link . "\\#L" . getcurpos()[1]
-- else
-- let l:start = getpos("'<")
-- let l:finish = getpos("'>")
-- return l:link . "\\#L" . l:start[1] . "-" . l:finish[1]
-- endif
-- endf
---comment
---@return string? # nil in case of an error
function M.GetArcRoot()
local stdout = vim.fn.system("arc root 2>/dev/null")
if vim.api.nvim_get_vvar("shell_error") ~= 0 then
print(stdout)
return
end
return stdout:gsub("\n", "")
end
---
---@param file_path string
---@param arc_root string
---@return string? # nil in case of en error
function M.GetArcRelativePath(file_path, arc_root)
if string.sub(arc_root, -1, -1) ~= "/" then
arc_root = arc_root .. "/"
end
if string.sub(file_path, 1, string.len(arc_root)) ~= arc_root then
print(string.format("file_path [%s] is not in the repo [%s]", file_path, arc_root))
return
end
local file_relative_path = string.sub(file_path, string.len(arc_root) + 1)
return file_relative_path
end
---
---@return string? # nil in case of an error
function M.GetArcHeadCommit()
local stdout = vim.fn.system("arc rev-parse HEAD 2>/dev/null")
if vim.api.nvim_get_vvar("shell_error") ~= 0 then
print(stdout)
return
end
return stdout:gsub("\n", "")
end
---comment
---@return string? # nil in case of an error
function M.GetArcanumLink(opts)
local url_lines_requester = (function(opts)
local line1, line2
if opts and opts.linerange then
line1, line2 = unpack(opts.linerange)
else
line1 = vim.api.nvim_win_get_cursor(0)[1]
line2 = line1
end
-- print(vim.inspect(line1))
line1, line2 = math.min(line1, line2), math.max(line1, line2)
if line1 == line2 then
return "#L" .. tostring(line1)
else
return "#L" .. tostring(line1) .. "-" .. tostring(line2)
end
end)(opts)
local arc_root = M.GetArcRoot()
if not arc_root then
return
end
local file_path = vim.fn.expand("%:p") ---@type string
local file_relative_path = M.GetArcRelativePath(file_path, arc_root)
if not file_relative_path then
return
end
local revision = M.GetArcHeadCommit()
revision = revision and ("?rev=" .. revision) or ""
local url = "https://a.yandex-team.ru/arcadia/" .. file_relative_path .. revision .. url_lines_requester
return url
-- return "https://a.yandex-team.ru/arcadia/" .. .. "#L"
--?rev=r14586396#L10
end
---@param link string
---@return nil
function M.ArcLinkOpen(link)
-- https://a.yandex-team.ru/arcadia/ads/libs/py_rearrange/__init__.py#L96
local prefix = "https://a.yandex-team.ru/arcadia"
end
return M

5
shell/alias.sh Normal file
View File

@@ -0,0 +1,5 @@
alias l="ls -lahG"
alias lg="LANG=en_US-UTF-8 lazygit"
alias v="vim"
alias n="nvim"
alias mac-listen="sudo lsof -iTCP -sTCP:LISTEN -n -P"

25
shell/bash/bashrc Normal file
View File

@@ -0,0 +1,25 @@
source ~/.dotfiles/git/git-prompt.sh
source ~/.dotfiles/shell/alias.sh
PROMPT_COMMAND='PS1_CMD1=$(__git_ps1 " [%s]")'; PS1='\[\e[38;5;117m\]\u\[\e[0m\] \w${PS1_CMD1}\$ '
PATH="$PATH:~/go/bin"
#
# tmux history preservation
#
# Avoid duplicates
HISTCONTROL=ignoredups:erasedups # Ubuntu default is ignoreboth
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend # In Ubuntu this is already set by default
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
#
# tmux autostart
#
# [[ $- == *i* ]] is to check if the current seession is interactive - https://superuser.com/a/1777888/136716
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ $- == *i* ]] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec tmux new-session -As0
fi

28
shell/zsh/zshrc Normal file
View File

@@ -0,0 +1,28 @@
source ~/.dotfiles/shell/alias.sh
eval "$(/opt/homebrew/bin/brew shellenv)"
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
setopt appendhistory # Append history to the history file (no overwriting)
setopt incappendhistory # Immediately append to the history file, not just when a term is killed
setopt histignoredups
source ~/.dotfiles/git/git-prompt.sh
setopt PROMPT_SUBST ; PS1='%n@%m %c$(__git_ps1 " [%s]")\$ '
if [ -f ~/.zshrc_local ]
then
source ~/.zshrc_local
fi
# The next line updates PATH for CLI.
if [ -f '/Users/dmchumak/yandex-cloud/path.bash.inc' ]; then source '/Users/dmchumak/yandex-cloud/path.bash.inc'; fi
# The next line enables shell command completion for yc.
if [ -f '/Users/dmchumak/yandex-cloud/completion.zsh.inc' ]; then source '/Users/dmchumak/yandex-cloud/completion.zsh.inc'; fi

View File

@@ -1,10 +1,13 @@
set -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"
set-option -gas terminal-overrides "*:Tc"
set-option -gas terminal-overrides "*:RGB"
set -g mouse on
set -g set-clipboard external
set -g escape-time 10 # https://www.johnhawthorn.com/2012/09/vi-escape-delays/
set -g history-limit 10000
set-option -g status-position top
set-window-option -g allow-rename off
set allow-rename off
set -g allow-rename off
# remap prefix from 'C-b' to 'C-x', 0x18 hex code for iterm2
unbind C-b
@@ -26,6 +29,10 @@ unbind %
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
# and for split-keyboard
bind -n C-down new-window
bind -n C-left prev
bind -n C-right next
# resizing panes using Ctrl-Alt-arrows without prefix
bind -n C-M-Up resize-pane -U 2
@@ -64,7 +71,7 @@ bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# color status bar
set -g status-style fg=white,bg=colour235
# color of message bar
set -g message-style fg=white,bold,bg=green
set -g message-style fg=black,bold,bg=colour107
# highlight current window
setw -g window-status-style fg=cyan,bg=colour235
@@ -80,5 +87,10 @@ set -g pane-active-border-style fg=green,bg=default
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
if-shell '[[ $(uname -s) = Linux ]]' {
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
} {
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
}

View File

@@ -0,0 +1,14 @@
{
"inlayHints.enable": false,
"pyright.inlayHints.functionReturnTypes": false,
"pyright.inlayHints.variableTypes": false,
"go.goplsOptions": {
"standaloneTags": ["ignore"],
"arcadiaIndexDirs": [
"cli/",
"api/",
"gateway/"
]
},
"go.goplsPath": "/Users/dmchumak/.ya/tools/v4/gopls-darwin-arm64/gopls"
}

View File

@@ -0,0 +1,12 @@
{
"inlayHints.enable": false,
"pyright.inlayHints.functionReturnTypes": false,
"pyright.inlayHints.variableTypes": false,
"languageserver": {
"godot": {
"host": "127.0.0.1",
"filetypes": ["gdscript"],
"port": 6005
}
}
}

View File

@@ -43,6 +43,11 @@ nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Remap keys for applying refactor code actions
nmap <silent> <leader>re <Plug>(coc-codeaction-refactor)
xmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
nmap <silent> <leader>r <Plug>(coc-codeaction-refactor-selected)
"set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Applying codeAction to the selected region.

View File

@@ -1,3 +0,0 @@
{
"pyright.inlayHints.enable": false
}

View File

@@ -0,0 +1,8 @@
" to use folding provided by plugin
setlocal foldmethod=expr
setlocal shiftwidth=4
setlocal tabstop=4
nnoremap <buffer> <F4> :GodotRunLast<CR>
nnoremap <buffer> <F5> :GodotRun<CR>
nnoremap <buffer> <F6> :GodotRunCurrent<CR>
nnoremap <buffer> <F7> :GodotRunFZF<CR>

2
vim/ftplugin/go.vim Normal file
View File

@@ -0,0 +1,2 @@
let g:go_imports_autosave = 1
" au BufWritePre,FileWritePre *.go :GoFmt

View File

@@ -0,0 +1,25 @@
" vim-plug example
"call plug#begin('~/.vim/bundle')
"Plug 'pearofducks/ansible-vim'
"call plug#end()
let g:ansible_goto_role_paths = './roles,../_common/roles'
function! FindAnsibleRoleUnderCursor()
echo "test!"
if exists("g:ansible_goto_role_paths")
let l:role_paths = g:ansible_goto_role_paths
else
let l:role_paths = "./roles"
endif
let l:tasks_main = expand("<cfile>") . "/tasks/main.yml"
let l:found_role_path = findfile(l:tasks_main, l:role_paths)
if l:found_role_path == ""
echo l:tasks_main . " not found"
else
execute "edit " . fnameescape(l:found_role_path)
endif
endfunction
nnoremap <leader>gd :call FindAnsibleRoleUnderCursor()<CR>
vnoremap <leader>gd :call FindAnsibleRoleUnderCursor()<CR>

View File

@@ -39,6 +39,8 @@ noremap <silent> <C-Down> :resize -3<CR>
set backspace=indent,eol,start
filetype plugin indent on
let hostname = substitute(system('hostname'), '\n', '', '')
if empty(glob('~/.vim/autoload/plug.vim')) "Если vim-plug не стоит
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@@ -57,12 +59,16 @@ call plug#begin('~/.vim/bundle') "Начать искать плагины в э
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'justinmk/vim-sneak'
Plug 'towolf/vim-helm'
Plug 'pearofducks/ansible-vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'elzr/vim-json'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'hashivim/vim-terraform'
" Plug 'Exafunction/codeium.vim'
Plug 'habamax/vim-godot'
call plug#end() "Перестать это делать
"
@@ -175,17 +181,29 @@ let g:ansible_yamlKeyName = 'yamlKey'
"
" CoC plugin settings
"
let g:coc_global_extensions = ['coc-pyright', 'coc-flutter', 'coc-sh']
if hostname == "i113855042"
let g:coc_user_config = '~/.vim/coc-lsp/coc-settings-cloudia.json'
else
let g:coc_user_config = '~/.vim/coc-lsp/coc-settings.json'
endif
let g:coc_global_extensions = ['coc-pyright', 'coc-sh', 'coc-go']
function! s:enable_coc_for_type()
let l:filesuffix_whitelist = ['py', 'dart', 'sh']
let l:filesuffix_whitelist = ['py', 'sh', 'go', 'gd', 'gdscript']
if index(l:filesuffix_whitelist, expand('%:e')) == -1
let b:coc_enabled = 0
endif
endfunction
autocmd BufRead,BufNewFile * call s:enable_coc_for_type()
source ~/.vim/coc.vim
source ~/.vim/coc-lsp/coc.vim
"
" vim-sneak plugin settings
"
let g:sneak#label = 1
" YAML files config
autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab
let g:indentLine_char = '⦙'
" vim-go settings
let g:go_fmt_autosave = 1

View File

@@ -1,7 +0,0 @@
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi