From 9db6694da8f7cbced6fd73a09322ad6f7350f255 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 17 Sep 2023 23:49:12 +0200 Subject: Add more text-object defaults --- fnl/plugins/editor/treesitter.fnl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/fnl/plugins/editor/treesitter.fnl b/fnl/plugins/editor/treesitter.fnl index 02e781f..68baf38 100644 --- a/fnl/plugins/editor/treesitter.fnl +++ b/fnl/plugins/editor/treesitter.fnl @@ -35,7 +35,12 @@ :ia "@parameter.inner" :af "@function.outer" :if "@function.inner" + :ii "@conditional.outer" + :ai "@conditional.inner" + :il "@loop.outer" + :al "@loop.inner" :ac "@class.outer" + :at "@comment.outer" :ic {:query "@class.inner" :desc "Select inner part of a class region"} :as {:query "@scope" @@ -44,7 +49,30 @@ :selection_modes {"@parameter.outer" :v "@function.outer" :V "@class.outer" :} - :include_surrounding_whitespace true}}}) + :include_surrounding_whitespace true} + :swap {:enable true + :swap_next {:a "@parameter.inner"} + :swap_previous {:A "@parameter.inner"}} + :move {:enable true + :set_jumps true + :goto_next_start {"]m" "@function.outer" + "]]" {:query "@class.outer" + :desc "Next class start"} + "]o" "@loop.*" + "]s" {:query "@scope" + :query_group :locals + :desc "Next scope"} + "]z" {:query "@fold" + :query_group :folds + :desc "Next fold"}} + :goto_next_end {"]M" "@function.outer" + "][" "@class.outer"} + :goto_previous_start {"[m" "@function.outer" + "[[" "@class.outer"} + :goto_previous_end {"[M" "@function.outer" + "[]" "@class.outer"} + :goto_next {"]i" "@conditional.outer"} + :goto_previous {"[i" "@conditional.outer"}}}}) (fn setup [] (let [treesitter (require :nvim-treesitter.configs)] -- cgit v1.2.3-70-g09d2