move treesitter to personalize

This commit is contained in:
Talon 2023-07-28 08:47:02 -06:00
parent 15bbd0e138
commit 1cb9751928
2 changed files with 24 additions and 19 deletions

View file

@ -18,21 +18,10 @@
(nmap "<C-B>" ":Telescope buffers<CR>" "Telescope buffers") (nmap "<C-B>" ":Telescope buffers<CR>" "Telescope buffers")
(nmap "<C-T>" ":Telescope treesitter<CR>" "Telescope treesitter"))) (nmap "<C-T>" ":Telescope treesitter<CR>" "Telescope treesitter")))
:cmp-mapping :treesitter-languages
{:<C-j> (cmp.mapping.select_next_item) [:c :lua :vim :vimdoc :query ; required
:<C-k> (cmp.mapping.select_prev_item) :fennel] ; add new languages here
:<C-d> (cmp.mapping.scroll_docs -4)
:<C-f> (cmp.mapping.scroll_docs 4)
:<C-Space> (cmp.mapping.complete)
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true})
:<Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump)
(fallback))) [:i :s])
:<S-Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.locally_jumpable -1) (luasnip.jump -1)
(fallback))) [:i :s])}
:language-servers :language-servers
{:lua_ls {:filetypes [:lua] {:lua_ls {:filetypes [:lua]
:Lua :Lua
@ -60,4 +49,19 @@
(vim.api.nvim_buf_create_user_command bufnr "Format" (vim.api.nvim_buf_create_user_command bufnr "Format"
#(vim.lsp.buf.format) #(vim.lsp.buf.format)
"Format current buffer with LSP"))) "Format current buffer with LSP")))
})
:cmp-mapping
{:<C-j> (cmp.mapping.select_next_item)
:<C-k> (cmp.mapping.select_prev_item)
:<C-d> (cmp.mapping.scroll_docs -4)
:<C-f> (cmp.mapping.scroll_docs 4)
:<C-Space> (cmp.mapping.complete)
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace :select true})
:<Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.expand_or_locally_jumpable) (luasnip.expand_or_jump)
(fallback))) [:i :s])
:<S-Tab> (cmp.mapping (fn [fallback]
(if (cmp.visible) (cmp.select_prev_item)
(luasnip.locally_jumpable -1) (luasnip.jump -1)
(fallback))) [:i :s])}})

View file

@ -1,8 +1,9 @@
(let (let
[treesitter (require :nvim-treesitter.configs)] [treesitter (require :nvim-treesitter.configs)
{: treesitter-languages} (require :personalize)
]
(treesitter.setup (treesitter.setup
{:ensure_installed [:c :lua :vim :vimdoc :query ; required {:ensure_installed treesitter-languages
:fennel] ; add new languages here
:sync_install false :sync_install false
:auto_install false :auto_install false
:ignore_install [] ; could :ensure_installed :all, then ignore unwanted. :ignore_install [] ; could :ensure_installed :all, then ignore unwanted.