From 1cb975192899ba706a782e852f4a8480f0a64f02 Mon Sep 17 00:00:00 2001 From: Talon Date: Fri, 28 Jul 2023 08:47:02 -0600 Subject: [PATCH] move treesitter to personalize --- fnl/personalize.fnl | 36 ++++++++++++++++++++---------------- fnl/setup-treesitter.fnl | 7 ++++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/fnl/personalize.fnl b/fnl/personalize.fnl index 23857a2..bc6852b 100644 --- a/fnl/personalize.fnl +++ b/fnl/personalize.fnl @@ -18,21 +18,10 @@ (nmap "" ":Telescope buffers" "Telescope buffers") (nmap "" ":Telescope treesitter" "Telescope treesitter"))) - :cmp-mapping - {: (cmp.mapping.select_next_item) - : (cmp.mapping.select_prev_item) - : (cmp.mapping.scroll_docs -4) - : (cmp.mapping.scroll_docs 4) - : (cmp.mapping.complete) - : (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true}) - : (cmp.mapping (fn [fallback] - (if (cmp.visible) (cmp.select_prev_item) - (luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump) - (fallback))) [:i :s]) - : (cmp.mapping (fn [fallback] - (if (cmp.visible) (cmp.select_prev_item) - (luasnip.locally_jumpable -1) (luasnip.jump -1) - (fallback))) [:i :s])} + :treesitter-languages + [:c :lua :vim :vimdoc :query ; required + :fennel] ; add new languages here + :language-servers {:lua_ls {:filetypes [:lua] :Lua @@ -60,4 +49,19 @@ (vim.api.nvim_buf_create_user_command bufnr "Format" #(vim.lsp.buf.format) "Format current buffer with LSP"))) - }) + + :cmp-mapping + {: (cmp.mapping.select_next_item) + : (cmp.mapping.select_prev_item) + : (cmp.mapping.scroll_docs -4) + : (cmp.mapping.scroll_docs 4) + : (cmp.mapping.complete) + : (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true}) + : (cmp.mapping (fn [fallback] + (if (cmp.visible) (cmp.select_prev_item) + (luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump) + (fallback))) [:i :s]) + : (cmp.mapping (fn [fallback] + (if (cmp.visible) (cmp.select_prev_item) + (luasnip.locally_jumpable -1) (luasnip.jump -1) + (fallback))) [:i :s])}}) diff --git a/fnl/setup-treesitter.fnl b/fnl/setup-treesitter.fnl index 41d11ab..64c712e 100644 --- a/fnl/setup-treesitter.fnl +++ b/fnl/setup-treesitter.fnl @@ -1,8 +1,9 @@ (let - [treesitter (require :nvim-treesitter.configs)] + [treesitter (require :nvim-treesitter.configs) + {: treesitter-languages} (require :personalize) + ] (treesitter.setup - {:ensure_installed [:c :lua :vim :vimdoc :query ; required - :fennel] ; add new languages here + {:ensure_installed treesitter-languages :sync_install false :auto_install false :ignore_install [] ; could :ensure_installed :all, then ignore unwanted.