feat(nvim): snippet config

This commit is contained in:
Rob Watson 2023-10-04 05:44:45 +02:00
parent d123d084d7
commit 36763ac5f6
3 changed files with 6 additions and 1 deletions

2
nvimrc
View File

@ -300,6 +300,7 @@ lua require "copilot_config"
packadd! nvim-cmp " https://github.com/hrsh7th/nvim-cmp.git packadd! nvim-cmp " https://github.com/hrsh7th/nvim-cmp.git
packadd! copilot-cmp " https://github.com/zbirenbaum/copilot-cmp.git packadd! copilot-cmp " https://github.com/zbirenbaum/copilot-cmp.git
packadd! vim-vsnip " https://github.com/hrsh7th/vim-vsnip.git packadd! vim-vsnip " https://github.com/hrsh7th/vim-vsnip.git
packadd! vim-vsnip-integ " https://github.com/hrsh7th/vim-vsnip-integ.git
packadd! cmp-vsnip " https://github.com/hrsh7th/cmp-vsnip.git packadd! cmp-vsnip " https://github.com/hrsh7th/cmp-vsnip.git
packadd! cmp-nvim-lsp " https://github.com/hrsh7th/cmp-nvim-lsp.git packadd! cmp-nvim-lsp " https://github.com/hrsh7th/cmp-nvim-lsp.git
packadd! cmp-buffer " https://github.com/hrsh7th/cmp-buffer.git packadd! cmp-buffer " https://github.com/hrsh7th/cmp-buffer.git
@ -307,6 +308,7 @@ packadd! cmp-path " https://github.com/hrsh7th/cmp-path.git
packadd! cmp-calc " https://github.com/hrsh7th/cmp-calc packadd! cmp-calc " https://github.com/hrsh7th/cmp-calc
lua require "nvim_cmp_config" lua require "nvim_cmp_config"
lua require "snippet_config"
" LSP: " LSP:
packadd! nvim-lspconfig " https://github.com/neovim/nvim-lspconfig.git packadd! nvim-lspconfig " https://github.com/neovim/nvim-lspconfig.git

View File

@ -1,5 +1,4 @@
local cmp = require("cmp") local cmp = require("cmp")
-- local cmp_buffer = require("cmp_buffer")
-- https://github.com/zbirenbaum/copilot-cmp#tab-completion-configuration-highly-recommended -- https://github.com/zbirenbaum/copilot-cmp#tab-completion-configuration-highly-recommended
local has_words_before = function() local has_words_before = function()

View File

@ -0,0 +1,4 @@
vim.api.nvim_set_keymap("i", "<TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']], { expr = true })
vim.api.nvim_set_keymap("s", "<TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']], { expr = true })
vim.api.nvim_set_keymap("i", "<S-TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>']], { expr = true })
vim.api.nvim_set_keymap("s", "<S-TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>']], { expr = true })