diff --git a/init.lua b/init.lua index 47fd96b3..386a8540 100644 --- a/init.lua +++ b/init.lua @@ -398,7 +398,8 @@ require('lazy').setup({ { 'c', group = '[C]Make' }, { 'd', group = '[D]iagnostics' }, { 'e', group = '[E]xplorer' }, - { 'g', group = '[G]it' }, + { 'g', group = '[G]oto' }, + { 'G', group = '[G]it' }, { 'm', group = '[M]arkdown' }, { 'n', group = '[N]eotest' }, { 'o', group = '[O]pencode' }, @@ -606,19 +607,23 @@ require('lazy').setup({ -- Find references for the word under your cursor. map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') -- Jump to the implementation of the word under your cursor. -- Useful when your language has ways of declaring types without an actual implementation. map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + map('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. @@ -632,6 +637,7 @@ require('lazy').setup({ -- Useful when you're not sure what type a variable is and you want to see -- the definition of its *type*, not where it was *defined*. map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') + map('gt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) ---@param client vim.lsp.Client @@ -1064,6 +1070,13 @@ require('lazy').setup({ -- - sr)' - [S]urround [R]eplace [)] ['] require('mini.surround').setup() + -- Delete buffers while preserving window layout. + local bufremove = require 'mini.bufremove' + bufremove.setup() + vim.keymap.set('n', 'bd', function() + bufremove.delete(0, false) + end, { desc = '[B]uffer [D]elete' }) + -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin @@ -1085,20 +1098,26 @@ require('lazy').setup({ }, { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', + branch = 'main', lazy = false, build = ':TSUpdate', -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - auto_install = true, - }, - config = function(_, opts) + config = function() local treesitter = require 'nvim-treesitter' treesitter.setup() - - if opts.auto_install and opts.ensure_installed and #opts.ensure_installed > 0 then - treesitter.install(opts.ensure_installed) - end + require('nvim-treesitter.install').ensure_installed { + 'bash', + 'c', + 'diff', + 'html', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'query', + 'vim', + 'vimdoc', + } vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('kickstart-treesitter', { clear = true }), diff --git a/lua/custom/plugins/diffview.lua b/lua/custom/plugins/diffview.lua index 4e94670c..b893a0c8 100644 --- a/lua/custom/plugins/diffview.lua +++ b/lua/custom/plugins/diffview.lua @@ -10,10 +10,10 @@ return { 'DiffviewRefresh', }, keys = { - { 'gd', 'DiffviewOpen', desc = '[G]it [D]iff view' }, - { 'gD', 'DiffviewClose', desc = '[G]it [D]iff close' }, - { 'gf', 'DiffviewFileHistory %', desc = '[G]it [F]ile history' }, - { 'gF', 'DiffviewFileHistory', desc = '[G]it [F]ull history' }, + { 'Gd', 'DiffviewOpen', desc = '[G]it [D]iff view' }, + { 'GD', 'DiffviewClose', desc = '[G]it [D]iff close' }, + { 'Gf', 'DiffviewFileHistory %', desc = '[G]it [F]ile history' }, + { 'GF', 'DiffviewFileHistory', desc = '[G]it [F]ull history' }, }, opts = {}, } diff --git a/lua/custom/plugins/neogit.lua b/lua/custom/plugins/neogit.lua index 8a4fb9d6..c91dfedc 100644 --- a/lua/custom/plugins/neogit.lua +++ b/lua/custom/plugins/neogit.lua @@ -13,6 +13,6 @@ return { }, cmd = 'Neogit', keys = { - { 'gg', 'Neogit', desc = 'Show Neogit UI' }, + { 'Gg', 'Neogit', desc = 'Show Neogit UI' }, }, }