feat: add incremental selection
This commit is contained in:
parent
5bc75d0632
commit
bb5e0f6ab2
3 changed files with 21 additions and 10 deletions
17
init.lua
17
init.lua
|
@ -21,11 +21,11 @@ vim.opt.foldenable = false
|
|||
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {},
|
||||
sync_install = false,
|
||||
auto_install = false,
|
||||
modules = {"highlight", "incremental_selection", "indent"},
|
||||
modules = { "highlight", "incremental_selection", "indent" },
|
||||
ignore_install = {},
|
||||
highlight = { enable = true },
|
||||
disable = function(_, buf)
|
||||
|
@ -35,7 +35,16 @@ require('nvim-treesitter.configs').setup({
|
|||
return true
|
||||
end
|
||||
end,
|
||||
additional_vim_regex_highlighting = false
|
||||
additional_vim_regex_highlighting = false,
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
node_incremental = "<C-k>",
|
||||
scope_incremental = "<BS>",
|
||||
node_decremental = "<C-j>",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({
|
||||
|
@ -49,6 +58,6 @@ vim.api.nvim_create_autocmd({
|
|||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank {higroup='Visual', timeout=300}
|
||||
vim.highlight.on_yank({ higroup = "Visual", timeout = 300 })
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -24,6 +24,7 @@ vim.keymap.set({ "n", "v" }, "<leader>P", '"+P', { desc = "put before cursor fro
|
|||
|
||||
vim.keymap.set("i", "<Tab>", require("scripts.intellitab").indent)
|
||||
|
||||
-- Allow increment/decrement repeatedly in visual
|
||||
vim.keymap.set("v", "<C-a>", "<C-a>gv")
|
||||
vim.keymap.set("v", "<C-x>", "<C-x>gv")
|
||||
vim.keymap.set("v", "g<C-a>", "g<C-a>gv")
|
||||
|
|
|
@ -68,6 +68,7 @@ return {
|
|||
"mini.notify",
|
||||
after = function()
|
||||
require("mini.notify").setup({
|
||||
-- handled by statusline
|
||||
lsp_progress = { enable = false },
|
||||
})
|
||||
end,
|
||||
|
|
Loading…
Reference in a new issue