338 current 2025-02-16 17:29:05 25.05.20241217.d3c42f1 6.6.66 *
This commit is contained in:
31
home/programs/nvim/plugins/luasnip.lua
Normal file
31
home/programs/nvim/plugins/luasnip.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
vim.cmd[[
|
||||
" Use Tab to expand and jump through snippets
|
||||
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
|
||||
smap <silent><expr> <Tab> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'
|
||||
|
||||
" Use Shift-Tab to jump backwards through snippets
|
||||
imap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
|
||||
smap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
|
||||
|
||||
" Expand or jump in insert mode
|
||||
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
|
||||
|
||||
" Jump forward through tabstops in visual mode
|
||||
smap <silent><expr> <Tab> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'
|
||||
]]
|
||||
|
||||
require("luasnip").config.set_config({ -- Setting LuaSnip config
|
||||
|
||||
-- Enable autotriggered snippets
|
||||
enable_autosnippets = true,
|
||||
|
||||
-- Use Tab (or some other key if you prefer) to trigger visual selection
|
||||
store_selection_keys = "<Tab>",
|
||||
})
|
||||
|
||||
-- JAKENOTE, relative imports *do not work* with nixos. don't GG yourself blud.
|
||||
require("luasnip.loaders.from_lua").load({
|
||||
paths = vim.fn.stdpath('config') .. "/snippets/"
|
||||
})
|
||||
|
||||
-- require("luasnip.loaders.from_lua").lazy_load({paths = "./snippets/"})
|
||||
Reference in New Issue
Block a user