From e2bdd71b08394df31e7360ffb206620f17cd6ed7 Mon Sep 17 00:00:00 2001 From: Dmitrii Chumak Date: Mon, 2 Jun 2025 14:32:15 +0300 Subject: [PATCH 1/6] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3819313..3cf9da1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.swp *.swo +.netrwhist From ba7cec969ffd19ffca6b02d99542ed390498bd28 Mon Sep 17 00:00:00 2001 From: Dmitry Chumak Date: Fri, 4 Jul 2025 00:52:22 +0300 Subject: [PATCH 2/6] [nvim] smth --- nvim/after/ftplugin/go.lua | 2 +- nvim/after/ftplugin/javascriptreact.lua | 14 +++++++++++ nvim/after/ftplugin/json.lua | 7 ++++++ nvim/after/ftplugin/nix.lua | 4 +++ nvim/lua/lsp-config.lua | 33 ++++++++++++++++++++++++- nvim/lua/plugins/init.lua | 4 +-- 6 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 nvim/after/ftplugin/javascriptreact.lua create mode 100644 nvim/after/ftplugin/json.lua create mode 100644 nvim/after/ftplugin/nix.lua diff --git a/nvim/after/ftplugin/go.lua b/nvim/after/ftplugin/go.lua index 7e13d97..0c1c3a0 100644 --- a/nvim/after/ftplugin/go.lua +++ b/nvim/after/ftplugin/go.lua @@ -1 +1 @@ -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] +vim.cmd [[autocmd BufWritePre *.go lua vim.lsp.buf.format()]] diff --git a/nvim/after/ftplugin/javascriptreact.lua b/nvim/after/ftplugin/javascriptreact.lua new file mode 100644 index 0000000..b255580 --- /dev/null +++ b/nvim/after/ftplugin/javascriptreact.lua @@ -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 +-- }) diff --git a/nvim/after/ftplugin/json.lua b/nvim/after/ftplugin/json.lua new file mode 100644 index 0000000..9f7e996 --- /dev/null +++ b/nvim/after/ftplugin/json.lua @@ -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, +}) diff --git a/nvim/after/ftplugin/nix.lua b/nvim/after/ftplugin/nix.lua new file mode 100644 index 0000000..45a6d74 --- /dev/null +++ b/nvim/after/ftplugin/nix.lua @@ -0,0 +1,4 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.expandtab = true diff --git a/nvim/lua/lsp-config.lua b/nvim/lua/lsp-config.lua index d9e7506..4ff279b 100644 --- a/nvim/lua/lsp-config.lua +++ b/nvim/lua/lsp-config.lua @@ -33,7 +33,7 @@ local on_attach = function(client, bufnr) vim.keymap.set("n", "gd", vim.lsp.buf.definition, Append(bufopts, "desc", "Go to definition")) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) vim.keymap.set("n", "gi", vim.lsp.buf.implementation, Append(bufopts, "desc", "Go to implementation")) - vim.keymap.set("n", "gr", require'telescope.builtin'.lsp_references, Append(bufopts, "desc", "Go to references")) + vim.keymap.set("n", "gr", require 'telescope.builtin'.lsp_references, Append(bufopts, "desc", "Go to references")) vim.keymap.set("n", "", vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, bufopts) @@ -121,6 +121,37 @@ require("lspconfig").bashls.setup { capabilities = capabilities, handlers = hand } } } +require("lspconfig").nixd.setup { capabilities = capabilities, handlers = handlers, + cmd = { 'nixd' }, + filetypes = { 'nix' }, + root_dir = function(fname) + return require('lspconfig.util').root_pattern( + 'flake.nix', + 'shell.nix', + 'default.nix', + '.git' + )(fname) or vim.fn.getcwd() + end, + on_attach = on_attach, + settings = { + nixd = { + formatting = { + command = { "nixpkgs-fmt" } -- Uses nixpkgs-fmt for formatting + }, + eval = { + depth = 3, -- Evaluation depth + workers = 2, -- Number of evaluation workers + }, + completion = { + autoImport = true -- Auto-import completions + }, + nixpkgs = { + expr = "import {}", -- Default nixpkgs expression + -- path = "/path/to/your/nixpkgs" -- Optional explicit path + } + } + } +} require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers, on_attach = on_attach, -- more details on configuring pyright can be found here diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index a9adf06..c51c1fc 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -28,9 +28,9 @@ local plugins = { -- ... }) - vim.cmd('colorscheme github_light_colorblind') + -- vim.cmd('colorscheme github_light_colorblind') -- vim.cmd('colorscheme github_light') - -- vim.cmd('colorscheme github_dark_colorblind') + vim.cmd('colorscheme github_dark_colorblind') -- vim.cmd('colorscheme github_dark') end, }, From 880bbd18e0e4608840aca314c4d8be47b19515f8 Mon Sep 17 00:00:00 2001 From: Dmitrii Chumak Date: Thu, 24 Jul 2025 18:04:28 +0300 Subject: [PATCH 3/6] [vim] migration to 0.11 and native lsp client --- nvim/lazy-lock.json | 27 ++++--- nvim/lsp/basedpyright.lua | 25 ++++++ nvim/lsp/bashls.lua | 25 ++++++ nvim/lsp/gopls.lua | 20 +++++ nvim/lsp/lua_ls.lua | 33 ++++++++ nvim/lua/lsp-config.lua | 157 +++++++++++--------------------------- nvim/lua/plugins/init.lua | 9 +-- 7 files changed, 164 insertions(+), 132 deletions(-) create mode 100644 nvim/lsp/basedpyright.lua create mode 100644 nvim/lsp/bashls.lua create mode 100644 nvim/lsp/gopls.lua create mode 100644 nvim/lsp/lua_ls.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 53c440b..52daef0 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,20 +1,19 @@ { - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "codecompanion.nvim": { "branch": "main", "commit": "1b1bfc71f426a50ece54489078f5afe82b0af90c" }, + "LuaSnip": { "branch": "master", "commit": "3d5bced1b9ae69fa3f9b1942e28af5dbc537f946" }, + "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" }, "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, - "gitsigns.nvim": { "branch": "main", "commit": "011dc6718bcebdf92a5336bb0da79189c3afe621" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "nvim-cmp": { "branch": "main", "commit": "c27370703e798666486e3064b64d59eaf4bdc6d5" }, - "nvim-lspconfig": { "branch": "master", "commit": "fd26f8626c03b424f7140d454031d1dcb8d23513" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, - "outline.nvim": { "branch": "main", "commit": "ae473fb51b7b6086de0876328c81a63f9c3ecfef" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-lspconfig": { "branch": "master", "commit": "169745f176f58becad80363c3f8f2315ed6bb365" }, + "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": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, - "telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "7bf55ed0ff5be182ad3301cff266581fc1c56cce" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/lsp/basedpyright.lua b/nvim/lsp/basedpyright.lua new file mode 100644 index 0000000..25796bc --- /dev/null +++ b/nvim/lsp/basedpyright.lua @@ -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 = { + } + }, + }, + }, +} diff --git a/nvim/lsp/bashls.lua b/nvim/lsp/bashls.lua new file mode 100644 index 0000000..612caae --- /dev/null +++ b/nvim/lsp/bashls.lua @@ -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', + }, + }, + }, +} diff --git a/nvim/lsp/gopls.lua b/nvim/lsp/gopls.lua new file mode 100644 index 0000000..8a60d91 --- /dev/null +++ b/nvim/lsp/gopls.lua @@ -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, + -- }, + -- }, + -- }, +} diff --git a/nvim/lsp/lua_ls.lua b/nvim/lsp/lua_ls.lua new file mode 100644 index 0000000..cdef273 --- /dev/null +++ b/nvim/lsp/lua_ls.lua @@ -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, + }, + } + } +} + diff --git a/nvim/lua/lsp-config.lua b/nvim/lua/lsp-config.lua index d9e7506..30edaa8 100644 --- a/nvim/lua/lsp-config.lua +++ b/nvim/lua/lsp-config.lua @@ -4,57 +4,55 @@ require("mason-lspconfig").setup({ 'lua_ls', 'gopls', 'bashls', - 'pyright', + 'basedpyright', }, automatic_installation = true, + automatic_enable = false }) --- Customized on_attach function --- See `:help vim.diagnostic.*` for documentation on any of the below functions --- local opts = { noremap = true, silent = true } -vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) -vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) +local keymap = vim.keymap.set -local on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(ev) + local bufnr = ev.buf + local bufopts = { noremap = true, silent = true, buffer = bufnr } - if client.name == "rust_analyzer" then - -- This requires Neovim 0.10 or later - vim.lsp.inlay_hint.enable() + 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", "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", "", lsp.buf.signature_help, bufopts) + keymap("n", "wa", lsp.buf.add_workspace_folder, bufopts) + keymap("n", "wr", lsp.buf.remove_workspace_folder, bufopts) + keymap("n", "wl", function() + print(vim.inspect(lsp.buf.list_workspace_folders())) + end, bufopts) + keymap("n", "rn", lsp.buf.rename, opt("[l]sp [R]ename")) + keymap("n", "lc", lsp.buf.code_action, opt("[l]sp [C]ode Action")) + keymap("n", "lf", function() + lsp.buf.format({ + async = true, + }) + end, opt("[l]sp [f]ormat buffer")) end - - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, Append(bufopts, "desc", 'Go to declaration')) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, Append(bufopts, "desc", "Go to definition")) - vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, Append(bufopts, "desc", "Go to implementation")) - vim.keymap.set("n", "gr", require'telescope.builtin'.lsp_references, Append(bufopts, "desc", "Go to references")) - vim.keymap.set("n", "", vim.lsp.buf.signature_help, bufopts) - vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set("n", "wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) - vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) - vim.keymap.set("n", "lf", function() - vim.lsp.buf.format({ - async = true, - }) - end, bufopts) -end +}) -- Add the border on hover and on signature help popup window -local handlers = { - ['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }), - ['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }), -} +vim.o.winborder = 'rounded' -- Add border to the diagnostic popup window vim.diagnostic.config({ @@ -65,76 +63,13 @@ vim.diagnostic.config({ underline = true, update_in_insert = false, -- Don't update diagnostics in insert mode severity_sort = true, -- Sort diagnostics by severity - float = { border = "rounded" }, + jump = { float = true }, }) -local capabilities = require('cmp_nvim_lsp').default_capabilities() +keymap("n", "e", vim.diagnostic.open_float, opts) +keymap("n", "q", vim.diagnostic.setloclist, opts) -require("lspconfig").lua_ls.setup({ - on_attach = on_attach, - 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, - }, - } - }, - capabilities = capabilities, - handlers = handlers -}) -require("lspconfig").gopls.setup { capabilities = capabilities, handlers = handlers, on_attach = on_attach, - cmd = IsYandex and { "/home/dmchumak/.ya/tools/v3/gopls-linux/gopls" }, - root_dir = IsYandex and require('lspconfig').util.root_pattern("YAOWNERS", "ya.make", ".arcadia.root", ".cloudia.root", "go.work", "go.mod", ".git"), - -- settings = { - -- gopls = { - -- arcadiaIndexDirs = { - -- "/home/horseinthesky/bl/cloud-go/cloud/cloud-go/cloudgate", - -- }, - -- }, - -- }, -} -require("lspconfig").bashls.setup { capabilities = capabilities, handlers = handlers, - on_attach = on_attach, - settings = { - bashIde = { - globPattern = "*@(.sh|.inc|.bash|.command)" - } - } -} -require("lspconfig").pyright.setup { capabilities = capabilities, handlers = handlers, - on_attach = on_attach, - -- more details on configuring pyright can be found here - -- https://microsoft.github.io/pyright/#/settings?id=pyright-settings - settings = { - python = { - analysis = { - include = { - '~/arcadia', - '~/arcadia/yt/python', - '~/arcadia/contrib/libs/protobuf/python', - '~/arcadia/contrib/python', - } - } - } - } -} +vim.lsp.enable("lua_ls") +vim.lsp.enable("bashls") +vim.lsp.enable("gopls") +vim.lsp.enable("basedpyright") diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index a9adf06..ecd2604 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -14,10 +14,6 @@ vim.opt.rtp:prepend(lazypath) local plugins = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", - { - "neovim/nvim-lspconfig", - dependencies = { 'hrsh7th/cmp-nvim-lsp' } - }, { 'projekt0n/github-nvim-theme', name = 'github-theme', @@ -51,9 +47,8 @@ local plugins = { "folke/which-key.nvim", event = "VeryLazy", opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below + preset = "modern", + show_help = false, -- workaround for border glitch https://github.com/folke/which-key.nvim/issues/967#issuecomment-2842309305 }, keys = { { From 4fe6739d9d643114183407947f7fb5ec055f6ec6 Mon Sep 17 00:00:00 2001 From: Dmitrii Chumak Date: Sun, 31 Aug 2025 12:57:05 +0300 Subject: [PATCH 4/6] [nvim] avante plugin --- nvim/lazy-lock.json | 4 +++- nvim/lua/plugins/init.lua | 32 ++++++++++++++++++++++++++++++++ shell/alias.sh | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 52daef0..c8dec21 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,15 +1,17 @@ { "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-lspconfig": { "branch": "master", "commit": "169745f176f58becad80363c3f8f2315ed6bb365" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "outline.nvim": { "branch": "main", "commit": "0eb9289ab39c91caf8b3ed0e3a17764809d69558" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 6dbbac9..a147520 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -87,6 +87,38 @@ local plugins = { "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) diff --git a/shell/alias.sh b/shell/alias.sh index 9a0628b..aa64e56 100644 --- a/shell/alias.sh +++ b/shell/alias.sh @@ -1,4 +1,4 @@ -alias l="ls -lah" +alias l="ls -lahG" alias lg="LANG=en_US-UTF-8 lazygit" alias v="vim" alias n="nvim" From 7079e870f8bdbfb5e6c0780194ba368e39282547 Mon Sep 17 00:00:00 2001 From: Dmitry Chumak Date: Fri, 28 Nov 2025 22:22:00 +0300 Subject: [PATCH 5/6] [nvim] :W-:w :Q-:q aliases --- nvim/lua/options.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 59bc461..d8cf1c9 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -39,3 +39,11 @@ vim.keymap.set('v','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 ,write ") +vim.cmd("command! -bar -nargs=* -complete=file -range=% -bang Write ,write ") +vim.cmd("command! -bar -nargs=* -complete=file -range=% -bang Wq ,wq ") +vim.cmd("command! -bar -bang Q quit") +vim.cmd("command! -bar -bang Qall qall") +vim.cmd("command! -bar -bang Qa qall") From 025ff1e65776e4e46e891fb97e92f320ae5cfbde Mon Sep 17 00:00:00 2001 From: Dmitrii Chumak Date: Tue, 24 Feb 2026 13:00:06 +0300 Subject: [PATCH 6/6] [nvim] codecompanion removed, added starpls --- nvim/lazy-lock.json | 28 ++++++----- nvim/lsp/starpls.lua | 5 ++ nvim/lua/lsp-config.lua | 3 +- nvim/lua/plugins/codecompanion.lua | 74 +++++++++++++++--------------- nvim/lua/plugins/init.lua | 39 +++++++++++----- 5 files changed, 84 insertions(+), 65 deletions(-) create mode 100644 nvim/lsp/starpls.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index c8dec21..014530f 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,21 +1,19 @@ { - "LuaSnip": { "branch": "master", "commit": "3d5bced1b9ae69fa3f9b1942e28af5dbc537f946" }, - "avante.nvim": { "branch": "main", "commit": "2fc63d4128d2dc2fef0913c7480b4586959ebe4e" }, + "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, + "avante.nvim": { "branch": "main", "commit": "e89eb79abf5754645e20aa6074da10ed20bba33c" }, "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" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "fzf-lua": { "branch": "main", "commit": "a8458b79a957a6e3e217d84106a0fd4b9470ff4c" }, "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" }, + "lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3590d66effccc7376d8c3dbe45e8291f9fed2843" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "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" }, + "nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" }, + "outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/nvim/lsp/starpls.lua b/nvim/lsp/starpls.lua new file mode 100644 index 0000000..33c748b --- /dev/null +++ b/nvim/lsp/starpls.lua @@ -0,0 +1,5 @@ +return { + cmd = { 'starpls' }, + filetypes = { 'starlark' }, + root_markers = { 'WORKSPACE' }, +} diff --git a/nvim/lua/lsp-config.lua b/nvim/lua/lsp-config.lua index 30edaa8..bb3f704 100644 --- a/nvim/lua/lsp-config.lua +++ b/nvim/lua/lsp-config.lua @@ -3,7 +3,7 @@ require("mason-lspconfig").setup({ ensure_installed = { 'lua_ls', 'gopls', - 'bashls', + 'bashls', -- install "shfmt" binary for formatting capabilities 'basedpyright', }, automatic_installation = true, @@ -73,3 +73,4 @@ vim.lsp.enable("lua_ls") vim.lsp.enable("bashls") vim.lsp.enable("gopls") vim.lsp.enable("basedpyright") +vim.lsp.enable("starpls") diff --git a/nvim/lua/plugins/codecompanion.lua b/nvim/lua/plugins/codecompanion.lua index 7c1b4f6..4fcc405 100644 --- a/nvim/lua/plugins/codecompanion.lua +++ b/nvim/lua/plugins/codecompanion.lua @@ -1,37 +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, - }, -}) +-- 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, +-- }, +-- }) diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index a147520..41e8d7e 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -24,9 +24,9 @@ local plugins = { -- ... }) - -- vim.cmd('colorscheme github_light_colorblind') + vim.cmd('colorscheme github_light_colorblind') -- vim.cmd('colorscheme github_light') - vim.cmd('colorscheme github_dark_colorblind') + -- vim.cmd('colorscheme github_dark_colorblind') -- vim.cmd('colorscheme github_dark') end, }, @@ -79,14 +79,14 @@ local plugins = { -- Your setup opts here }, }, - { - "olimorris/codecompanion.nvim", - opts = {}, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - }, + -- { + -- "olimorris/codecompanion.nvim", + -- opts = {}, + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "nvim-treesitter/nvim-treesitter", + -- }, + -- }, { "yetone/avante.nvim", build = vim.fn.has("win32") ~= 0 @@ -97,13 +97,28 @@ local plugins = { ---@module 'avante' ---@type avante.Config opts = { - provider = "yadeepseek", + provider = "yaqwencode", 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", + use_ReAct_prompt = true, + }, + yaqwencode = { + __inherited_from = "openai", + api_key_name = "cmd:cat ~/.config/eliza_api_key", + endpoint = "https://api.eliza.yandex.net/raw/internal/qwen3-coder-480b-a35b-runtime/v1", + model = "qwen3-coder-480b-a35b-runtime", + use_ReAct_prompt = true, + }, + yaclaude = { + __inherited_from = "openai", + api_key_name = "cmd:cat ~/.config/eliza_api_key", + endpoint = "https://api.eliza.yandex.net/raw/anthropic/v1", + model = "claude-opus-4-5-20251101", + -- use_ReAct_prompt = true, }, }, }, @@ -131,4 +146,4 @@ vim.cmd([[ require("plugins/telescope") require("plugins/completions") require("plugins/gitsigns") -require("plugins/codecompanion") +-- require("plugins/codecompanion")