Skip to content

Commit d84cb45

Browse files
committed
Adds keybind for renaming
1 parent b168a4b commit d84cb45

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

init.lua

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,31 @@ require('lazy').setup({
293293
},
294294
},
295295
},
296+
{
297+
"abecodes/tabout.nvim",
298+
after = { "nvim-cmp" },
299+
event = "InsertEnter",
300+
opts = {
301+
tabkey = '<Tab>', -- key to trigger tabout, set to an empty string to disable
302+
backwards_tabkey = '<S-Tab>', -- key to trigger backwards tabout, set to an empty string to disable
303+
act_as_tab = true, -- shift content if tab out is not possible
304+
act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports <S-Tab>)
305+
default_tab = '<C-t>', -- shift default action (only at the beginning of a line, otherwise <TAB> is used)
306+
default_shift_tab = '<C-d>', -- reverse shift default action,
307+
enable_backwards = true, -- well ...
308+
-- completion = true, -- if the tabkey is used in a completion pum
309+
tabouts = {
310+
{ open = "'", close = "'" },
311+
{ open = '"', close = '"' },
312+
{ open = '`', close = '`' },
313+
{ open = '(', close = ')' },
314+
{ open = '[', close = ']' },
315+
{ open = '{', close = '}' }
316+
},
317+
-- ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]]
318+
exclude = {} -- tabout will ignore these filetypes
319+
}
320+
},
296321

297322

298323
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
@@ -371,19 +396,22 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos
371396
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
372397
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
373398

374-
-- [[ substitute ]]
399+
-- substitute
375400

376401
vim.keymap.set("n", "gr", require('substitute').operator, { noremap = true })
377402
vim.keymap.set("n", "grr", require('substitute').line, { noremap = true })
378403
vim.keymap.set("x", "gr", require('substitute').visual, { noremap = true })
379404

380-
-- [[ clipboad ]]
405+
-- clipboad
381406
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
382407
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p')
383408
vim.keymap.set({ "n", "v" }, "<leader>gr", function() require('substitute').operator({ register = "+" }) end,
384409
{ noremap = true })
385410
vim.keymap.set({ "n", "v" }, "<leader>grr", function() require('substitute').line({ register = "+" }) end,
386411
{ noremap = true })
412+
-- replace word under cursor
413+
vim.keymap.set({ "n" }, "<leader>rr", '*``cgn')
414+
387415

388416
-- [[ Highlight on yank ]]
389417
-- See `:help vim.highlight.on_yank()`
@@ -482,7 +510,7 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
482510
vim.defer_fn(function()
483511
require('nvim-treesitter.configs').setup {
484512
-- Add languages to be installed here that you want installed for treesitter
485-
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
513+
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', "haskell" },
486514

487515
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
488516
auto_install = false,

lazy-lock.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"nvim-treesitter-textobjects": { "branch": "master", "commit": "c71406807b545f4a2c17310197a8c88b976f338d" },
2323
"plenary.nvim": { "branch": "master", "commit": "366b0837486f60ae0e7550c15de8ff66d057c4cd" },
2424
"substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" },
25+
"tabout.nvim": { "branch": "master", "commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5" },
2526
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
2627
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
2728
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },

0 commit comments

Comments
 (0)