From f4a4639198d637b54d836442a97a644ee867ba10 Mon Sep 17 00:00:00 2001 From: nganhkhoa Date: Thu, 15 Jul 2021 03:41:13 +0700 Subject: [PATCH] add treesitter textobjects --- fnl/lsp.fnl | 8 +++++++- fnl/plugins.fnl | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fnl/lsp.fnl b/fnl/lsp.fnl index 913f617..616b5c5 100644 --- a/fnl/lsp.fnl +++ b/fnl/lsp.fnl @@ -23,6 +23,12 @@ (treesitter.setup {:ensure_installed ["c" "cpp" "python" "go" "rust" "javascript" "lua"] :highlight {:enable true} - :indent {:enable true}}) + :indent {:enable true} + :textobjects {:select {:enable true + :keymaps {:ia "@parameter.inner" + :oa "@parameter.outer"}} + :swap {:enable true + :swap_next {: "@parameter.inner"} + :swap_previous {: "@parameter.inner"}}}}) (set nvim.o.completeopt "menuone,noselect") diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 624f813..01a3748 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -28,6 +28,7 @@ (use :nelstrom/vim-visual-star-search) (use {1 :nvim-treesitter/nvim-treesitter :run ":TSUpdate"}) + (use :nvim-treesitter/nvim-treesitter-textobjects) (use :hrsh7th/nvim-compe) (use :neovim/nvim-lspconfig)