Split snippets config out of completions config
This commit is contained in:
parent
a4377b22ac
commit
e11b4d54a2
@ -7,11 +7,12 @@ return {
|
|||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
|
||||||
-- Completion plugins
|
-- Completion plugins
|
||||||
'hrsh7th/cmp-nvim-lsp', -- Source for built-in language server client
|
'hrsh7th/cmp-nvim-lsp', -- Source for built-in language server client
|
||||||
'hrsh7th/cmp-buffer', -- Source for buffer words
|
'saadparwaiz1/cmp_luasnip', -- Source for LuaSnip snippets
|
||||||
'hrsh7th/cmp-path', -- Source for filesystem paths
|
'hrsh7th/cmp-buffer', -- Source for buffer words
|
||||||
'kbenzie/cmp-git', -- Source for Git/GitHub/GitLab
|
'hrsh7th/cmp-path', -- Source for filesystem paths
|
||||||
'hrsh7th/nvim-cmp', -- Completion engine combines and use the above
|
'kbenzie/cmp-git', -- Source for Git/GitHub/GitLab
|
||||||
|
'hrsh7th/nvim-cmp', -- Completion engine combines and use the above
|
||||||
|
|
||||||
-- TODO: https://github.com/b0o/SchemaStore.nvim
|
-- TODO: https://github.com/b0o/SchemaStore.nvim
|
||||||
-- TODO: https://github.com/jmbuhr/otter.nvim
|
-- TODO: https://github.com/jmbuhr/otter.nvim
|
||||||
@ -25,10 +26,6 @@ return {
|
|||||||
-- Lua vim module support in lua language server
|
-- Lua vim module support in lua language server
|
||||||
'folke/neodev.nvim',
|
'folke/neodev.nvim',
|
||||||
|
|
||||||
-- Snippet pluggins
|
|
||||||
{ 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' },
|
|
||||||
'saadparwaiz1/cmp_luasnip',
|
|
||||||
|
|
||||||
-- Expose clangd extensions
|
-- Expose clangd extensions
|
||||||
'p00f/clangd_extensions.nvim',
|
'p00f/clangd_extensions.nvim',
|
||||||
|
|
||||||
@ -180,25 +177,6 @@ return {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Snippet mappings
|
|
||||||
local luasnip = require('luasnip')
|
|
||||||
luasnip.setup({})
|
|
||||||
vim.keymap.set({ 'i', 's' }, '<C-j>', function()
|
|
||||||
if luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
end
|
|
||||||
end, { silent = true })
|
|
||||||
vim.keymap.set({ 'i', 's' }, '<C-K>', function()
|
|
||||||
if luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
end
|
|
||||||
end, { silent = true })
|
|
||||||
|
|
||||||
-- Load snippets
|
|
||||||
local opts = { paths = vim.fn.stdpath('config') .. '/snippets' }
|
|
||||||
require('luasnip.loaders.from_snipmate').lazy_load(opts)
|
|
||||||
require('luasnip.loaders.from_lua').lazy_load(opts)
|
|
||||||
|
|
||||||
-- LSP UI plugins
|
-- LSP UI plugins
|
||||||
require('fidget').setup({})
|
require('fidget').setup({})
|
||||||
require('lsp_signature').setup({
|
require('lsp_signature').setup({
|
||||||
|
26
lua/plugins/snippets.lua
Normal file
26
lua/plugins/snippets.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
return {
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
name = 'LuaSnip',
|
||||||
|
build = 'make install_jsregexp',
|
||||||
|
config = function()
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
luasnip.setup({})
|
||||||
|
|
||||||
|
-- Load snippets
|
||||||
|
local opts = { paths = vim.fn.stdpath('config') .. '/snippets' }
|
||||||
|
require('luasnip.loaders.from_snipmate').lazy_load(opts)
|
||||||
|
require('luasnip.loaders.from_lua').lazy_load(opts)
|
||||||
|
|
||||||
|
-- Snippet keybindings
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<C-j>', function()
|
||||||
|
if luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
vim.keymap.set({ 'i', 's' }, '<C-K>', function()
|
||||||
|
if luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
end
|
||||||
|
end, { silent = true })
|
||||||
|
end
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user