From 614502d4e67ca7a165543f42c8cad891dcb965e1 Mon Sep 17 00:00:00 2001 From: jjwoz Date: Mon, 1 Apr 2024 07:49:30 -0400 Subject: [PATCH] changed the keymap for buffer find to allow for cmd + / to be comment line --- init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 9ecb8178..a2030289 100644 --- a/init.lua +++ b/init.lua @@ -171,6 +171,13 @@ vim.keymap.set('n', '', ' Neotree toggle') vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') +-- Comment +vim.keymap.set('n', '/', function() + require('Comment.api').toggle.linewise.current() +end, { desc = 'Comment Toggle' }) + +vim.keymap.set('v', '/', "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = 'Comment Toggle' }) + -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) @@ -397,9 +404,12 @@ require('lazy').setup({ vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + -- NOTE: Git Telescope Mappings + vim.keymap.set('n', 'cm', 'Telescope git_commits', { desc = 'Telescope Git commits' }) + vim.keymap.set('n', 'gt', 'Telescope git_status', { desc = 'Telescope Git status' }) -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() + vim.keymap.set('n', 'fz', function() -- You can pass additional configuration to telescope to change theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10,