From 0619bb74672b174792b45abd6fa7ba351c0a859d Mon Sep 17 00:00:00 2001 From: Kai Chevannes Date: Sun, 17 Nov 2024 10:20:11 +0000 Subject: [PATCH] feat: add docgen, QOL in neotree, lspzero, treesitter --- lazy-lock.json | 9 ++--- lua/plugins/doge.lua | 3 ++ lua/plugins/lspzero.lua | 2 +- lua/plugins/neo-tree.lua | 72 ++++++++++++++++++++------------------ lua/plugins/treesitter.lua | 54 ++++++++++++++-------------- 5 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 lua/plugins/doge.lua diff --git a/lazy-lock.json b/lazy-lock.json index b964cff..75b9887 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -10,19 +10,20 @@ "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "cab00668464d2914d0752b86168b4a431cc93eb2" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim": { "branch": "main", "commit": "637d99e638bc6f1efedac582f6ccab08badac0c6" }, - "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, - "nvim-lspconfig": { "branch": "master", "commit": "d2d153a179ed59aa7134d7ebdf4d7dcb156efa22" }, - "nvim-treesitter": { "branch": "master", "commit": "e1e3108cd23d7f967842261bd66126b6734d8907" }, + "nvim-lspconfig": { "branch": "master", "commit": "87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0" }, + "nvim-treesitter": { "branch": "master", "commit": "1c0cbdef44a2cc35c6436e0866a2a5282b339ffd" }, "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, + "vim-doge": { "branch": "master", "commit": "188351964c8b2540a69c1d2648b3c6e7877a016f" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" } diff --git a/lua/plugins/doge.lua b/lua/plugins/doge.lua new file mode 100644 index 0000000..7a036ab --- /dev/null +++ b/lua/plugins/doge.lua @@ -0,0 +1,3 @@ +return { + "kkoomen/vim-doge", +} diff --git a/lua/plugins/lspzero.lua b/lua/plugins/lspzero.lua index bb131bc..c9f874b 100644 --- a/lua/plugins/lspzero.lua +++ b/lua/plugins/lspzero.lua @@ -90,7 +90,7 @@ return { vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts) vim.keymap.set('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) vim.keymap.set('n', '', 'lua vim.lsp.buf.rename()', opts) - vim.keymap.set({ 'n', 'x' }, '', 'lua vim.lsp.buf.format({async = true})', opts) + vim.keymap.set({ 'n', 'x', 'i' }, '', 'lua vim.lsp.buf.format({async = true})', opts) vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) end, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 73e3016..7fb7a77 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -1,36 +1,40 @@ return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - }, - config = function() - require("neo-tree").setup({ - window = { - width = 28, - mappings = { - ['e'] = function() vim.api.nvim_exec('Neotree focus filesystem left', true) end, - ['b'] = function() vim.api.nvim_exec('Neotree focus buffers left', true) end, - ['g'] = function() vim.api.nvim_exec('Neotree focus git_status left', true) end, - } - }, - filesystem = { - filtered_items = { - visible = false, - show_hidden_count = true, - hide_dotfiles = true, - hide_gitignored = false, - hide_by_name = { - -- '.git', - -- "node_modules" - }, - never_show = {}, - }, - } - }) - vim.keymap.set("n", "jv", "Neotree toggle") - end + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + config = function() + require("neo-tree").setup({ + window = { + width = 28, + auto_expand_width = true; + mappings = { + ['e'] = function() vim.api.nvim_exec('Neotree focus filesystem left', true) end, + ['b'] = function() vim.api.nvim_exec('Neotree focus buffers left', true) end, + ['g'] = function() vim.api.nvim_exec('Neotree focus git_status left', true) end, + } + }, + filesystem = { + filtered_items = { + visible = false, + show_hidden_count = true, + hide_dotfiles = true, + hide_gitignored = false, + hide_by_name = { + -- '.git', + -- "node_modules" + }, + never_show = {}, + follow_current_file = { + enabled = true, + } + }, + } + }) + vim.keymap.set("n", "jv", "Neotree toggle") + end } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index a52a7dc..eae6e4d 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,34 +1,34 @@ return { - -- Install nvim-treesitter - { - "nvim-treesitter/nvim-treesitter", -- The plugin - run = ":TSUpdate", -- Runs :TSUpdate after installation to install parsers - config = function() - require 'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the listed parsers MUST always be installed) - ensure_installed = { "javascript", "typescript", "python", "css", "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" }, + -- Install nvim-treesitter + { + "nvim-treesitter/nvim-treesitter", -- The plugin + run = ":TSUpdate", -- Runs :TSUpdate after installation to install parsers + config = function() + require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the listed parsers MUST always be installed) + ensure_installed = { "javascript", "typescript", "python", "css", "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - indent = { - enable = true - }, + indent = { + enable = true + }, - highlight = { - enable = true, + highlight = { + enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - } - end - } + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + } + end + } }