From d7d344af1b3f69a65259a21f211cd26a8da2f42e Mon Sep 17 00:00:00 2001 From: Dmitri Date: Sun, 19 Apr 2026 15:35:21 +0200 Subject: [PATCH] dap and removed java --- nvim/lua/kanopo/autocmds.lua | 46 +++++----------- nvim/lua/kanopo/keymaps.lua | 37 ------------- nvim/lua/kanopo/options.lua | 32 ++++++----- nvim/lua/kanopo/plugins/autopairs.lua | 14 ++--- nvim/lua/kanopo/plugins/cmp.lua | 9 ++-- nvim/lua/kanopo/plugins/comments.lua | 20 +++---- nvim/lua/kanopo/plugins/dap.lua | 56 +++++++++++++++++++ nvim/lua/kanopo/plugins/dressing.lua | 10 ++-- nvim/lua/kanopo/plugins/format.lua | 77 +++++++++++++-------------- nvim/lua/kanopo/plugins/git.lua | 24 ++++----- nvim/lua/kanopo/plugins/gitsigns.lua | 7 ++- nvim/lua/kanopo/plugins/java.lua | 29 ---------- nvim/lua/kanopo/plugins/lazy-dev.lua | 23 ++++---- nvim/lua/kanopo/plugins/lsp.lua | 60 +++++---------------- nvim/lua/kanopo/plugins/oil.lua | 8 +-- nvim/lua/kanopo/plugins/theme.lua | 13 +++-- nvim/lua/kanopo/plugins/whick-key.lua | 69 +++++++----------------- 17 files changed, 214 insertions(+), 320 deletions(-) create mode 100644 nvim/lua/kanopo/plugins/dap.lua delete mode 100644 nvim/lua/kanopo/plugins/java.lua diff --git a/nvim/lua/kanopo/autocmds.lua b/nvim/lua/kanopo/autocmds.lua index be321e9..9405cc7 100644 --- a/nvim/lua/kanopo/autocmds.lua +++ b/nvim/lua/kanopo/autocmds.lua @@ -1,40 +1,22 @@ -- Highlight yanked text local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = "*", + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = "*", }) -- Go to last cursor position when opening a file vim.api.nvim_create_autocmd("BufReadPost", { - callback = function() - local ft = vim.bo.filetype - if ft ~= "commit" and ft ~= "rebase" then - local last_pos = vim.fn.line("'\"") - if last_pos > 1 and last_pos <= vim.fn.line("$") then - vim.cmd('normal! g`"') - end - end - end, -}) - -vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('my.lsp', {}), - callback = function(args) - local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) - -- Usually not needed if server supports "textDocument/willSaveWaitUntil". - if not client:supports_method('textDocument/willSaveWaitUntil') - and client:supports_method('textDocument/formatting') then - vim.api.nvim_create_autocmd('BufWritePre', { - group = vim.api.nvim_create_augroup('my.lsp', { clear = false }), - buffer = args.buf, - callback = function() - vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 }) - end, - }) - end - end, + callback = function() + local ft = vim.bo.filetype + if ft ~= "commit" and ft ~= "rebase" then + local last_pos = vim.fn.line("'\"") + if last_pos > 1 and last_pos <= vim.fn.line("$") then + vim.cmd('normal! g`"') + end + end + end, }) diff --git a/nvim/lua/kanopo/keymaps.lua b/nvim/lua/kanopo/keymaps.lua index cb64c0b..07c936a 100644 --- a/nvim/lua/kanopo/keymaps.lua +++ b/nvim/lua/kanopo/keymaps.lua @@ -4,40 +4,3 @@ vim.keymap.set("n", "", "nohlsearch") -- Diagnostic keymaps vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) - --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) - --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) - --- DAP keymaps -vim.keymap.set("n", "db", "lua require'dap'.toggle_breakpoint()", { desc = "Toggle [B]reakpoint" }) -vim.keymap.set("n", "dc", "lua require'dap'.continue()", { desc = "[C]ontinue" }) -vim.keymap.set("n", "di", "lua require'dap'.step_into()", { desc = "Step [I]nto" }) -vim.keymap.set("n", "do", "lua require'dap'.step_over()", { desc = "Step [O]ver" }) -vim.keymap.set("n", "dO", "lua require'dap'.step_out()", { desc = "Step [O]ut" }) -vim.keymap.set("n", "dr", "lua require'dap'.repl.open()", { desc = "Open [R]EPL" }) diff --git a/nvim/lua/kanopo/options.lua b/nvim/lua/kanopo/options.lua index fc91cb7..21210ef 100644 --- a/nvim/lua/kanopo/options.lua +++ b/nvim/lua/kanopo/options.lua @@ -3,33 +3,31 @@ vim.g.mapleader = " " vim.g.maplocalleader = " " -- UI and appearance -vim.o.termguicolors = true -- 24-bit colors in TUI -vim.o.cursorline = true -- highlight current line -vim.o.number = true -- absolute line numbers +vim.o.termguicolors = true -- 24-bit colors in TUI +vim.o.cursorline = true -- highlight current line +vim.o.number = true -- absolute line numbers vim.o.relativenumber = true -- relative line numbers -vim.o.signcolumn = "yes" -- always show signcolumn -vim.o.colorcolumn = "100" -- visual column guide +vim.o.signcolumn = "yes" -- always show signcolumn +vim.o.colorcolumn = "100" -- visual column guide vim.o.winborder = "rounded" -- default floating window border -vim.o.cmdheight = 0 -- minimal command-line height (NVIM 0.10+) -vim.o.conceallevel = 2 -- conceal in Markdown/jsonc when appropriate -vim.o.foldlevel = 0 -- start with folds closed (Treesitter can open) +vim.o.cmdheight = 0 -- minimal command-line height (NVIM 0.10+) +vim.o.conceallevel = 2 -- conceal in Markdown/jsonc when appropriate +vim.o.foldlevel = 0 -- start with folds closed (Treesitter can open) -- Splits vim.o.splitright = true -- open vertical splits to the right vim.o.splitbelow = true -- open horizontal splits below -- Editing behavior -vim.o.wrap = false -- do not wrap lines by default +vim.o.wrap = false -- do not wrap lines by default vim.o.breakindent = true -- keep indentation on wrapped lines (if wrap is enabled later) -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = "unnamedplus" -end) -vim.o.swapfile = false -- no swapfiles -vim.o.undofile = true -- persistent undo +vim.o.clipboard = "unnamedplus" +vim.o.swapfile = false -- no swapfiles +vim.o.undofile = true -- persistent undo vim.o.writebackup = false -- do not keep backup around -- Tabs and indentation (2-space default; override per-filetype with autocmds) @@ -40,16 +38,16 @@ vim.o.shiftwidth = 2 -- Search vim.o.ignorecase = true -- case-insensitive -vim.o.smartcase = true -- unless uppercase is used +vim.o.smartcase = true -- unless uppercase is used -- Completion UX (good defaults for omni and popup behavior) vim.o.completeopt = "menu,menuone,noinsert,noselect" vim.o.shortmess = (vim.o.shortmess or "") .. "c" -- reduce completion messages -- Performance and input timing -vim.o.timeoutlen = 300 -- mapped sequence timeout +vim.o.timeoutlen = 800 -- mapped sequence timeout vim.o.updatetime = 250 -- faster CursorHold/diagnostic updates -vim.o.scrolloff = 10 -- context lines around cursor +vim.o.scrolloff = 10 -- context lines around cursor -- Fonts/icons (used by statuslines/UIs) vim.g.have_nerd_font = true diff --git a/nvim/lua/kanopo/plugins/autopairs.lua b/nvim/lua/kanopo/plugins/autopairs.lua index fbdf5ef..8fbe3d8 100644 --- a/nvim/lua/kanopo/plugins/autopairs.lua +++ b/nvim/lua/kanopo/plugins/autopairs.lua @@ -1,9 +1,9 @@ return { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - require("nvim-autopairs").setup({ - disable_filetype = { "TelescopePrompt", "vim" }, - }) - end, + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup({ + disable_filetype = { "TelescopePrompt", "vim" }, + }) + end, } diff --git a/nvim/lua/kanopo/plugins/cmp.lua b/nvim/lua/kanopo/plugins/cmp.lua index 87bbbcb..c802bd3 100644 --- a/nvim/lua/kanopo/plugins/cmp.lua +++ b/nvim/lua/kanopo/plugins/cmp.lua @@ -29,6 +29,7 @@ return { -- Autocompletion }, --- @module 'blink.cmp' --- @type blink.cmp.Config + opts = { keymap = { -- set to 'none' to disable the 'default' preset @@ -38,10 +39,10 @@ return { -- Autocompletion [""] = { "select_next", "fallback" }, [""] = { "scroll_documentation_up", "fallback" }, [""] = { "scroll_documentation_down", "fallback" }, - [""] = { "snippet_forward", "fallback" }, - [""] = { "snippet_backward", "fallback" }, - -- [""] = { "select_prev", "fallback" }, - -- [""] = { "select_next", "fallback" }, + -- [""] = { "snippet_forward", "fallback" }, + -- [""] = { "snippet_backward", "fallback" }, + [""] = { "select_prev", "fallback" }, + [""] = { "select_next", "fallback" }, [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "select_and_accept", "fallback" }, diff --git a/nvim/lua/kanopo/plugins/comments.lua b/nvim/lua/kanopo/plugins/comments.lua index 20243a9..836bfa4 100644 --- a/nvim/lua/kanopo/plugins/comments.lua +++ b/nvim/lua/kanopo/plugins/comments.lua @@ -1,12 +1,12 @@ return { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - signs = true, - keywords = { - TODO = { icon = "🤨", color = "info" }, - WIP = { icon = "🥵", color = "warning" }, - ERR = { icon = "🤬", color = "error" }, - }, - } + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + signs = true, + keywords = { + TODO = { icon = "🤨", color = "info" }, + WIP = { icon = "🥵", color = "warning" }, + ERROR = { icon = "🤬", color = "error" }, + }, + }, } diff --git a/nvim/lua/kanopo/plugins/dap.lua b/nvim/lua/kanopo/plugins/dap.lua new file mode 100644 index 0000000..a2ec5fe --- /dev/null +++ b/nvim/lua/kanopo/plugins/dap.lua @@ -0,0 +1,56 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + "williamboman/mason.nvim", + "jay-babu/mason-nvim-dap.nvim", + "rcarriga/nvim-dap-ui", + "theHamsta/nvim-dap-virtual-text", + "nvim-neotest/nvim-nio", + }, + config = function() + local dap = require("dap") + local dapui = require("dapui") + + dapui.setup() + require("nvim-dap-virtual-text").setup({}) + + local map = function(keys, func, desc) + vim.keymap.set("n", keys, func, { desc = "DAP: " .. desc }) + end + + map("db", dap.toggle_breakpoint, "Toggle [B]reakpoint") + map("dc", dap.continue, "[C]ontinue") + map("di", dap.step_into, "Step [I]nto") + map("do", dap.step_over, "Step [O]ver") + map("dO", dap.step_out, "Step [O]ut") + map("dr", dap.repl.open, "Open [R]EPL") + map("dt", dap.terminate, "[T]erminate") + map("du", dapui.toggle, "Toggle [U]I") + + local debuggers = { + delve = {}, + } + + local ensure_installed = vim.tbl_keys(debuggers) + + require("mason-nvim-dap").setup({ + ensure_installed = ensure_installed, + automatic_installation = true, + handlers = { + function(config) + require("mason-nvim-dap").default_setup(config) + end, + }, + }) + + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + end, +} diff --git a/nvim/lua/kanopo/plugins/dressing.lua b/nvim/lua/kanopo/plugins/dressing.lua index 6ce1646..f7280c3 100644 --- a/nvim/lua/kanopo/plugins/dressing.lua +++ b/nvim/lua/kanopo/plugins/dressing.lua @@ -1,8 +1,8 @@ return { - "stevearc/dressing.nvim", - opts = { - inputs = { - enable = true, - } + "stevearc/dressing.nvim", + opts = { + inputs = { + enable = true, }, + }, } diff --git a/nvim/lua/kanopo/plugins/format.lua b/nvim/lua/kanopo/plugins/format.lua index dd3782b..f708d3e 100644 --- a/nvim/lua/kanopo/plugins/format.lua +++ b/nvim/lua/kanopo/plugins/format.lua @@ -1,41 +1,40 @@ - - return { -- Autoformat - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format({ async = true, lsp_format = "fallback" }) - end, - mode = "", - desc = "[F]ormat buffer", - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - else - return { - timeout_ms = 500, - lsp_format = "fallback", - } - end +return { -- Autoformat + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + "f", + function() + require("conform").format({ async = true, lsp_format = "fallback" }) end, - formatters_by_ft = { - lua = { "stylua" }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, + mode = "", + desc = "[F]ormat buffer", }, - } + }, + opts = { + notify_on_error = false, + format_on_save = function(bufnr) + -- Disable "format_on_save lsp_fallback" for languages that don't + -- have a well standardized coding style. You can add additional + -- languages here or re-enable it for the disabled ones. + local disable_filetypes = { c = true, cpp = true } + if disable_filetypes[vim.bo[bufnr].filetype] then + return nil + else + return { + timeout_ms = 500, + lsp_format = "fallback", + } + end + end, + formatters_by_ft = { + lua = { "stylua" }, + -- Conform can also run multiple formatters sequentially + -- python = { "isort", "black" }, + -- + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, + }, +} diff --git a/nvim/lua/kanopo/plugins/git.lua b/nvim/lua/kanopo/plugins/git.lua index 24a6eab..f311093 100644 --- a/nvim/lua/kanopo/plugins/git.lua +++ b/nvim/lua/kanopo/plugins/git.lua @@ -1,16 +1,12 @@ return { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - -- config = function() - -- require("neogit").setup() - -- vim.keymap.set("n", "gg", "Neogit", { desc = "Neogit" }) - -- end, - opts = true, - keys = { - { "gg", "Neogit", desc = "Neogit" }, - }, + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + opts = true, + keys = { + { "gg", "Neogit", desc = "Neogit" }, + }, } diff --git a/nvim/lua/kanopo/plugins/gitsigns.lua b/nvim/lua/kanopo/plugins/gitsigns.lua index f6c7690..2ae7c76 100644 --- a/nvim/lua/kanopo/plugins/gitsigns.lua +++ b/nvim/lua/kanopo/plugins/gitsigns.lua @@ -1,6 +1,5 @@ return { - "lewis6991/gitsigns.nvim", - event = "BufRead", - opts = {}, + "lewis6991/gitsigns.nvim", + event = "BufRead", + opts = {}, } - diff --git a/nvim/lua/kanopo/plugins/java.lua b/nvim/lua/kanopo/plugins/java.lua deleted file mode 100644 index c16cc35..0000000 --- a/nvim/lua/kanopo/plugins/java.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "mfussenegger/nvim-jdtls", - ft = "java", - config = function() - local lombok_dir = vim.fn.stdpath("data") .. "/lombok" - local lombok_path = lombok_dir .. "/lombok.jar" - - if not vim.loop.fs_stat(lombok_path) then - vim.fn.mkdir(lombok_dir, "p") - print("Downloading lombok.jar...") - local lombok_url = "https://projectlombok.org/downloads/lombok.jar" - vim.fn.system({ "curl", "-L", "-o", lombok_path, lombok_url }) - print("lombok.jar downloaded to " .. lombok_path) - end - - local capabilities = require("blink.cmp").get_lsp_capabilities() - - local config = { - cmd = { - "jdtls", - "--jvm-arg=-javaagent:" .. lombok_path, - }, - root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew" }) or vim.fn.getcwd(), - capabilities = capabilities, - } - - require("jdtls").start_or_attach(config) - end, -} \ No newline at end of file diff --git a/nvim/lua/kanopo/plugins/lazy-dev.lua b/nvim/lua/kanopo/plugins/lazy-dev.lua index 84c49fd..c6de20c 100644 --- a/nvim/lua/kanopo/plugins/lazy-dev.lua +++ b/nvim/lua/kanopo/plugins/lazy-dev.lua @@ -1,13 +1,12 @@ - - return { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - "folke/lazydev.nvim", - ft = "lua", - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, +return { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, }, - } + }, +} diff --git a/nvim/lua/kanopo/plugins/lsp.lua b/nvim/lua/kanopo/plugins/lsp.lua index 823c3e4..69b0ee8 100644 --- a/nvim/lua/kanopo/plugins/lsp.lua +++ b/nvim/lua/kanopo/plugins/lsp.lua @@ -5,7 +5,7 @@ return { "mason-org/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", - { "j-hui/fidget.nvim", opts = {} }, + { "j-hui/fidget.nvim", opts = {} }, "saghen/blink.cmp", }, @@ -13,6 +13,8 @@ return { vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), callback = function(event) + local client = vim.lsp.get_client_by_id(event.data.client_id) + local map = function(keys, func, desc, mode) mode = mode or "n" vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) @@ -61,7 +63,7 @@ return { -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then map("th", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) end, "[T]oggle Inlay [H]ints") @@ -98,28 +100,11 @@ return { }, }) - -- LSP servers and clients are able to communicate to each other what features they support. - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. local capabilities = require("blink.cmp").get_lsp_capabilities() - -- Enable the following language servers - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. - -- - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - texlab = {}, - rust_analyzer = {}, cssls = {}, - astro = {}, tailwindcss = {}, - pylsp = {}, ts_ls = {}, gopls = {}, postgres_lsp = {}, @@ -129,45 +114,24 @@ return { completion = { callSnippet = "Replace", }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, }, }, }, } - -- Ensure the servers and tools above are installed - -- - -- To check the current status of installed tools and/or manually install - -- other tools, you can run - -- :Mason - -- - -- You can press `g?` for help in this menu. - -- - -- `mason` had to be setup earlier: to configure its options see the - -- `dependencies` table for `nvim-lspconfig` above. - -- - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { "stylua", -- Used to format Lua code }) require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) - require("mason-lspconfig").setup({ - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = true, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) - require("lspconfig")[server_name].setup(server) - end, - }, - }) + for server_name, server in pairs(servers) do + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for ts_ls) + server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) + vim.lsp.config(server_name, server) + vim.lsp.enable(server_name) + end end, } diff --git a/nvim/lua/kanopo/plugins/oil.lua b/nvim/lua/kanopo/plugins/oil.lua index 6517aeb..eefafea 100644 --- a/nvim/lua/kanopo/plugins/oil.lua +++ b/nvim/lua/kanopo/plugins/oil.lua @@ -1,9 +1,9 @@ return { - 'stevearc/oil.nvim', + "stevearc/oil.nvim", opts = {}, - dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons + dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() require("oil").setup() - vim.keymap.set('n', 'fe', ":Oil") - end + vim.keymap.set("n", "fe", ":Oil") + end, } diff --git a/nvim/lua/kanopo/plugins/theme.lua b/nvim/lua/kanopo/plugins/theme.lua index f8c6599..35c8c29 100644 --- a/nvim/lua/kanopo/plugins/theme.lua +++ b/nvim/lua/kanopo/plugins/theme.lua @@ -1,9 +1,8 @@ return { - "ellisonleao/gruvbox.nvim", - priority = 1000 , - config = function() - vim.o.background = "dark" -- or "light" for light mode - vim.cmd([[colorscheme gruvbox]]) - end + "ellisonleao/gruvbox.nvim", + priority = 1000, + config = function() + vim.o.background = "dark" -- or "light" for light mode + vim.cmd([[colorscheme gruvbox]]) + end, } - diff --git a/nvim/lua/kanopo/plugins/whick-key.lua b/nvim/lua/kanopo/plugins/whick-key.lua index 3016814..f46216c 100644 --- a/nvim/lua/kanopo/plugins/whick-key.lua +++ b/nvim/lua/kanopo/plugins/whick-key.lua @@ -1,52 +1,19 @@ - return { -- Useful plugin to show you pending keybinds. - "folke/which-key.nvim", - event = "VimEnter", -- Sets the loading event to 'VimEnter' - opts = { - -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.o.timeoutlen - delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = " ", - Down = " ", - Left = " ", - Right = " ", - C = " ", - M = " ", - D = " ", - S = " ", - CR = " ", - Esc = " ", - ScrollWheelDown = " ", - ScrollWheelUp = " ", - NL = " ", - BS = " ", - Space = " ", - Tab = " ", - F1 = "", - F2 = "", - F3 = "", - F4 = "", - F5 = "", - F6 = "", - F7 = "", - F8 = "", - F9 = "", - F10 = "", - F11 = "", - F12 = "", - }, - }, - - -- Document existing key chains - spec = { - { "s", group = "[S]earch" }, - { "t", group = "[T]oggle" }, - { "h", group = "Git [H]unk", mode = { "n", "v" } }, - }, +return { + "folke/which-key.nvim", + event = "VimEnter", + opts = { + delay = 0, + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, }, - } + + -- Document existing key chains + spec = { + { "s", group = "[S]earch" }, + { "t", group = "[T]oggle" }, + { "d", group = "[D]ebug" }, + { "h", group = "Git [H]unk", mode = { "n", "v" } }, + }, + }, +}