feat(luasnip): enable autosnippets & config settings
This commit is contained in:
parent
cbb5322563
commit
de5e977c27
2 changed files with 7 additions and 3 deletions
|
@ -73,6 +73,9 @@ config.cosmic_ui = {
|
||||||
diagnostic = {},
|
diagnostic = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- See https://github.com/L3MON4D3/LuaSnip/blob/577045e9adf325e58f690f4d4b4a293f3dcec1b3/README.md#config
|
||||||
|
config.luasnip = {}
|
||||||
|
|
||||||
-- See :h telescope.setup
|
-- See :h telescope.setup
|
||||||
config.telescope = {}
|
config.telescope = {}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
local config = require('cosmic.config')
|
||||||
local ls = require('luasnip')
|
local ls = require('luasnip')
|
||||||
-- some shorthands...
|
-- some shorthands...
|
||||||
--[[ local s = ls.snippet
|
--[[ local s = ls.snippet
|
||||||
|
@ -9,11 +10,12 @@ local c = ls.choice_node
|
||||||
local d = ls.dynamic_node ]]
|
local d = ls.dynamic_node ]]
|
||||||
|
|
||||||
-- Every unspecified option will be set to the default.
|
-- Every unspecified option will be set to the default.
|
||||||
ls.config.set_config({
|
ls.config.set_config(vim.tbl_deep_extend('force', {
|
||||||
history = true,
|
history = true,
|
||||||
-- Update more often, :h events for more info.
|
-- Update more often, :h events for more info.
|
||||||
updateevents = 'TextChanged,TextChangedI',
|
updateevents = 'TextChanged,TextChangedI',
|
||||||
})
|
enable_autosnippets = true,
|
||||||
|
}, config.luasnip or {}))
|
||||||
|
|
||||||
ls.snippets = {
|
ls.snippets = {
|
||||||
all = {},
|
all = {},
|
||||||
|
@ -24,7 +26,6 @@ ls.snippets = {
|
||||||
ls.snippets.javascript = ls.snippets.html
|
ls.snippets.javascript = ls.snippets.html
|
||||||
ls.snippets.javascriptreact = ls.snippets.html
|
ls.snippets.javascriptreact = ls.snippets.html
|
||||||
ls.snippets.typescriptreact = ls.snippets.html
|
ls.snippets.typescriptreact = ls.snippets.html
|
||||||
-- require('luasnip/loaders/from_vscode').load({ include = { 'html' } })
|
|
||||||
|
|
||||||
-- You can also use lazy loading so you only get in memory snippets of languages you use
|
-- You can also use lazy loading so you only get in memory snippets of languages you use
|
||||||
require('luasnip/loaders/from_vscode').lazy_load({ include = { 'html' } })
|
require('luasnip/loaders/from_vscode').lazy_load({ include = { 'html' } })
|
||||||
|
|
Loading…
Add table
Reference in a new issue