diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index a6c3358..22071b0 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -7,18 +7,31 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons', }, - opts = { - options = { - always_show_bufferline = true, - offsets = { - { - filetype = 'neo-tree', - text = 'Neo-tree', - highlight = 'Directory', - text_align = 'left', + config = function() + require('bufferline').setup { + options = { + always_show_bufferline = true, + offsets = { + { + filetype = 'neo-tree', + text = 'Neo-tree', + highlight = 'Directory', + text_align = 'left', + }, }, }, - }, - }, + } + + vim.keymap.set('n', 'bd', 'bdelete', { desc = '[D]elete Buffer' }) + vim.keymap.set('n', 'bp', 'BufferLineTogglePin', { desc = 'Toggle [P]in' }) + vim.keymap.set('n', 'bP', 'BufferLineGroupClose ungrouped', { desc = 'Delete Un-[P]inned Buffers' }) + vim.keymap.set('n', 'bo', 'BufferLineCloseOthers', { desc = 'Delete All [O]ther Buffers' }) + vim.keymap.set('n', 'br', 'BufferLineCloseRight', { desc = 'Delete Buffers to the [R]ight' }) + vim.keymap.set('n', 'bl', 'BufferLineCloseLeft', { desc = 'Delete Buffers to the [L]eft' }) + vim.keymap.set('n', '[b', 'BufferLineCyclePrev', { desc = 'Prev Buffer' }) + vim.keymap.set('n', ']b', 'BufferLineCycleNext', { desc = 'Next Buffer' }) + vim.keymap.set('n', '[B', 'BufferLineMovePrev', { desc = 'Move buffer prev' }) + vim.keymap.set('n', ']B', 'BufferLineMoveNext', { desc = 'Move buffer next' }) + end, }, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 1d9e1fc..4dce6ac 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -77,6 +77,10 @@ return { -- To jump back, press . 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('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + -- Find references for the word under your cursor. map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') @@ -87,27 +91,23 @@ return { -- Jump to the type of the word under your cursor. -- 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('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + map('lt', require('telescope.builtin').lsp_type_definitions, '[T]ype Definition') -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + map('ld', require('telescope.builtin').lsp_document_symbols, '[D]ocument Symbols') -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + map('lw', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace Symbols') -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. - map('rn', vim.lsp.buf.rename, '[R]e[n]ame') + map('lr', vim.lsp.buf.rename, '[R]ename') -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('la', vim.lsp.buf.code_action, 'Code [A]ction', { 'n', 'x' }) -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua index 97ff1c0..b052b43 100644 --- a/lua/plugins/nvim-dap.lua +++ b/lua/plugins/nvim-dap.lua @@ -26,13 +26,13 @@ return { { '', dap.step_into, desc = 'Debug: Step Into' }, { '', dap.step_over, desc = 'Debug: Step Over' }, { '', dap.step_out, desc = 'Debug: Step Out' }, - { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, + { 'db', dap.toggle_breakpoint, desc = 'Debug: Toggle [B]reakpoint' }, { - 'B', + 'dB', function() dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, - desc = 'Debug: Set Breakpoint', + desc = 'Debug: Set [B]reakpoint', }, -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. { '', dapui.toggle, desc = 'Debug: See last session result.' }, diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 21b5cc0..5d71c91 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -43,11 +43,11 @@ return { -- Document existing key chains spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, + { 'd', group = '[D]ebug' }, { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, + { 'l', group = '[L]SP' }, + { 'b', group = '[B]uffer' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, },