blob: 91865d67d34b090546a23441e5fed83c2a317a7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
;; Snippets functionality.
(local dependencies [:rafamadriz/friendly-snippets])
(λ add-snippets [name]
(let [snippets (require (.. :plugins.snippets. name))]
(snippets.add-snippets)))
(local {: load-and-apply} (require :util.load))
(λ config []
(let [ls (require :luasnip)
luasnip-vscode (require :luasnip.loaders.from_vscode)]
(luasnip-vscode.lazy_load)
(load-and-apply :/fnl/plugins/snippets add-snippets)
(ls.config.set_config {:history false
:updateevents "TextChanged,TextChangedI"})
(vim.keymap.set [:i :s] :<c-u>
(lambda []
(when (ls.expand_or_jumpable)
(ls.expand_or_jump))) {:silent true})
(vim.keymap.set [:i :s] :<c-l>
(lambda []
(when (ls.jumpable -1)
(ls.jump -1))
{:silent true}))
(vim.keymap.set [:i] :<c-j>
(lambda []
(when (ls.choice_active)
(ls.change_choice 1)))
{:silent true})))
{1 :L3MON4D3/LuaSnip :event :InsertEnter : config : dependencies}
|