From ad175cdb4045fbe8fecb686c871b481e312d43dd Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sun, 22 Feb 2026 13:02:08 +0300 Subject: nvim configs --- config/nvim/lua/plugins/dap.lua | 6 +++- config/nvim/lua/plugins/folding.lua | 8 +++++ config/nvim/lua/plugins/lsp_saga.lua | 32 ----------------- config/nvim/lua/plugins/lspconfig.lua | 58 ++++++++++++++++++++++++++++++ config/nvim/lua/plugins/lspsaga.lua | 32 +++++++++++++++++ config/nvim/lua/plugins/lualine.lua | 7 ++-- config/nvim/lua/plugins/nvim-lspconfig.lua | 58 ------------------------------ config/nvim/lua/plugins/tree.lua | 53 +++++++++++++++++++++------ config/nvim/lua/plugins/treesitter.lua | 4 +-- config/nvim/lua/plugins/wrapping.lua | 6 ++++ 10 files changed, 156 insertions(+), 108 deletions(-) create mode 100644 config/nvim/lua/plugins/folding.lua delete mode 100644 config/nvim/lua/plugins/lsp_saga.lua create mode 100644 config/nvim/lua/plugins/lspconfig.lua create mode 100644 config/nvim/lua/plugins/lspsaga.lua delete mode 100644 config/nvim/lua/plugins/nvim-lspconfig.lua create mode 100644 config/nvim/lua/plugins/wrapping.lua (limited to 'config/nvim/lua/plugins') diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua index 9046fe9..7340da6 100644 --- a/config/nvim/lua/plugins/dap.lua +++ b/config/nvim/lua/plugins/dap.lua @@ -15,9 +15,13 @@ return { dap.configurations.go = { { type = "go", - name = "Debug", + name = "Debug cur file", request = "launch", program = "${file}", + cwd = "${workspaceFolder}", + envFile = "${workspaceFolder}/.env", + buildFlags = "", + outputMode = "remote", }, { type = "go", diff --git a/config/nvim/lua/plugins/folding.lua b/config/nvim/lua/plugins/folding.lua new file mode 100644 index 0000000..9b30204 --- /dev/null +++ b/config/nvim/lua/plugins/folding.lua @@ -0,0 +1,8 @@ +return { + "nicolas-martin/region-folding.nvim", + event = { "BufReadPost", "BufNewFile" }, + opts = { + region_text = { start = "{{{", ending = "}}}" }, + fold_indicator = "▼", + }, +} diff --git a/config/nvim/lua/plugins/lsp_saga.lua b/config/nvim/lua/plugins/lsp_saga.lua deleted file mode 100644 index 546c073..0000000 --- a/config/nvim/lua/plugins/lsp_saga.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - "nvimdev/lspsaga.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter", -- optional - "nvim-tree/nvim-web-devicons", -- optional - }, - opts = { - lightbulb = { - enable = false, - }, - diagnostic = { - show_layout = "float", - auto_preview = true, - keys = { - exec_action = "o", - quit = "q", - }, - }, - }, - keys = { - { - "e", - "Lspsaga show_buf_diagnostics", - desc = "Show buffer diagnostic", - }, - { - "we", - "Lspsaga show_workspace_diagnostics", - desc = "Show workspace diagnostic", - }, - }, -} diff --git a/config/nvim/lua/plugins/lspconfig.lua b/config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..59085f9 --- /dev/null +++ b/config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,58 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { "saghen/blink.cmp" }, + keys = { + { + "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", + }, + { + "", + "Lspsaga code_action", + desc = "Code actions", + }, + { + "", + vim.lsp.buf.rename, + desc = "Rename symbol", + }, + { + "wa", + vim.lsp.buf.add_workspace_folder, + desc = "Add workspace folder", + }, + { + "wr", + vim.lsp.buf.remove_workspace_folder, + desc = "Remove workspace folder", + }, + { + "wl", + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + desc = "List workspace folders", + }, + }, +} \ No newline at end of file diff --git a/config/nvim/lua/plugins/lspsaga.lua b/config/nvim/lua/plugins/lspsaga.lua new file mode 100644 index 0000000..546c073 --- /dev/null +++ b/config/nvim/lua/plugins/lspsaga.lua @@ -0,0 +1,32 @@ +return { + "nvimdev/lspsaga.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", -- optional + "nvim-tree/nvim-web-devicons", -- optional + }, + opts = { + lightbulb = { + enable = false, + }, + diagnostic = { + show_layout = "float", + auto_preview = true, + keys = { + exec_action = "o", + quit = "q", + }, + }, + }, + keys = { + { + "e", + "Lspsaga show_buf_diagnostics", + desc = "Show buffer diagnostic", + }, + { + "we", + "Lspsaga show_workspace_diagnostics", + desc = "Show workspace diagnostic", + }, + }, +} diff --git a/config/nvim/lua/plugins/lualine.lua b/config/nvim/lua/plugins/lualine.lua index 920e729..bb1842a 100644 --- a/config/nvim/lua/plugins/lualine.lua +++ b/config/nvim/lua/plugins/lualine.lua @@ -4,9 +4,10 @@ return { opts = { options = { icons_enabled = true, - theme = "nightfly", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, + theme = "auto", + -- theme = "nightfly", + -- component_separators = { left = "", right = "" }, + -- section_separators = { left = "", right = "" }, disabled_filetypes = { statusline = {}, winbar = {}, diff --git a/config/nvim/lua/plugins/nvim-lspconfig.lua b/config/nvim/lua/plugins/nvim-lspconfig.lua deleted file mode 100644 index 59085f9..0000000 --- a/config/nvim/lua/plugins/nvim-lspconfig.lua +++ /dev/null @@ -1,58 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { "saghen/blink.cmp" }, - keys = { - { - "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", - }, - { - "", - "Lspsaga code_action", - desc = "Code actions", - }, - { - "", - vim.lsp.buf.rename, - desc = "Rename symbol", - }, - { - "wa", - vim.lsp.buf.add_workspace_folder, - desc = "Add workspace folder", - }, - { - "wr", - vim.lsp.buf.remove_workspace_folder, - desc = "Remove workspace folder", - }, - { - "wl", - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, - desc = "List workspace folders", - }, - }, -} \ No newline at end of file diff --git a/config/nvim/lua/plugins/tree.lua b/config/nvim/lua/plugins/tree.lua index e002f49..18f217b 100644 --- a/config/nvim/lua/plugins/tree.lua +++ b/config/nvim/lua/plugins/tree.lua @@ -1,23 +1,16 @@ -local WIDTH_RATIO = 0.25 - +local HEIGHT_RATIO = 0.8 +local WIDTH_RATIO = 0.5 return { "nvim-tree/nvim-tree.lua", dependencies = { "nvim-tree/nvim-web-devicons", }, opts = { - disable_netrw = true, + disable_netrw = false, hijack_netrw = true, sort = { sorter = "case_sensitive", }, - view = { - width = function() - return math.floor(vim.opt.columns:get() * WIDTH_RATIO) - end, - adaptive_size = true, - centralize_selection = true, - }, git = { enable = true, ignore = false, @@ -37,6 +30,44 @@ return { update_focused_file = { enable = true, }, + on_attach = function(bufnr) + local api = require("nvim-tree.api") + api.config.mappings.default_on_attach(bufnr) + vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = vim.o.background == "dark" and "#1c1c1f" or "#e7e7e7" }) + end, + view = { + float = { + enable = true, + open_win_config = function() + local screen_w = vim.opt.columns:get() + local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + local window_w = screen_w * WIDTH_RATIO + local window_h = screen_h * HEIGHT_RATIO + local window_w_int = math.floor(window_w) + local window_h_int = math.floor(window_h) + local center_x = (screen_w - window_w) / 2 + local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + local border_bg = vim.o.background == "dark" and "#1c1c1f" or "#e7e7e7" + local border_fg = vim.o.background == "dark" and "#333333" or "#999999" + -- Force highlight for border and nvim-tree background + vim.api.nvim_set_hl(0, "FloatBorder", { fg = border_fg, bg = border_bg }) + vim.api.nvim_set_hl(0, "NvimTreeFloatBorder", { fg = border_fg, bg = border_bg }) + vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = border_bg }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = border_bg }) + return { + border = "rounded", + relative = "editor", + row = center_y, + col = center_x, + width = window_w_int, + height = window_h_int, + } + end, + }, + width = function() + return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + end, + }, }, keys = { { @@ -54,4 +85,4 @@ return { desc = "Toggle file tree", }, }, -} \ No newline at end of file +} diff --git a/config/nvim/lua/plugins/treesitter.lua b/config/nvim/lua/plugins/treesitter.lua index 59e9294..a5ec534 100644 --- a/config/nvim/lua/plugins/treesitter.lua +++ b/config/nvim/lua/plugins/treesitter.lua @@ -35,9 +35,7 @@ return { }, }, }, - build = function() - require("nvim-treesitter.install").update({ with_sync = true })() - end, + build = ":TSUpdate", dependencies = { { "nvim-treesitter/nvim-treesitter-textobjects" }, { diff --git a/config/nvim/lua/plugins/wrapping.lua b/config/nvim/lua/plugins/wrapping.lua new file mode 100644 index 0000000..63a9e24 --- /dev/null +++ b/config/nvim/lua/plugins/wrapping.lua @@ -0,0 +1,6 @@ +return { + "andrewferrier/wrapping.nvim", + config = function() + require("wrapping").setup() + end, +} -- cgit v1.2.3