diff --git a/init.lua b/init.lua index 5546593e..9c5e60b4 100644 --- a/init.lua +++ b/init.lua @@ -235,14 +235,17 @@ vim.keymap.set('n', '', 'echo "Use j to move!!"') -- vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- Buffer switch +-- https://github.com/tpope/vim-unimpaired vim.keymap.set({ 'n' }, ']b', 'bnext', { silent = true }) vim.keymap.set({ 'n' }, '[b', 'bprev', { silent = true }) +vim.keymap.set({ 'n' }, ']q', 'cnext', { silent = true }) +vim.keymap.set({ 'n' }, '[q', 'cprevious', { silent = true }) -- vim.keymap.set({ 'n', 'i', 'v' }, '', 'bnext', { silent = true }) -- vim.keymap.set({ 'n', 'i', 'v' }, '', 'bprev', { silent = true }) -- Close all buffers and keep the open one only vim.keymap.set('n', 'b', ':%bd|e#|bd#', { desc = 'Close all buffers and keep the open one only' }) --- signature help +-- Signature help vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers['signature_help'], { border = 'single', close_events = { 'CursorMoved', 'BufHidden' }, diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..7d6fc37d --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,45 @@ +return { + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + init = function() + local harpoon = require 'harpoon' + vim.keymap.set('n', 'hh', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + vim.keymap.set('n', 'ha', function() + harpoon:list():add() + end) + + vim.keymap.set('n', '', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '', function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '[h', function() + harpoon:list():prev() + end) + vim.keymap.set('n', ']h', function() + harpoon:list():next() + end) + end, + config = function() + require('harpoon'):setup { + settings = { + sync_on_ui_close = true, + save_on_toggle = true, + }, + } + end, + }, +} diff --git a/lua/custom/plugins/vim-unimpaired.lua b/lua/custom/plugins/vim-unimpaired.lua index bf498ee8..bf31a3f3 100644 --- a/lua/custom/plugins/vim-unimpaired.lua +++ b/lua/custom/plugins/vim-unimpaired.lua @@ -3,7 +3,7 @@ return { -- "kevinhwang91/nvim-bqf", -- lazy = false, -- }, - { - 'tpope/vim-unimpaired', - }, + -- { + -- 'tpope/vim-unimpaired', + -- }, }