From d84cb45a4ad4cadfdb523d3b90c10530ae82c6a6 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 27 Dec 2023 14:28:23 +0100 Subject: [PATCH] Adds keybind for renaming --- init.lua | 34 +++++++++++++++++++++++++++++++--- lazy-lock.json | 1 + 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 60151536..67e47648 100644 --- a/init.lua +++ b/init.lua @@ -293,6 +293,31 @@ require('lazy').setup({ }, }, }, + { + "abecodes/tabout.nvim", + after = { "nvim-cmp" }, + event = "InsertEnter", + opts = { + tabkey = '', -- key to trigger tabout, set to an empty string to disable + backwards_tabkey = '', -- key to trigger backwards tabout, set to an empty string to disable + act_as_tab = true, -- shift content if tab out is not possible + act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) + default_tab = '', -- shift default action (only at the beginning of a line, otherwise is used) + default_shift_tab = '', -- reverse shift default action, + enable_backwards = true, -- well ... + -- completion = true, -- if the tabkey is used in a completion pum + tabouts = { + { open = "'", close = "'" }, + { open = '"', close = '"' }, + { open = '`', close = '`' }, + { open = '(', close = ')' }, + { open = '[', close = ']' }, + { open = '{', close = '}' } + }, + -- ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] + exclude = {} -- tabout will ignore these filetypes + } + }, -- 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 vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) --- [[ substitute ]] +-- substitute vim.keymap.set("n", "gr", require('substitute').operator, { noremap = true }) vim.keymap.set("n", "grr", require('substitute').line, { noremap = true }) vim.keymap.set("x", "gr", require('substitute').visual, { noremap = true }) --- [[ clipboad ]] +-- clipboad vim.keymap.set({ "n", "v" }, "y", '"+y') vim.keymap.set({ "n", "v" }, "p", '"+p') vim.keymap.set({ "n", "v" }, "gr", function() require('substitute').operator({ register = "+" }) end, { noremap = true }) vim.keymap.set({ "n", "v" }, "grr", function() require('substitute').line({ register = "+" }) end, { noremap = true }) +-- replace word under cursor +vim.keymap.set({ "n" }, "rr", '*``cgn') + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` @@ -482,7 +510,7 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', "haskell" }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, diff --git a/lazy-lock.json b/lazy-lock.json index 434fd988..dddff0be 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -22,6 +22,7 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "c71406807b545f4a2c17310197a8c88b976f338d" }, "plenary.nvim": { "branch": "master", "commit": "366b0837486f60ae0e7550c15de8ff66d057c4cd" }, "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, + "tabout.nvim": { "branch": "master", "commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },