diff --git a/Baud/.config/nvim/lua/main/keymaps.lua b/Baud/.config/nvim/lua/main/keymaps.lua index f3b14b8..e5de851 100755 --- a/Baud/.config/nvim/lua/main/keymaps.lua +++ b/Baud/.config/nvim/lua/main/keymaps.lua @@ -20,3 +20,9 @@ map("i", "", "gj", { desc = "Move down a screenline" }) -- Add empty lines map('n', 'O', "O", { desc = "Append a new line below the current line" }) map('n', 'o', "o", { desc = "Append a new line above the current line" }) + +-- Language server protocol +map("n", "cr", vim.lsp.buf.rename, { desc = "Rename" }) +map("n", "h", vim.lsp.buf.hover, { desc = "Hover" }) +map("n", "]]", vim.diagnostic.goto_next, { desc = "Next diagnostic" }) +map("n", "[[", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" }) diff --git a/Baud/.config/nvim/lua/plugins/fzf-lua.lua b/Baud/.config/nvim/lua/plugins/fzf-lua.lua index 102c63d..81eb749 100755 --- a/Baud/.config/nvim/lua/plugins/fzf-lua.lua +++ b/Baud/.config/nvim/lua/plugins/fzf-lua.lua @@ -7,18 +7,24 @@ return { local map = vim.keymap.set local fzf = require('fzf-lua') - map("n", "ff", fzf.files, { desc = "Find files" }) map("n", "gr", fzf.grep, { desc = "Grep" }) + map("n", "grc", fzf.grep_cword, { desc = "Grep word under cursor" }) + map("n", "ff", fzf.files, { desc = "Find files" }) map("n", "b", fzf.buffers, { desc = "Find buffers" }) map("n", "ss", fzf.spell_suggest, { desc = "Spell suggest" }) map("n", "ft", fzf.filetypes, { desc = "Change filetypes" }) map("n", "km", fzf.keymaps, { desc = "View keymaps" }) + map("n", "ch", fzf.command_history, { desc = "Command history" }) + map("n", "sh", fzf.search_history, { desc = "Search history" }) + map("n", "lr", fzf.lsp_references, { desc = "LSP references" }) - map("n", "li", fzf.lsp_implementations, { desc = "LSP implementations" }) map("n", "ld", fzf.lsp_definitions, { desc = "LSP definitions" }) - map("n", "ls", fzf.lsp_document_symbols, { desc = "LSP document symbols" }) - map("n", "la", fzf.lsp_code_actions, { desc = "LSP code actions" }) + map("n", "ltd", fzf.lsp_typedefs, { desc = "LSP type definitions" }) + map("n", "li", fzf.lsp_implementations, { desc = "LSP implementations" }) + map("n", "lds", fzf.lsp_document_symbols, { desc = "LSP document symbols" }) + map("n", "lws", fzf.lsp_workspace_symbols, { desc = "LSP workspace symbols" }) + map("n", "ca", fzf.lsp_code_actions, { desc = "LSP code actions" }) end, } diff --git a/Baud/.config/nvim/lua/plugins/indent-blankline.lua b/Baud/.config/nvim/lua/plugins/indent-blankline.lua index f9fbaeb..f45b052 100755 --- a/Baud/.config/nvim/lua/plugins/indent-blankline.lua +++ b/Baud/.config/nvim/lua/plugins/indent-blankline.lua @@ -3,11 +3,10 @@ return { "lukas-reineke/indent-blankline.nvim", - init = function() - require("ibl").setup({ - scope = { - enabled = false, - } - }) - end, + main = "ibl", + opts = { + scope = { + enabled = false, + } + } } diff --git a/Baud/.config/nvim/lua/plugins/lsp/nvim-cmp.lua b/Baud/.config/nvim/lua/plugins/lsp/nvim-cmp.lua index ada93fa..cd996ce 100755 --- a/Baud/.config/nvim/lua/plugins/lsp/nvim-cmp.lua +++ b/Baud/.config/nvim/lua/plugins/lsp/nvim-cmp.lua @@ -3,7 +3,13 @@ return { "hrsh7th/nvim-cmp", - init = function() + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "chrisgrieser/cmp-nerdfont", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + opts = function() local cmp = require("cmp") cmp.setup({ @@ -16,19 +22,14 @@ return { }), sources = cmp.config.sources({ { name = "nvim_lsp" }, - { name = "nerdfont" }, { name = "path" }, + { name = "nerdfont" }, + }, { { name = "buffer" }, }), formatting = { format = require("nvim-highlight-colors").format } }) - end, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "chrisgrieser/cmp-nerdfont", - "hrsh7th/cmp-path", - "hrsh7th/cmp-buffer", - }, + end } diff --git a/Baud/.config/nvim/lua/plugins/lsp/nvim-snippets.lua b/Baud/.config/nvim/lua/plugins/lsp/nvim-snippets.lua index 8e70bc3..c49516d 100755 --- a/Baud/.config/nvim/lua/plugins/lsp/nvim-snippets.lua +++ b/Baud/.config/nvim/lua/plugins/lsp/nvim-snippets.lua @@ -7,39 +7,16 @@ return { { "", function() - if vim.snippet.active({ direction = 1 }) then - vim.schedule(function() - vim.snippet.jump(1) - end) - return - end - return "" + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" end, expr = true, silent = true, - mode = "i", - }, - { - "", - function() - vim.schedule(function() - vim.snippet.jump(1) - end) - end, - expr = true, - silent = true, - mode = "s", + mode = { "i", "s" }, }, { "", function() - if vim.snippet.active({ direction = -1 }) then - vim.schedule(function() - vim.snippet.jump(-1) - end) - return - end - return "" + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" end, expr = true, silent = true, diff --git a/Baud/.config/nvim/lua/plugins/markdown.lua b/Baud/.config/nvim/lua/plugins/markdown.lua index 4bdf527..e492657 100644 --- a/Baud/.config/nvim/lua/plugins/markdown.lua +++ b/Baud/.config/nvim/lua/plugins/markdown.lua @@ -4,7 +4,5 @@ return { "MeanderingProgrammer/markdown.nvim", ft = "markdown", - config = function() - require('render-markdown').setup() - end, + opts = {} } diff --git a/Baud/.config/nvim/lua/plugins/mini-diff.lua b/Baud/.config/nvim/lua/plugins/mini-diff.lua index 2c1b2bf..7c72699 100755 --- a/Baud/.config/nvim/lua/plugins/mini-diff.lua +++ b/Baud/.config/nvim/lua/plugins/mini-diff.lua @@ -1,13 +1,11 @@ -- Git diff signs --- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md +-- https://github.com/echasnovski/mini.diff return { "echasnovski/mini.diff", - init = function() - require("mini.diff").setup({ - view = { - style = "sign", - }, - }) - end, + opts = { + view = { + style = "sign", + }, + } } diff --git a/Baud/.config/nvim/lua/plugins/mini-icons.lua b/Baud/.config/nvim/lua/plugins/mini-icons.lua index 1024433..7fbcba6 100755 --- a/Baud/.config/nvim/lua/plugins/mini-icons.lua +++ b/Baud/.config/nvim/lua/plugins/mini-icons.lua @@ -1,9 +1,8 @@ -- Add icons to many plugins --- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-icons.md +-- https://github.com/echasnovski/mini.icons return { "echasnovski/mini.icons", - init = function() - require('mini.icons').setup() - end, + lazy = true, + opts = {} } diff --git a/Baud/.config/nvim/lua/plugins/mini-move.lua b/Baud/.config/nvim/lua/plugins/mini-move.lua index 8307cc6..56a3443 100755 --- a/Baud/.config/nvim/lua/plugins/mini-move.lua +++ b/Baud/.config/nvim/lua/plugins/mini-move.lua @@ -1,5 +1,5 @@ -- Move text or code --- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md +-- https://github.com/echasnovski/mini.move return { "echasnovski/mini.move", @@ -9,21 +9,19 @@ return { '', '', }, - config = function() - require('mini.move').setup({ - mappings = { - -- Move visual selection - left = '', - right = '', - down = '', - up = '', + opts = { + mappings = { + -- Move visual selection + left = '', + right = '', + down = '', + up = '', - -- Move line in normal mode - line_left = '', - line_right = '', - line_down = '', - line_up = '', - }, - }) - end, + -- Move line in normal mode + line_left = '', + line_right = '', + line_down = '', + line_up = '', + }, + } } diff --git a/Baud/.config/nvim/lua/plugins/mini-notify.lua b/Baud/.config/nvim/lua/plugins/mini-notify.lua index c05079b..1eef94f 100755 --- a/Baud/.config/nvim/lua/plugins/mini-notify.lua +++ b/Baud/.config/nvim/lua/plugins/mini-notify.lua @@ -1,14 +1,14 @@ -- Notifications --- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-notify.md +-- https://github.com/echasnovski/mini.notify return { "echasnovski/mini.notify", - config = function() - require('mini.notify').setup({ - window = { - max_width_share = 0.5, - } - }) + opts = { + window = { + max_width_share = 0.5, + } + }, + init = function() vim.notify = require('mini.notify').make_notify() end, } diff --git a/Baud/.config/nvim/lua/plugins/mini-statusline.lua b/Baud/.config/nvim/lua/plugins/mini-statusline.lua index e4bc623..846c4ae 100755 --- a/Baud/.config/nvim/lua/plugins/mini-statusline.lua +++ b/Baud/.config/nvim/lua/plugins/mini-statusline.lua @@ -1,9 +1,7 @@ -- Statusline --- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-statusline.md +-- https://github.com/echasnovski/mini.statusline return { "echasnovski/mini.statusline", - config = function() - require("mini.statusline").setup() - end, + opts = {} } diff --git a/Baud/.config/nvim/lua/plugins/nvim-highlight-colors.lua b/Baud/.config/nvim/lua/plugins/nvim-highlight-colors.lua index 5b46369..341f366 100755 --- a/Baud/.config/nvim/lua/plugins/nvim-highlight-colors.lua +++ b/Baud/.config/nvim/lua/plugins/nvim-highlight-colors.lua @@ -4,9 +4,7 @@ return { "brenoprata10/nvim-highlight-colors", - config = function() - require('nvim-highlight-colors').setup({ - enable_tailwind = true, - }) - end, + opts = { + enable_tailwind = true, + } } diff --git a/Baud/.config/nvim/lua/plugins/todo-comments.lua b/Baud/.config/nvim/lua/plugins/todo-comments.lua index ace4330..32ef5f6 100755 --- a/Baud/.config/nvim/lua/plugins/todo-comments.lua +++ b/Baud/.config/nvim/lua/plugins/todo-comments.lua @@ -3,40 +3,38 @@ return { "folke/todo-comments.nvim", - config = function() - require("todo-comments").setup({ - keywords = { - TODO = { icon = "󰄬 ", color = "info", alt = { "TO-DO", "TASK" } }, - HACK = { icon = "󰈸 ", color = "warning", alt = { "BODGE", "TEMP", "WORKAROUND" } }, - BUG = { icon = "󰃤 ", color = "error", alt = { "GLITCH", "ISSUE", "PROBLEM", "ERROR" } }, - WARN = { icon = " ", color = "warning", alt = { "WARNING", "CAUTION", "DANGER" } }, - PERF = { - icon = " ", - color = "warning", - alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE", "OPTIMIZATION" }, - }, - DOC = { icon = "󰈙 ", color = "warning", alt = { "DOCUMENTATION", "DOCS" } }, - SEC = { icon = "󰒃 ", color = "error", alt = { "SECURITY", "SECURITYFIX", "VULNERABILITY" } }, - NOTE = { icon = "󰠮 ", color = "hint", alt = { "INFO", "COMMENT", "REMARK" } }, - REV = { icon = "󰅇 ", color = "info", alt = { "REVIEW", "REVISIT", "FEEDBACK" } }, - TEST = { - icon = "󰙨 ", - color = "info", - alt = { "TEST", "TESTNEEDED", "TESTING", "PASSED", "FAILED", "ASSERT" }, - }, - DEPRECATED = { icon = "󱚡 ", color = "warning", alt = { "OBSOLETE", "OUTDATED" } }, - ANALYZE = { icon = " ", color = "warning", alt = { "ANALYSIS", "CHECK" } }, - DESIGN = { icon = "󰏘 ", color = "warning", alt = { "ARCHITECTURE", "STRUCTURE" } }, - VERIFY = { icon = "󰗠 ", color = "warning", alt = { "VALIDATE", "VERIFY" } }, - IDEA = { icon = "󰌵 ", color = "info", alt = { "IDEA", "CONCEPT" } }, + opts = { + keywords = { + TODO = { icon = "󰄬 ", color = "info", alt = { "TO-DO", "TASK" } }, + HACK = { icon = "󰈸 ", color = "warning", alt = { "BODGE", "TEMP", "WORKAROUND" } }, + BUG = { icon = "󰃤 ", color = "error", alt = { "GLITCH", "ISSUE", "PROBLEM", "ERROR" } }, + WARN = { icon = " ", color = "warning", alt = { "WARNING", "CAUTION", "DANGER" } }, + PERF = { + icon = " ", + color = "warning", + alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE", "OPTIMIZATION" }, }, - colors = { - error = { "DiagnosticError", "#F13731" }, - warning = { "DiagnosticWarn", "#FFAD1F" }, - info = { "DiagnosticInfo", "#3578C1" }, - hint = { "DiagnosticHint", "#58A551" }, - default = { "Identifier", "#532ca5" }, + DOC = { icon = "󰈙 ", color = "warning", alt = { "DOCUMENTATION", "DOCS" } }, + SEC = { icon = "󰒃 ", color = "error", alt = { "SECURITY", "SECURITYFIX", "VULNERABILITY" } }, + NOTE = { icon = "󰠮 ", color = "hint", alt = { "INFO", "COMMENT", "REMARK" } }, + REV = { icon = "󰅇 ", color = "info", alt = { "REVIEW", "REVISIT", "FEEDBACK" } }, + TEST = { + icon = "󰙨 ", + color = "info", + alt = { "TEST", "TESTNEEDED", "TESTING", "PASSED", "FAILED", "ASSERT" }, }, - }) - end, + DEPRECATED = { icon = "󱚡 ", color = "warning", alt = { "OBSOLETE", "OUTDATED" } }, + ANALYZE = { icon = " ", color = "warning", alt = { "ANALYSIS", "CHECK" } }, + DESIGN = { icon = "󰏘 ", color = "warning", alt = { "ARCHITECTURE", "STRUCTURE" } }, + VERIFY = { icon = "󰗠 ", color = "warning", alt = { "VALIDATE", "VERIFY" } }, + IDEA = { icon = "󰌵 ", color = "info", alt = { "IDEA", "CONCEPT" } }, + }, + colors = { + error = { "DiagnosticError", "#F13731" }, + warning = { "DiagnosticWarn", "#FFAD1F" }, + info = { "DiagnosticInfo", "#3578C1" }, + hint = { "DiagnosticHint", "#58A551" }, + default = { "Identifier", "#532ca5" }, + }, + } } diff --git a/Baud/.config/nvim/lua/plugins/treesitter/nvim-treesitter.lua b/Baud/.config/nvim/lua/plugins/treesitter/nvim-treesitter.lua index ed081b1..9d368a7 100755 --- a/Baud/.config/nvim/lua/plugins/treesitter/nvim-treesitter.lua +++ b/Baud/.config/nvim/lua/plugins/treesitter/nvim-treesitter.lua @@ -3,34 +3,37 @@ return { "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + cmd = { "TSUpdate", "TSUpdateSync", "TSInstall" }, + lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline + opts = { + highlight = { enable = true, }, + indent = { enable = true }, + auto_install = true, + ensure_installed = { + "bash", + "css", + "html", + "javascript", + "json", + "lua", + "markdown", + "php", + "python", + "rust", + "toml", + "sql", + "toml", + "typescript", + "yaml", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + }, + }, config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { - "bash", - "css", - "html", - "javascript", - "json", - "lua", - "markdown", - "php", - "python", - "rust", - "toml", - "sql", - "toml", - "typescript", - "yaml", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - }, - auto_install = true, - highlight = { enable = true, }, - indent = { enable = true }, - }) vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end,