diff options
| author | 2025-11-28 01:52:34 +0300 | |
|---|---|---|
| committer | 2025-11-28 01:52:34 +0300 | |
| commit | 081881b714e83bf4330e0a31991966cbf67d931a (patch) | |
| tree | 52a10e627572d80c89ce553c2bc2d76018db8e63 | |
| parent | gitverse (diff) | |
| download | dotfiles-081881b714e83bf4330e0a31991966cbf67d931a.tar.gz dotfiles-081881b714e83bf4330e0a31991966cbf67d931a.tar.bz2 dotfiles-081881b714e83bf4330e0a31991966cbf67d931a.tar.xz dotfiles-081881b714e83bf4330e0a31991966cbf67d931a.zip | |
Небольшие апдейты
30 files changed, 823 insertions, 473 deletions
diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index 3affb7e..adebf91 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -2,7 +2,7 @@ $suspend_cmd = pidof steam || systemctl suspend || loginctl suspend # General_settings general { - before_sleep_cmd = hyprlock # command before sleep + before_sleep_cmd = swaylock -c 000000 # command before sleep ignore_dbus_inhibit = false # (used by e.g. firefox or steam) } @@ -16,7 +16,7 @@ listener { # Screen_lock listener { timeout = 600 - on-timeout = hyprlock + on-timeout = swaylock } # Screen_off diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index ca0ac77..caf9b43 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -14,7 +14,7 @@ monitor = eDP-1,prefered, auto, 1.5 # Set programs that you use $terminal = kitty -$fileManager = dolphin +$fileManager = nautilus -w # dolphin $menu = wofi --show drun @@ -27,9 +27,11 @@ $menu = wofi --show drun exec-once = $terminal exec-once = nm-applet & -exec-once = mako & hypridle & waybar & hyprpaper & firefox +exec-once = swaync & hypridle & waybar & hyprpaper & exec-once = snx-rs-gui & +exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +# ############################# ### ENVIRONMENT VARIABLES ### ############################# @@ -39,6 +41,13 @@ exec-once = snx-rs-gui & env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 +env = GTK_THEME,Adwaita-dark +env = QT_QPA_PLATFORMTHEME,gtk3 +env = QT_AUTO_SCREEN_SCALE_FACTOR,1 +env = QT_QPA_PLATFORM,wayland;xcb +env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 +exec = gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" +exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps ##################### ### LOOK AND FEEL ### @@ -63,7 +72,7 @@ general { # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false - layout = dwindle + # layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration @@ -171,7 +180,7 @@ bind = $mainMod, 36, exec, $terminal bind = $mainMod, Q, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager -bind = $mainMod, L, exec, hyprlock +bind = $mainMod, L, exec, swaylock -c 000000 bind = $mainMod, V, togglefloating, bind = $mainMod, F2, exec, $menu bind = $mainMod, P, pseudo, # dwindle diff --git a/config/mutt/gpg.rc b/config/mutt/gpg.rc new file mode 100644 index 0000000..4c7abde --- /dev/null +++ b/config/mutt/gpg.rc @@ -0,0 +1,52 @@ +# decode application/pgp +set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# verify a pgp/mime signature +set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" + +# decrypt a pgp/mime attachment +set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# create a pgp/mime signed attachment +# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" +set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" + +# create a application/pgp signed (old-style) message +# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" +set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" + +# create a pgp/mime encrypted attachment +# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to %?a? %a? -- -r %r -- %f" + +# create a pgp/mime encrypted and signed attachment +# set pgp_encrypt_sign_command="pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +set pgp_encrypt_sign_command="pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to %?a? %a? -- -r %r -- %f" + +# import a key into the public key ring +set pgp_import_command="gpg --no-verbose --import %f" + +# export a key from the public key ring +set pgp_export_command="gpg --no-verbose --export --armor %r" + +# verify a key +set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r" + +# read in the public key ring +set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" + +# read in the secret key ring +set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" + +# fetch keys +# set pgp_getkeys_command="pkspxycwrap %r" + +# pattern for good signature - may need to be adapted to locale! + +# set pgp_good_sign="^gpgv?: Good signature from " + +# OK, here's a version which uses gnupg's message catalog: +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" + +# This version uses --status-fd messages +set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" diff --git a/config/mutt/muttrc b/config/mutt/muttrc index c0d2213..5d1d5f2 100644 --- a/config/mutt/muttrc +++ b/config/mutt/muttrc @@ -51,9 +51,9 @@ color header brightgreen default ^Subject: color quoted cyan default color signature red default -source ~/.mutt/gpg.rc +source ~/.config/mutt/gpg.rc macro index,pager A "<save-message>=Archive<enter>" "mark message as Archived" macro index,pager S "<save-message>=Spam<enter>" "mark message as Spam" -source ~/neonxp.muttrc +source ~/.neonxp.muttrc diff --git a/config/nvim/colors/neonxp.lua b/config/nvim/colors/neonxp.lua deleted file mode 100644 index 1d7ab9f..0000000 --- a/config/nvim/colors/neonxp.lua +++ /dev/null @@ -1,142 +0,0 @@ -local function SetHl(group, mod, fg, bg) - - local fmt="highlight %s gui=%s cterm=%s guifg=%s ctermfg=%s guibg=%s ctermbg=%s" - vim.cmd(fmt:format(group, mod[1], mod[2], fg[1], fg[2], bg[1], bg[2])) -end -local colors = require("theme.colors") -local mods = require("theme.modifiers") - -vim.cmd([[hi normal guibg=NONE ctermbg=NONE]]) - --- VIM - INTERFACE ------------------- -SetHl("StatusLine", mods["bold"], colors["none"], colors["black_l"]) -SetHl("StatusLineNC", mods["none"], colors["none"], colors["black_l"]) -SetHl("TabLineSel", mods["bold"], colors["none"], colors["black_l"]) -SetHl("WinSeparator", mods["none"], colors["gray"], colors["none"]) -SetHl("Pmenu", mods["none"], colors["none"], colors["black_l"]) -SetHl("PmenuSel", mods["bold"], colors["none"], colors["black_l"]) -SetHl("PmenuThumb", mods["none"], colors["none"], colors["gray_dd"]) -SetHl("FloatBorder", mods["none"], colors["gray"], colors["none"]) - --- VIM - GENERAL TEXT ---------------------- -SetHl("Visual", mods["bold"], colors["none"], colors["black_l"]) -SetHl("Normal", mods["none"], colors["white"], colors["none"]) -SetHl("NormalFloat", mods["none"], colors["white"], colors["none"]) -SetHl("NonText", mods["none"], colors["gray"], colors["none"]) -SetHl("SpecialKey", mods["none"], colors["gray"], colors["none"]) -SetHl("Conceal", mods["none"], colors["gray"], colors["none"]) -SetHl("Folded", mods["none"], colors["none"], colors["none"]) -SetHl("MatchParen", mods["bold"], colors["yellow_l"], colors["black_l"]) -SetHl("Search", mods["bold"], colors["yellow_l"], colors["black_l"]) -SetHl("CurSearch", mods["bold"], colors["chartreuse_l"], colors["black_l"]) -SetHl("CursorLine", mods["bold"], colors["none"], colors["black_ll"]) -SetHl("CursorColumn", mods["bold"], colors["none"], colors["black_l"]) -SetHl("ColorColumn", mods["bold"], colors["none"], colors["black_ll"]) - --- VIM - INFO TEXT ------------------- -SetHl("LineNr", mods["italic"], colors["gray"], colors["none"]) -SetHl("SignColumn", mods["bold"], colors["gray"], colors["none"]) -SetHl("DiagnosticError", mods["none"], colors["red_l"], colors["none"]) -SetHl("DiagnosticWarn", mods["none"], colors["orange_l"], colors["none"]) -SetHl("DiagnosticOK", mods["none"], colors["green_l"], colors["none"]) -SetHl("DiagnosticInfo", mods["none"], colors["royal_l"], colors["none"]) -SetHl("DiffAdd", mods["none"], colors["green_l"], colors["black_l"]) -SetHl("DiffChange", mods["none"], colors["orange_l"], colors["black_l"]) -SetHl("DiffDelete", mods["none"], colors["red_l"], colors["black_l"]) -SetHl("DiffText", mods["none"], colors["royal_l"], colors["black_l"]) -SetHl("QuickFixLine", mods["none"], colors["royal_l"], colors["none"]) - --- VIM - MESSAGE TEXT ---------------------- -SetHl("ErrorMsg", mods["none"], colors["red_l"], colors["none"]) -SetHl("WarningMsg", mods["none"], colors["orange_l"], colors["none"]) -SetHl("Title", mods["bold"], colors["white"], colors["none"]) -SetHl("ModeMsg", mods["none"], colors["turquoise_l"], colors["none"]) -SetHl("MoreMsg", mods["none"], colors["turquoise_l"], colors["none"]) -SetHl("Question", mods["none"], colors["royal_l"], colors["none"]) - --- VIM - FILE SYSTEM --------------------- -SetHl("Directory", mods["none"], colors["royal_l"], colors["none"]) -SetHl("netrwClassify", mods["none"], colors["royal_d"], colors["none"]) -SetHl("netrwExe", mods["none"], colors["turquoise_l"], colors["none"]) - --- CODE - VIM GENERAL ---------------------- -SetHl("PreProc", mods["none"], colors["purple_l"], colors["none"]) -SetHl("PreCondit", mods["none"], colors["purple_l"], colors["none"]) -SetHl("Statement", mods["none"], colors["cyan_l"], colors["none"]) -SetHl("Type", mods["none"], colors["green_l"], colors["none"]) -SetHl("Identifier", mods["none"], colors["royal_l"], colors["none"]) -SetHl("Function", mods["none"], colors["turquoise_l"], colors["none"]) -SetHl("Delimiter", mods["none"], colors["gray_ll"], colors["none"]) -SetHl("Operator", mods["none"], colors["white"], colors["none"]) -SetHl("Constant", mods["none"], colors["white"], colors["none"]) -SetHl("Special", mods["none"], colors["white_dd"], colors["none"]) -SetHl("String", mods["italic"], colors["white"], colors["none"]) -SetHl("Comment", mods["italic"], colors["gray"], colors["none"]) -SetHl("SpecialComment", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("Todo", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("Debug", mods["italic"], colors["gray"], colors["none"]) -SetHl("Error", mods["none"], colors["red_l"], colors["none"]) -SetHl("Added", mods["none"], colors["green_l"], colors["none"]) -SetHl("Changed", mods["none"], colors["orange_l"], colors["none"]) -SetHl("Removed", mods["none"], colors["red_l"], colors["none"]) - --- CODE - TREESITTER GENERAL ----------------------------- -SetHl("@variable", mods["none"], colors["royal_l"], colors["none"]) -SetHl("@constant", mods["none"], colors["royal_l"], colors["none"]) -SetHl("@function.builtin", mods["none"], colors["turquoise_l"], colors["none"]) -SetHl("@variable.builtin", mods["none"], colors["purple_l"], colors["none"]) -SetHl("@constant.builtin", mods["none"], colors["purple_l"], colors["none"]) - --- CODE - TREESITTER BASH -------------------------- -SetHl("@variable.parameter.bash", mods["none"], colors["turquoise_d"], colors["none"]) -SetHl("@punctuation.special.bash", mods["none"], colors["royal_d"], colors["none"]) -SetHl("@character.special.bash", mods["none"], colors["purple_l"], colors["none"]) - --- ADDON - LAZY ---------------- -SetHl("LazyH1", mods["bold"], colors["purple_l"], colors["none"]) -SetHl("LazyH2", mods["bold"], colors["turquoise_l"], colors["none"]) -SetHl("LazyComment", mods["none"], colors["turquoise_d"], colors["none"]) -SetHl("LazyButton", mods["none"], colors["white"], colors["none"]) -SetHl("LazyButtonActive", mods["none"], colors["turquoise_l"], colors["none"]) -SetHl("LazySpecial", mods["bold"], colors["turquoise_l"], colors["none"]) - --- ADDON - LSPCMP ------------------ -SetHl("CmpItemKind", mods["italic"], colors["gray_l"], colors["none"]) -SetHl("CmpItemKindKeyword", mods["italic"], colors["cyan_l"], colors["none"]) -SetHl("CmpItemKindClass", mods["italic"], colors["yellow_l"], colors["none"]) -SetHl("CmpItemKindStruct", mods["italic"], colors["green_l"], colors["none"]) -SetHl("CmpItemKindEnum", mods["italic"], colors["salmon_l"], colors["none"]) -SetHl("CmpItemKindInterface", mods["italic"], colors["blue_l"], colors["none"]) -SetHl("CmpItemKindField", mods["italic"], colors["green_l"], colors["none"]) -SetHl("CmpItemKindUnit", mods["italic"], colors["salmon_l"], colors["none"]) -SetHl("CmpItemKindFile", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindFunction", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindMethod", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindModule", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindConstructor", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindOperator", mods["italic"], colors["turquoise_l"], colors["none"]) -SetHl("CmpItemKindFolder", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindConstant", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindVariable", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindReference", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindParameter", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindEnumMember", mods["italic"], colors["royal_l"], colors["none"]) -SetHl("CmpItemKindSnippet", mods["italic"], colors["purple_l"], colors["none"]) - --- ADDON - TELESCOPE --------------------- -SetHl("TelescopeTitle", mods["bold"], colors["white"], colors["none"]) -SetHl("TelescopeBorder", mods["none"], colors["gray"], colors["none"]) -SetHl("TelescopePromptPrefix", mods["none"], colors["purple_l"], colors["none"]) - - diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 87ac2a9..6ca25c9 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -35,4 +35,4 @@ require("autocommands") require("lsp") require("syntax") -- require("dap") - vim.cmd [[colorscheme sonokai]] + diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index ce08936..cabc14f 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -1,35 +1,38 @@ { - "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "alabaster.nvim": { "branch": "main", "commit": "1fc9e29fbbce94f127cc8b21960b7e3c85187960" }, "apidocs.nvim": { "branch": "main", "commit": "6f34023f9a14dda5fa1f06d8ffe53e689324d2d2" }, "auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" }, - "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, - "conform.nvim": { "branch": "master", "commit": "9d859cbfbde7a1bd1770e7c97aef30ec5a237a71" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "codecompanion.nvim": { "branch": "main", "commit": "8ad65eef735b31bb47d76f59d878ee1bac4bdc85" }, + "conform.nvim": { "branch": "master", "commit": "4993e07fac6679d0a5005aa7499e0bad2bd39f19" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "go.nvim": { "branch": "master", "commit": "db20146ef63322949af69b0955f80ee7d98145bd" }, + "go.nvim": { "branch": "master", "commit": "81bb94c1d21648245eb14c69461f5c7f8c705752" }, "goerr-nvim": { "branch": "main", "commit": "d30ba1cab652e78dbf6a644eb4823be57e9af203" }, - "goimpl.nvim": { "branch": "main", "commit": "2548d42c4db0645dea14f27e67c4b19b7030f1cf" }, - "guihua.lua": { "branch": "master", "commit": "c49a0fb7346586a1b1431d7e407f943c4164d8cb" }, - "headlines.nvim": { "branch": "master", "commit": "bf17c96a836ea27c0a7a2650ba385a7783ed322e" }, - "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, - "lazy.nvim": { "branch": "main", "commit": "59334064f8604ca073791c25dcc5c9698865406e" }, - "lsp_signature.nvim": { "branch": "master", "commit": "62cadce83aaceed677ffe7a2d6a57141af7131ea" }, + "goimpl.nvim": { "branch": "main", "commit": "a0c2d8cd1e37f0ae8c19dc954ced3c6ccdceed53" }, + "guihua.lua": { "branch": "master", "commit": "ef44ba40f12e56c1c9fa45967f2b4d142e4b97a0" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lsp_signature.nvim": { "branch": "master", "commit": "7d3bb0a641f516f1c7fd2e47852580dadbd7a430" }, "lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" }, - "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, - "nightfly": { "branch": "master", "commit": "5f88609dd9c3883b50a2728537c55afd5544f466" }, - "nvim-dap": { "branch": "master", "commit": "48570d8372f63c9e9ba399a16606f9553034a9b2" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "mcphub.nvim": { "branch": "main", "commit": "8ff40b5edc649959bb7e89d25ae18e055554859a" }, + "multicursor.nvim": { "branch": "1.0", "commit": "a6cf4e7daaf10a6b14bb7838caf779f0de5070cd" }, + "neogit": { "branch": "master", "commit": "411d615291d9e8f49b377410385febd1e9ce1787" }, + "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lspconfig": { "branch": "master", "commit": "e688b486fe9291f151eae7e5c0b5a5c4ef980847" }, + "nvim-lspconfig": { "branch": "master", "commit": "07f4e93de92e8d4ea7ab99602e3a8c9ac0fb778a" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-tree.lua": { "branch": "master", "commit": "87d096a39cb2d5d43e6771563575ff042a79f48b" }, + "nvim-tree.lua": { "branch": "master", "commit": "3fb91e18a727ecc0385637895ec397dea90be42a" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "41847d3dafb5004464708a3db06b14f12bde548a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, - "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" }, "smartcolumn.nvim": { "branch": "main", "commit": "b9cdbdf42f7ac5a659204cd5926017c7ff724a19" }, - "sonokai": { "branch": "master", "commit": "cf50520d1cddf7a4e7bccae650cdf0a6dd362a10" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" } + "telescope.nvim": { "branch": "master", "commit": "f0caedf064aa8c926325d7fe64c141d29b8e7853" } } diff --git a/config/nvim/lua/autocommands.lua b/config/nvim/lua/autocommands.lua index 1225718..f773190 100644 --- a/config/nvim/lua/autocommands.lua +++ b/config/nvim/lua/autocommands.lua @@ -53,7 +53,7 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { local TrimWhiteSpaceGrp = vim.api.nvim_create_augroup("TrimWhiteSpaceGrp", {}) vim.api.nvim_create_autocmd("BufWritePre", { group = TrimWhiteSpaceGrp, - pattern = "*", + pattern = "*.go", command = "%s/\\s\\+$//e", }) @@ -125,7 +125,7 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, { }) vim.api.nvim_create_autocmd("FileType", { - pattern = "go", + pattern = "*.go", callback = function() vim.opt_local.expandtab = false vim.opt_local.tabstop = 4 diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index 76919a8..6f06bde 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -1,77 +1,417 @@ -local map = vim.api.nvim_set_keymap local kmap = vim.keymap.set --- Базовые настройки навигации -- -map("n", "<Space>", "<Nop>", { noremap = true, silent = true }) --- Навигация в начало/конец строки -map("n", "<Home>", "^", { noremap = true, silent = true }) -map("n", "<End>", "$", { noremap = true, silent = true }) -map("v", "<Home>", "^", { noremap = true, silent = true }) -map("v", "<End>", "$", { noremap = true, silent = true }) -map("i", "<Home>", "<C-o>^", { noremap = true, silent = true }) -map("i", "<End>", "<C-o>$", { noremap = true, silent = true }) +local keys = { + -- ========== БАЗОВАЯ НАВИГАЦИЯ ========== + { + "<Space>", + "<Nop>", + { desc = "Disable Space in normal mode" }, + }, + { + "<Home>", + "^", + { desc = "Go to first non-blank character" }, + }, + { + "<End>", + "$", + { desc = "Go to end of line" }, + }, + { + "<Home>", + "^", + { mode = "v", desc = "Go to first non-blank character (visual)" }, + }, + { + "<End>", + "$", + { mode = "v", desc = "Go to end of line (visual)" }, + }, + { + "<Home>", + "<C-o>^", + { mode = "i", desc = "Go to first non-blank character (insert)" }, + }, + { + "<End>", + "<C-o>$", + { mode = "i", desc = "Go to end of line (insert)" }, + }, --- Фикс для визуального режима -map("v", "i", "<S-i>", { noremap = true, silent = true }) -map("v", "a", "<S-a>", { noremap = true, silent = true }) -map("v", "J", ":m '>+1<CR>gv=gv", { noremap = true, silent = true }) -map("v", "K", ":m '<-2<CR>gv=gv", { noremap = true, silent = true }) -map("v", "<", "<gv", { noremap = true, silent = true }) -map("v", ">", ">gv", { noremap = true, silent = true }) + -- ========== ВИЗУАЛЬНЫЙ РЕЖИМ ========== + { + "i", + "<S-i>", + { mode = "v", desc = "Select inner object" }, + }, + { + "a", + "<S-a>", + { mode = "v", desc = "Select around object" }, + }, + { + "J", + ":m '>+1<CR>gv=gv", + { mode = "v", desc = "Move selection down" }, + }, + { + "K", + ":m '<-2<CR>gv=gv", + { mode = "v", desc = "Move selection up" }, + }, + { + "<", + "<gv", + { mode = "v", desc = "Indent left and keep selection" }, + }, + { + ">", + ">gv", + { mode = "v", desc = "Indent right and keep selection" }, + }, --- {{{ Управление буферами -- -kmap("n", "<leader>bn", "<cmd>bnext<CR>", { noremap = true, silent = true, desc = "Next buffer" }) -kmap("n", "<leader>bp", "<cmd>bprevious<CR>", { noremap = true, silent = true, desc = "Previous buffer" }) -kmap("n", "<leader>bd", "<cmd>bdelete<CR>", { noremap = true, silent = true, desc = "Delete buffer" }) -kmap("n", "<C-s>", "<cmd>wa<CR>", { noremap = true, silent = true, desc = "Save all files" }) -kmap("n", "<leader>q", "<cmd>q<CR>", { noremap = true, silent = true, desc = "Exit" }) -kmap("n", "<leader>vs", "<cmd>vsplit<CR>", { noremap = true, silent = true, desc = "Vertical split" }) --- }}} + -- ========== УПРАВЛЕНИЕ БУФЕРАМИ ========== + { + "<leader>bn", + "<cmd>bnext<CR>", + { desc = "Next buffer" }, + }, + { + "<leader>bp", + "<cmd>bprevious<CR>", + { desc = "Previous buffer" }, + }, + { + "<leader>bd", + "<cmd>bdelete<CR>", + { desc = "Delete buffer" }, + }, + { + "<C-s>", + "<cmd>wa<CR>", + { desc = "Save all files" }, + }, + { + "<leader>q", + "<cmd>q<CR>", + { desc = "Exit" }, + }, + { + "<leader>vs", + "<cmd>vsplit<CR>", + { desc = "Vertical split" }, + }, --- {{{ Управление вкладками -- -kmap("n", "<A-Right>", ":tabnext<CR>", { noremap = true, silent = true, desc = "Next tab" }) -kmap("n", "<A-Left>", ":tabprevious<CR>", { noremap = true, silent = true, desc = "Previous tab" }) -kmap("n", "<A-t>", ":tabnew<CR>", { noremap = true, silent = true, desc = "New tab" }) -kmap("n", "<A-w>", ":tabclose<CR>", { noremap = true, silent = true, desc = "Close tab" }) + -- ========== УПРАВЛЕНИЕ ВКЛАДКАМИ ========== + { + "<A-Right>", + "<cmd>tabnext<CR>", + { desc = "Next tab" }, + }, + { + "<A-Left>", + "<cmd>tabprevious<CR>", + { desc = "Previous tab" }, + }, + { + "<A-t>", + "<cmd>tabnew<CR>", + { desc = "New tab" }, + }, + { + "<A-w>", + "<cmd>tabclose<CR>", + { desc = "Close tab" }, + }, --- Быстрый переход по вкладкам -- -for i = 1, 9 do - kmap("n", "<A-" .. i .. ">", ":tabn " .. i .. "<CR>", { noremap = true, silent = true, desc = "Go to tab " .. i }) -end + -- ========== NVIM-TREE (ФАЙЛОВЫЙ ЭКСПЛОРЕР) ========== + { + "<C-c>", + function() + local api = require("nvim-tree.api") + local global_cwd = vim.fn.getcwd(-1, -1) + api.tree.change_root(global_cwd) + end, + { desc = "Change tree root to CWD" }, + }, + { + "<F3>", + "<cmd>NvimTreeToggle<CR>", + { desc = "Toggle file tree" }, + }, --- }}} + -- ========== TELESCOPE (ПОИСК) ========== + { + "<leader>ff", + "<cmd>Telescope find_files<CR>", + { desc = "Find files" }, + }, + { + "<leader>fg", + "<cmd>Telescope live_grep<CR>", + { desc = "Live grep" }, + }, + { + "<leader>fb", + "<cmd>Telescope current_buffer_fuzzy_find<CR>", + { desc = "Find in current buffer" }, + }, + { + "<F4>", + "<cmd>Telescope buffers<CR>", + { desc = "Find buffers" }, + }, + { + "<leader>gc", + "<cmd>Telescope git_commits<CR>", + { desc = "Git commits" }, + }, + { + "<leader>gs", + "<cmd>Telescope git_status<CR>", + { desc = "Git status" }, + }, + { + "<leader>ch", + "<cmd>Telescope commands_history<CR>", + { desc = "Commands history" }, + }, + { + "<leader>e", + "<cmd>Telescope diagnostics<CR>", + { desc = "Diagnostics" }, + }, + { + "gi", + "<cmd>Telescope lsp_implementations<CR>", + { desc = "LSP implementations" }, + }, + { + "gr", + "<cmd>Telescope lsp_references<CR>", + { desc = "LSP references" }, + }, --- {{{ LSP функции -kmap("n", "d[", vim.diagnostic.goto_prev, { noremap = true, silent = true, desc = "Previous diagnostic" }) -kmap("n", "d]", vim.diagnostic.goto_next, { noremap = true, silent = true, desc = "Next diagnostic" }) + -- ========== LSP (ЯЗЫКОВОЙ СЕРВЕР) ========== + { + "d[", + vim.diagnostic.goto_prev, + { desc = "Previous diagnostic" }, + }, + { + "d]", + vim.diagnostic.goto_next, + { desc = "Next diagnostic" }, + }, + { + "gD", + vim.lsp.buf.declaration, + { desc = "Go to declaration" }, + }, + { + "gd", + vim.lsp.buf.definition, + { desc = "Go to definition" }, + }, + { + "K", + vim.lsp.buf.hover, + { desc = "Show documentation" }, + }, + { + "<C-k>", + vim.lsp.buf.signature_help, + { desc = "Signature help" }, + }, + { + "<leader>sad", + "<cmd>ApidocsOpen<cr>", + { desc = "Search Api Doc" }, + }, + { + "<leader>wa", + vim.lsp.buf.add_workspace_folder, + { desc = "Add workspace folder" }, + }, + { + "<leader>wr", + vim.lsp.buf.remove_workspace_folder, + { desc = "Remove workspace folder" }, + }, + { + "<leader>im", + function() + require("telescope").extensions.goimpl.goimpl({}) + end, + { desc = "Generate stub for interface on a type for golang" }, + }, + { + "<leader>wl", + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + { desc = "List workspace folders" }, + }, + { + "<A-CR>", + "<cmd>Lspsaga code_action<cr>", + { desc = "Code actions" }, + }, + { + "<F2>", + vim.lsp.buf.rename, + { desc = "Rename symbol" }, + }, + { + "<A-q>", + "gqip", + { desc = "Reflow line" }, + }, -kmap("n", "gD", vim.lsp.buf.declaration, { noremap = true, silent = true, desc = "Go to declaration" }) -kmap("n", "gd", vim.lsp.buf.definition, { noremap = true, silent = true, desc = "Go to definition" }) -kmap("n", "K", vim.lsp.buf.hover, { noremap = true, silent = true, desc = "Show documentation" }) + -- ========== ИЗМЕНЕНИЕ РАЗМЕРА ОКОН ========== + { + "<C-A-Left>", + function() + require("myplugins.resize").ResizeLeft() + end, + { desc = "Resize window left" }, + }, + { + "<C-A-Right>", + function() + require("myplugins.resize").ResizeRight() + end, + { desc = "Resize window right" }, + }, + { + "<C-A-Up>", + function() + require("myplugins.resize").ResizeUp() + end, + { desc = "Resize window up" }, + }, + { + "<C-A-Down>", + function() + require("myplugins.resize").ResizeDown() + end, + { desc = "Resize window down" }, + }, -kmap("n", "<C-k>", vim.lsp.buf.signature_help, { noremap = true, silent = true, desc = "Signature help" }) + -- ========== DAP (ОТЛАДКА) ========== + { + "<F6>", + function() + require("dapui").toggle() + end, + { desc = "Toggle debug UI" }, + }, + { + "<Leader>dh", + function() + require("dap.ui.widgets").hover() + end, + { desc = "Debug hover" }, + }, + { + "<Leader>dp", + function() + require("dap.ui.widgets").preview() + end, + { desc = "Debug preview" }, + }, + { + "<F9>", + function() + local widgets = require("dap.ui.widgets") + widgets.centered_float(widgets.scopes) + end, + { desc = "Debug scopes" }, + }, + { + "<F5>", + function() + require("dap").continue() + end, + { desc = "Debug continue" }, + }, + { + "<F17>", + function() -- S-F5 + require("dap").restart() + end, + { desc = "Debug restart" }, + }, + { + "<F29>", + function() -- C-F5 + require("dap").terminate() + end, + { desc = "Debug terminate" }, + }, + { + "<F8>", + function() + require("dap").step_over() + end, + { desc = "Debug step over" }, + }, + { + "<F7>", + function() + require("dap").step_into() + end, + { desc = "Debug step into" }, + }, + { + "<F19>", + function() -- S-F7 + require("dap").step_out() + end, + { desc = "Debug step out" }, + }, + { + "<A-b>", + function() + require("dap").toggle_breakpoint() + end, + { desc = "Toggle breakpoint" }, + }, -kmap( - "n", - "<leader>wa", - vim.lsp.buf.add_workspace_folder, - { noremap = true, silent = true, desc = "Add workspace folder" } -) + -- ========== ФОРМАТИРОВАНИЕ ========== + { + "<leader>mp", + function() + require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) + end, + { desc = "Format file or range (in visual mode)" }, + }, +} -kmap( - "n", - "<leader>wr", - vim.lsp.buf.remove_workspace_folder, - { noremap = true, silent = true, desc = "Remove workspace folder" } -) +-- Добавляем быстрый переход по вкладкам (1-9) +for i = 1, 9 do + table.insert(keys, { + "<A-" .. i .. ">", + "<cmd>tabn " .. i .. "<CR>", + { desc = "Go to tab " .. i }, + }) +end -kmap("n", "<leader>wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) -end, { noremap = true, silent = true, desc = "List workspace folders" }) +-- Применяем все кеймапинги +for _, mapping in ipairs(keys) do + local key = mapping[1] + local action = mapping[2] + local opts = mapping[3] or {} ---kmap("n", "<A-CR>", vim.lsp.buf.code_action, { noremap = true, silent = true, desc = "Code actions" }) -kmap("n", "<A-CR>", "<cmd>Lspsaga code_action<cr>", { noremap = true, silent = true, desc = "Code actions" }) + -- Извлекаем режим или используем "n" по умолчанию + local mode = opts.mode or "n" + -- Удаляем mode из opts, так как он передается отдельно + opts.mode = nil -kmap("n", "<F2>", vim.lsp.buf.rename, { noremap = true, silent = true, desc = "Rename symbol" }) + -- Устанавливаем silent = true по умолчанию + if opts.silent == nil then + opts.silent = true + end --- }}} + kmap(mode, key, action, opts) +end diff --git a/config/nvim/lua/keymaps_documentation.md b/config/nvim/lua/keymaps_documentation.md new file mode 100644 index 0000000..4a7f874 --- /dev/null +++ b/config/nvim/lua/keymaps_documentation.md @@ -0,0 +1,101 @@ +# Описание клавиатурных сокращений Neovim + +Данный документ содержит описание всех клавиатурных сокращений, настроенных в `keymaps.lua`, сгруппированных по категориям. + +--- + +## Базовая навигация + +- `<Space>` → Ничего не делает (отключено в нормальном режиме) +- `<Home>` → Переход к первому непустому символу строки (в нормальном режиме) +- `<End>` → Переход к концу строки (в нормальном режиме) +- `<Home>` → Переход к первому непустому символу строки (в визуальном режиме) +- `<End>` → Переход к концу строки (в визуальном режиме) +- `<Home>` → Переход к первому непустому символу строки (в режиме вставки) +- `<End>` → Переход к концу строки (в режиме вставки) + +## Визуальный режим + +- `i` → Выделить внутреннюю часть объекта (аналог `inner` в визуальном режиме) +- `a` → Выделить объект целиком (`around` в визуальном режиме) +- `J` → Переместить выделенный фрагмент вниз +- `K` → Переместить выделенный фрагмент вверх +- `<` → Уменьшить отступ выделения и сохранить выделение +- `>` → Увеличить отступ выделения и сохранить выделение + +## Управление буферами + +- `<leader>bn` → Следующий буфер +- `<leader>bp` → Предыдущий буфер +- `<leader>bd` → Удалить текущий буфер +- `<C-s>` → Сохранить все файлы +- `<leader>q` → Закрыть текущее окно/буфер +- `<leader>vs` → Вертикальное разделение окна + +## Управление вкладками + +- `<A-Right>` → Следующая вкладка +- `<A-Left>` → Предыдущая вкладка +- `<A-t>` → Новая вкладка +- `<A-w>` → Закрыть текущую вкладку +- `<A-1>` до `<A-9>` → Переход к вкладке по номеру (1–9) + +## Файловый эксплорер (nvim-tree) + +- `<C-c>` → Сменить корень проводника на текущий рабочий каталог +- `<F3>` → Показать/скрыть файловый проводник + +## Поиск (Telescope) + +- `<leader>ff` → Поиск файлов +- `<leader>fg` → Поиск по содержимому файлов (live grep) +- `<leader>fb` → Поиск в текущем файле +- `<F4>` → Поиск среди открытых буферов +- `<leader>gc` → Просмотр истории коммитов Git +- `<leader>gs` → Просмотр статуса Git +- `<leader>ch` → История команд +- `<leader>e` → Просмотр диагностических сообщений +- `gi` → Поиск реализаций LSP +- `gr` → Поиск ссылок (references) в LSP + +## LSP (Языковой сервер) + +- `d[` → Переход к предыдущей диагностике +- `d]` → Переход к следующей диагностике +- `gD` → Переход к объявлению (declaration) +- `gd` → Переход к определению (definition) +- `K` → Показать документацию (hover) +- `<C-k>` → Подсказка по сигнатуре функции +- `<leader>sad` → Поиск в API-документации +- `<leader>wa` → Добавить папку в рабочую область +- `<leader>wr` → Удалить папку из рабочей области +- `<leader>im` → Сгенерировать реализацию интерфейса (для Go) +- `<leader>wl` → Вывести список рабочих папок +- `<A-CR>` → Выполнить действие кода (code action) +- `<F2>` → Переименовать символ +- `<A-q>` → Перенести длинные строки (reflow) + +## Изменение размера окон + +- `<C-A-Left>` → Уменьшить ширину окна слева +- `<C-A-Right>` → Увеличить ширину окна справа +- `<C-A-Up>` → Уменьшить высоту окна сверху +- `<C-A-Down>` → Увеличить высоту окна снизу + +## Отладка (DAP) + +- `<F6>` → Показать/скрыть интерфейс отладки +- `<Leader>dh` → Подсказка при отладке (hover) +- `<Leader>dp` → Предварительный просмотр при отладке +- `<F9>` → Открыть области видимости в центре экрана +- `<F5>` → Продолжить выполнение +- `<S-F5>` → Перезапустить отладку +- `<C-F5>` → Остановить отладку +- `<F8>` → Шаг с обходом (step over) +- `<F7>` → Шаг с заходом (step into) +- `<S-F7>` → Шаг с выходом (step out) +- `<A-b>` → Установить/удалить точку останова + +## Форматирование + +- `<leader>mp` → Отформатировать файл или выделенный диапазон diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 1031287..91f22a1 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -1,5 +1,3 @@ --- инициализация LSP для различных ЯП -local lspconfig = require("lspconfig") local util = require("lspconfig/util") local function config(_config) @@ -19,12 +17,10 @@ local function config(_config) capabilities = capabilities, }, _config or {}) end --- иницализация gopls LSP для Go --- https://github.com/golang/tools/blob/master/gopls/doc/vim.md#neovim-install -lspconfig.gopls.setup(config({ +vim.lsp.config("gopls", { cmd = { "gopls", "serve" }, filetypes = { "go", "go.mod" }, - root_dir = util.root_pattern("go.work", "go.mod", ".git"), + root_markers = {"go.mod", ".git", "go.work"}, settings = { gopls = { analyses = { @@ -34,16 +30,18 @@ lspconfig.gopls.setup(config({ gofumpt = true, }, }, -})) +}) -lspconfig.templ.setup(config({ +vim.lsp.config("templ", { cmd = { "templ", "lsp" }, filetypes = { "templ" }, root_markers = { "go.work", "go.mod", ".git" }, -})) +}) +vim.lsp.enable("gopls") +vim.lsp.enable("templ") -lspconfig.v_analyzer.setup(config({ - cmd = { "v-analyzer" }, - filetypes = { "v", "vv", "vsh" }, - root_markers = { "v.mod", ".git" }, -})) +-- require('lspconfig').v_analyzer.setup(config({ +-- cmd = { "v-analyzer" }, +-- filetypes = { "v", "vv", "vsh" }, +-- root_markers = { "v.mod", ".git" }, +-- })) diff --git a/config/nvim/lua/options.lua b/config/nvim/lua/options.lua index 8c1366a..d30f768 100644 --- a/config/nvim/lua/options.lua +++ b/config/nvim/lua/options.lua @@ -23,7 +23,13 @@ local options = { writebackup = false, shiftwidth = 4, tabstop = 4, + softtabstop = 4, cursorline = true, + listchars = { + tab = '→→', + trail = '-', + nbsp = '+' + }, number = true, relativenumber = true, numberwidth = 4, @@ -33,7 +39,8 @@ local options = { foldmethod = "expr", foldexpr = "v:lua.vim.treesitter.foldexpr()", foldnestmax = 10, - foldlevel = 9, + -- foldlevel = 9, + foldlevel = 3, scrolloff = 999, so = vim.fn.floor(vim.fn.winheight(0) / 2), guicursor = "n-v-c:block,i-ci-ve:hor10,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175", diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 60b032d..b7e89f0 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -1,14 +1,9 @@ require("lazy").setup({ - { "bluz71/vim-nightfly-colors", name = "nightfly", lazy = false, priority = 1000 }, { - "sainnhe/sonokai", - lazy = false, - priority = 1000, + "p00f/alabaster.nvim", config = function() - -- Optionally configure and load the colorscheme - -- directly inside the plugin declaration. - vim.g.sonokai_enable_italic = true - vim.cmd.colorscheme("sonokai") + vim.cmd.colorscheme("alabaster") + vim.o.termguicolors = true end, }, { "nvim-lua/plenary.nvim" }, @@ -21,10 +16,20 @@ require("lazy").setup({ dependencies = { "saghen/blink.cmp" }, }, { "Snyssfx/goerr-nvim" }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + }, + }, + { + "mfussenegger/nvim-dap", + }, + + require("plugins.multicursor"), require("plugins.apidocs"), require("plugins.resize"), - require("plugins.blankline"), - require("plugins.headlines"), require("plugins.lsp_saga"), require("plugins.lsp_signature"), require("plugins.autosave"), @@ -33,13 +38,13 @@ require("lazy").setup({ require("plugins.tree"), require("plugins.conform"), require("plugins.dapui"), - require("plugins.dap"), require("plugins.dap_go"), require("plugins.go"), require("plugins.goimpl"), require("plugins.lualine"), require("plugins.telescope"), require("plugins.columns"), + require("plugins.codecompanion"), }, { performance = { rtp = { diff --git a/config/nvim/lua/plugins/apidocs.lua b/config/nvim/lua/plugins/apidocs.lua index 9bc35da..2727c09 100644 --- a/config/nvim/lua/plugins/apidocs.lua +++ b/config/nvim/lua/plugins/apidocs.lua @@ -10,7 +10,4 @@ return { -- require('apidocs').setup({picker = "snacks"}) -- Possible options are 'ui_select', 'telescope', and 'snacks' end, - keys = { - { "<leader>sad", "<cmd>ApidocsOpen<cr>", desc = "Search Api Doc" }, - }, } diff --git a/config/nvim/lua/plugins/autosave.lua b/config/nvim/lua/plugins/autosave.lua index 069afbf..f6f280d 100644 --- a/config/nvim/lua/plugins/autosave.lua +++ b/config/nvim/lua/plugins/autosave.lua @@ -1,18 +1,12 @@ return { "okuuva/auto-save.nvim", enabled = true, - cmd = "ASToggle", -- optional for lazy loading on command - event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events + cmd = "ASToggle", + event = { "InsertLeave", "TextChanged" }, opts = { - enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) - trigger_events = { -- See :h events - -- -- vim events that trigger an immediate save - -- -- I'm disabling this, as it's autosaving when I leave the buffer and - -- -- that's autoformatting stuff if on insert mode and following a tutorial - -- -- Re-enabling this to only save if NOT in insert mode in the condition below - -- immediate_save = { nil }, - immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save - -- vim events that trigger a deferred save (saves after `debounce_delay`) + enabled = true, + trigger_events = { + immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, defer_save = { "InsertLeave", "TextChanged", @@ -29,28 +23,12 @@ return { { "User", pattern = "SnacksPickerInputEnter" }, }, }, - -- function that takes the buffer handle and determines whether to save the current buffer or not - -- return true: if buffer is ok to be saved - -- return false: if it's not ok to be saved - -- if set to `nil` then no specific condition is applied condition = function(buf) - -- Do not save when I'm in insert mode - -- Do NOT ADD VISUAL MODE HERE or the cancel_deferred_save wont' work - -- If I STAY in insert mode and switch to another app, like YouTube to - -- take notes, the BufLeave or FocusLost immediate_save will be ignored - -- and the save will not be triggered local mode = vim.fn.mode() if mode == "i" then return false end - -- Disable auto-save for the harpoon plugin, otherwise it just opens and closes - -- https://github.com/ThePrimeagen/harpoon/issues/434 - -- - -- don't save for `sql` file types - -- I do this so when working with dadbod the file is not saved every time - -- I make a change, and a SQL query executed - -- Run `:set filetype?` on a dadbod query to make sure of the filetype local filetype = vim.bo[buf].filetype if filetype == "harpoon" or filetype == "mysql" then return false @@ -58,12 +36,10 @@ return { return true end, - write_all_buffers = true, -- write all buffers when the current one meets `condition` + write_all_buffers = true, noautocmd = false, - lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details - -- delay after which a pending save is executed (default 1000) + lockmarks = false, debounce_delay = 2000, - -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable debug = false, }, } diff --git a/config/nvim/lua/plugins/blankline.lua b/config/nvim/lua/plugins/blankline.lua deleted file mode 100644 index b74d9e6..0000000 --- a/config/nvim/lua/plugins/blankline.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - --@module "ibl" - --@type ibl.config - config = true, -} diff --git a/config/nvim/lua/plugins/codecompanion.lua b/config/nvim/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..a657d09 --- /dev/null +++ b/config/nvim/lua/plugins/codecompanion.lua @@ -0,0 +1,89 @@ +return { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown", "codecompanion" }, + }, + { + "ravitemer/mcphub.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + build = "npm install -g mcp-hub@latest", + config = function() + require("mcphub").setup() + end, + }, + }, + opts = { + opts = { + log_level = "DEBUG", -- or "TRACE" + }, + extensions = { + mcphub = { + callback = "mcphub.extensions.codecompanion", + opts = { + make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers + show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true) + add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`) + show_result_in_chat = true, -- Show tool results directly in chat buffer + format_tool = nil, -- function(tool_name:string, tool: CodeCompanion.Agent.Tool) : string Function to format tool names to show in the chat buffer + -- MCP Resources + make_vars = true, -- Convert MCP resources to #variables for prompts + -- MCP Prompts + make_slash_commands = true, -- Add MCP prompts as /slash commands + }, + }, + }, + strategies = { + chat = { + adapter = "scbt", + tools = { + opts = { + default_tools = { + "full_stack_dev", + "mcp", + }, + }, + opts = { + system_promt = "Ты полезный ассистент в редакторе neovim в плагине codecompanion. Основной зык программирования - go. Отвечай всегда на русском языке.", + }, + }, + }, + inline = { + adapter = "scbt", + }, + }, + memory = { + opts = { + chat = { + enabled = true, + }, + }, + }, + adapters = { + http = { + scbt = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + api_key = "cmd: age -d -i ~/.ssh/id_ed25519 ~/.openai-api-key.age", + url = "http://localhost:8888/api", + }, + + schema = { + model = { + default = "qwen3-235b-it", + choices = { + "qwen3-235b-it", + }, + }, + }, + }) + end, + }, + }, + }, +} diff --git a/config/nvim/lua/plugins/conform.lua b/config/nvim/lua/plugins/conform.lua index 3204d2d..3bd4e44 100644 --- a/config/nvim/lua/plugins/conform.lua +++ b/config/nvim/lua/plugins/conform.lua @@ -14,7 +14,7 @@ return { graphql = { "prettier" }, lua = { "stylua" }, python = { "isort", "black" }, - go = { "gofmt" }, + go = { "gofumpt" }, templ = { "templ" }, }, format_on_save = { @@ -24,12 +24,5 @@ return { }, }, keys = { - { - "<leader>mp", - function() - require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) - end, - desc = "Format file or range (in visual mode)", - }, - }, + }, } diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua deleted file mode 100644 index ab44a1e..0000000 --- a/config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "mfussenegger/nvim-dap", -} diff --git a/config/nvim/lua/plugins/dap_go.lua b/config/nvim/lua/plugins/dap_go.lua index 262aef8..0864da1 100644 --- a/config/nvim/lua/plugins/dap_go.lua +++ b/config/nvim/lua/plugins/dap_go.lua @@ -104,55 +104,4 @@ return { { text = "→", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } ) end, - keys = { - { - "<F5>", - function() - require("dap").continue() - end, - silent = true, - }, - { - "<F17>", -- S-F5 - function() - require("dap").restart() - end, - silent = true, - }, - { - "<F29>", -- C-F5 - function() - require("dap").terminate() - end, - silent = true, - }, - { - "<F8>", - function() - require("dap").step_over() - end, - silent = true, - }, - { - "<F7>", - function() - require("dap").step_into() - end, - silent = true, - }, - { - "<F19>", -- S-F7 - function() - require("dap").step_out() - end, - silent = true, - }, - { - "<A-b>", - function() - require("dap").toggle_breakpoint() - end, - silent = true, - }, - }, } diff --git a/config/nvim/lua/plugins/dapui.lua b/config/nvim/lua/plugins/dapui.lua index 5d35e1e..8530fd1 100644 --- a/config/nvim/lua/plugins/dapui.lua +++ b/config/nvim/lua/plugins/dapui.lua @@ -4,37 +4,6 @@ return { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio", }, - keys = { - { - "<F6>", - function() - require("dapui").toggle() - end, - silent = true, - }, - { - "<Leader>dh", - function() - require("dap.ui.widgets").hover() - end, - silent = true, - }, - { - "<Leader>dp", - function() - require("dap.ui.widgets").preview() - end, - silent = true, - }, - { - "<F9>", - function() - local widgets = require("dap.ui.widgets") - widgets.centered_float(widgets.scopes) - end, - silent = true, - }, - }, opts = { icons = { expanded = "[-]", diff --git a/config/nvim/lua/plugins/goimpl.lua b/config/nvim/lua/plugins/goimpl.lua index 0b906fa..9d97fb6 100644 --- a/config/nvim/lua/plugins/goimpl.lua +++ b/config/nvim/lua/plugins/goimpl.lua @@ -9,13 +9,4 @@ return { config = function() require("telescope").load_extension("goimpl") end, - keys = { - { - "<leader>im", - function() - require("telescope").extensions.goimpl.goimpl({}) - end, - desc = "Generate stub for interface on a type for golang", - }, - }, } diff --git a/config/nvim/lua/plugins/headlines.lua b/config/nvim/lua/plugins/headlines.lua deleted file mode 100644 index 5d92245..0000000 --- a/config/nvim/lua/plugins/headlines.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "lukas-reineke/headlines.nvim", - dependencies = "nvim-treesitter/nvim-treesitter", - config = true, - } diff --git a/config/nvim/lua/plugins/multicursor.lua b/config/nvim/lua/plugins/multicursor.lua new file mode 100644 index 0000000..0a762a8 --- /dev/null +++ b/config/nvim/lua/plugins/multicursor.lua @@ -0,0 +1,76 @@ +return { + "jake-stewart/multicursor.nvim", + branch = "1.0", + config = function() + local mc = require("multicursor-nvim") + mc.setup() + + local set = vim.keymap.set + + -- Add or skip cursor above/below the main cursor. + set({ "n", "x" }, "<A-up>", function() + mc.lineAddCursor(-1) + end ) + set({ "n", "x" }, "<A-down>", function() + mc.lineAddCursor(1) + end ) + set({ "n", "x" }, "<leader><up>", function() + mc.lineSkipCursor(-1) + end) + set({ "n", "x" }, "<leader><down>", function() + mc.lineSkipCursor(1) + end) + + -- Add or skip adding a new cursor by matching word/selection + set({ "n", "x" }, "<leader>n", function() + mc.matchAddCursor(1) + end) + set({ "n", "x" }, "<leader>s", function() + mc.matchSkipCursor(1) + end) + set({ "n", "x" }, "<leader>N", function() + mc.matchAddCursor(-1) + end) + set({ "n", "x" }, "<leader>S", function() + mc.matchSkipCursor(-1) + end) + + -- Add and remove cursors with control + left click. + set("n", "<c-leftmouse>", mc.handleMouse) + set("n", "<c-leftdrag>", mc.handleMouseDrag) + set("n", "<c-leftrelease>", mc.handleMouseRelease) + + -- Disable and enable cursors. + set({ "n", "x" }, "<c-q>", mc.toggleCursor) + + -- Mappings defined in a keymap layer only apply when there are + -- multiple cursors. This lets you have overlapping mappings. + mc.addKeymapLayer(function(layerSet) + -- Select a different cursor as the main one. + layerSet({ "n", "x" }, "<left>", mc.prevCursor) + layerSet({ "n", "x" }, "<right>", mc.nextCursor) + + -- Delete the main cursor. + layerSet({ "n", "x" }, "<leader>x", mc.deleteCursor) + + -- Enable and clear cursors using escape. + layerSet("n", "<esc>", function() + if not mc.cursorsEnabled() then + mc.enableCursors() + else + mc.clearCursors() + end + end) + end) + + -- Customize how cursors look. + local hl = vim.api.nvim_set_hl + hl(0, "MultiCursorCursor", { reverse = true }) + hl(0, "MultiCursorVisual", { link = "Visual" }) + hl(0, "MultiCursorSign", { link = "SignColumn" }) + hl(0, "MultiCursorMatchPreview", { link = "Search" }) + hl(0, "MultiCursorDisabledCursor", { reverse = true }) + hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + hl(0, "MultiCursorDisabledSign", { link = "SignColumn" }) + end, +} diff --git a/config/nvim/lua/plugins/resize.lua b/config/nvim/lua/plugins/resize.lua index 7e22517..bdb3ff6 100644 --- a/config/nvim/lua/plugins/resize.lua +++ b/config/nvim/lua/plugins/resize.lua @@ -1,34 +1,4 @@ return { name = "resize", dir = "~/.config/nvim/lua/myplugins", - keys = { - { - "<C-A-Left>", - function() - require("myplugins.resize").ResizeLeft() - end, - silent = true, - }, - { - "<C-A-Right>", - function() - require("myplugins.resize").ResizeRight() - end, - silent = true, - }, - { - "<C-A-Up>", - function() - require("myplugins.resize").ResizeUp() - end, - silent = true, - }, - { - "<C-A-Down>", - function() - require("myplugins.resize").ResizeDown() - end, - silent = true, - }, - }, } diff --git a/config/nvim/lua/plugins/telescope.lua b/config/nvim/lua/plugins/telescope.lua index aabcd9c..018d95c 100644 --- a/config/nvim/lua/plugins/telescope.lua +++ b/config/nvim/lua/plugins/telescope.lua @@ -29,22 +29,4 @@ return { }, }) end, - keys = { - { "<leader>ff", "<cmd>Telescope find_files<CR>", noremap = true, silent = true, desc = "Find files" }, - { "<leader>fg", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true, desc = "Live grep" }, - { - "<leader>fb", - "<cmd>Telescope current_buffer_fuzzy_fund<CR>", - noremap = true, - silent = true, - desc = "Find current file", - }, - { "<F4>", "<cmd>Telescope buffers<CR>", noremap = true, silent = true, desc = "Find buffers" }, - { "<leader>gc", "<cmd>Telescope git_commits<CR>", noremap = true, silent = true }, - { "<leader>gs", "<cmd>Telescope git_status<CR>", noremap = true, silent = true }, - { "<leader>ch", "<cmd>Telescope commands_history<CR>", noremap = true, silent = true }, - { "<leader>e", "<cmd>Telescope diagnostics<CR>", noremap = true, silent = true }, - { "gi", "<cmd>Telescope lsp_implementations<CR>", noremap = true, silent = true }, - { "gr", "<cmd>Telescope lsp_references<CR>", noremap = true, silent = true }, - }, } diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua index 3bf9eed..30c0599 100644 --- a/config/nvim/lua/plugins/tree.lua +++ b/config/nvim/lua/plugins/tree.lua @@ -37,18 +37,4 @@ return { enable = true, }, }, - keys = { - { - "<C-c>", - function() - local api = require("nvim-tree.api") - local global_cwd = vim.fn.getcwd(-1, -1) - api.tree.change_root(global_cwd) - end, - noremap = true, - silent = true, - desc = "Change tree root to CWD", - }, - { "<F3>", ":NvimTreeToggle<CR>", noremap = true, silent = true, desc = "Toggle file tree" }, - }, } diff --git a/config/waybar/style.css b/config/waybar/style.css index 59fee8e..c00f1ff 100644 --- a/config/waybar/style.css +++ b/config/waybar/style.css @@ -62,6 +62,12 @@ button:hover { #workspaces button:hover { background: rgba(0, 0, 0, 0.2); } +#workspaces button.active { + background: rgba(0, 0, 0, 0.2); + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + #workspaces button.focused { background-color: #64727D; diff --git a/git/.gitconfig b/git/.gitconfig index 27099af..9490d3f 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -158,3 +158,5 @@ changed = green untracked = cyan +[url "git@github.com:"] + insteadOf = https://github.com/ @@ -3,6 +3,8 @@ source ~/.config/zsh/conf.d/*.zsh source ~/.config/zsh/termsupport.zsh source ~/.config/zsh/title.zsh +setfont /usr/lib/kbd/consolefonts/ruscii_8x16.psfu.gz + # {{{ Exports export GOPROXY=https://goproxy.ru,direct export GONOPROXY=*.sovcombank.group @@ -14,11 +16,10 @@ export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/platform-tools export GOPATH=~/go -export PATH=$PATH:~/.local/bin:$GOPATH/bin #:~/.cargo/bin:~/.config/v-analyzer/bin:~/projects/tinygo/bin +export PATH=$PATH:~/.local/bin:$GOPATH/bin:~/.cargo/bin #:~/.config/v-analyzer/bin:~/projects/tinygo/bin export GOBIN=$GOPATH/bin export GPG_TTY=$(tty) export LS_OPTIONS='--color=auto' - eval "$(dircolors -b)" # }}} @@ -52,6 +53,11 @@ alias p=python3 alias t=todo.sh alias ed=gnome-text-editor alias open=xdg-open +alias m=micro +alias ev='nvim +/`date +"%Y-%m-%d"` ~/txt/calendar.txt' +alias qn='nvim "+normal G" ~/txt/quicknote.txt' +alias mutt=neomutt + [[ ! -f `which exa` ]] || alias ls="exa" && alias ll="exa -l" compdef _todo t # }}} |
