summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-17 23:00:07 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-17 23:00:07 +0200
commit5b2e7b2b7c6b3ac3556d4caeba0116af13f9dcb3 (patch)
tree5653a4058c92d200cfd33561c5bd93cedba3aa46 /fnl/plugins/editor
parent1f34bacc0961ce720813ef34a04938ee5aca9565 (diff)
Add text-objects
Diffstat (limited to 'fnl/plugins/editor')
-rw-r--r--fnl/plugins/editor/treesitter.fnl71
1 files changed, 43 insertions, 28 deletions
diff --git a/fnl/plugins/editor/treesitter.fnl b/fnl/plugins/editor/treesitter.fnl
index bb22287..1c85ea4 100644
--- a/fnl/plugins/editor/treesitter.fnl
+++ b/fnl/plugins/editor/treesitter.fnl
@@ -1,40 +1,55 @@
;; Treesitter is a tool for building syntax trees for source files.
;; In the neovim context it helps with better coloring.
-(local opts {:ensure_installed [:c
- :dockerfile
- :erlang
- :fennel
- :go
- :haskell
- :hcl
- :html
- :latex
- :lua
- :make
- :markdown
- :ocaml
- :org
- :python
- :rust
- :sql
- :toml
- :vim
- :yaml]
- :sync_install false
- :ignore_install [""]
- :autopairs {:enable true}
- :highlight {:enable true
- :additional_vim_regex_highlighting [:org]}
- :context_commentstring {:enable true :enable_autocmd false}
- :indent {:enable true :disable [:yaml :python :css]}
- :playground {:enable true}})
+(local opts
+ {:ensure_installed [:c
+ :dockerfile
+ :erlang
+ :fennel
+ :go
+ :haskell
+ :hcl
+ :html
+ :latex
+ :lua
+ :make
+ :markdown
+ :ocaml
+ :org
+ :python
+ :rust
+ :sql
+ :toml
+ :vim
+ :yaml]
+ :sync_install false
+ :ignore_install [""]
+ :autopairs {:enable true}
+ :highlight {:enable true :additional_vim_regex_highlighting [:org]}
+ :context_commentstring {:enable true :enable_autocmd false}
+ :indent {:enable true :disable [:yaml :python :css]}
+ :playground {:enable true}
+ :textobjects {:select {:enable true
+ :lookahead true
+ :keymaps {:af "@function.outer"
+ :if "@function.inner"
+ :ac "@class.outer"
+ :ic {:query "@class.inner"
+ :desc "Select inner part of a class region"}
+ :as {:query "@scope"
+ :query_group :locals
+ :desc "Select language scope"}}
+ :selection_modes {"@parameter.outer" :v
+ "@function.outer" :V
+ "@class.outer" :<c-v>}
+ :include_surrounding_whitespace true}}})
(fn setup []
(let [treesitter (require :nvim-treesitter.configs)]
(treesitter.setup opts)))
{1 :nvim-treesitter/nvim-treesitter
+ :dependencies [{1 :nvim-treesitter/nvim-treesitter-textobjects}]
:build ":TSUpdate"
:event :VeryLazy
:config (fn []