Add unicode autosnippets.

main
Joshua Potter 2024-01-24 15:46:03 -07:00
parent 49b189d9ab
commit 861934229b
2 changed files with 154 additions and 7 deletions

View File

@ -4,12 +4,157 @@ local s = ls.snippet
local t = ls.text_node local t = ls.text_node
return { return {
-- Subscripts
s( s(
{ { trig = [[_1]], wordTrig = false },
trig = [[\_1]],
wordTrig = false,
snippetType = 'autosnippet',
},
t('') t('')
) ),
s(
{ trig = [[_2]], wordTrig = false },
t('')
),
s(
{ trig = [[_3]], wordTrig = false },
t('')
),
s(
{ trig = [[_4]], wordTrig = false },
t('')
),
s(
{ trig = [[_5]], wordTrig = false },
t('')
),
s(
{ trig = [[_6]], wordTrig = false },
t('')
),
s(
{ trig = [[_7]], wordTrig = false },
t('')
),
s(
{ trig = [[_8]], wordTrig = false },
t('')
),
s(
{ trig = [[_9]], wordTrig = false },
t('')
),
s(
{ trig = [[_a]], wordTrig = false },
t('')
),
s(
{ trig = [[_i]], wordTrig = false },
t('')
),
s(
{ trig = [[_j]], wordTrig = false },
t('')
),
s(
{ trig = [[_k]], wordTrig = false },
t('')
),
s(
{ trig = [[_m]], wordTrig = false },
t('')
),
s(
{ trig = [[_n]], wordTrig = false },
t('')
),
-- Lists
s(
{ trig = [[.]], wordTrig = false },
t('·')
),
s(
{ trig = [[circ]], wordTrig = false },
t('')
),
-- Arrows
s(
{ trig = [[d]], wordTrig = false },
t('')
),
s(
{ trig = [[l]], wordTrig = false },
t('')
),
s(
{ trig = [[←r]], wordTrig = false },
t('')
),
s(
{ trig = [[r]], wordTrig = false },
t('')
),
s(
{ trig = [[u]], wordTrig = false },
t('')
),
-- Greek letters
s(
{ trig = [[a]], wordTrig = false },
t('α')
),
s(
{ trig = [[b]], wordTrig = false },
t('β')
),
s(
{ trig = [[g]], wordTrig = false },
t('γ')
),
s(
{ trig = [[e]], wordTrig = false },
t('ε')
),
s(
{ trig = [[pi]], wordTrig = false },
t('π')
),
s(
{ trig = [[s]], wordTrig = false },
t('σ')
),
s(
{ trig = [[z]], wordTrig = false },
t('ζ')
),
-- Other operators
s(
{ trig = [[neg]], wordTrig = false },
t('¬')
),
s(
{ trig = [[αn]], wordTrig = false },
t('')
),
s(
{ trig = [[or]], wordTrig = false },
t('')
),
s(
{ trig = [[imp]], wordTrig = false },
t('')
),
s(
{ trig = [[iff]], wordTrig = false },
t('')
),
s(
{ trig = [[cap]], wordTrig = false },
t('')
),
s(
{ trig = [[cup]], wordTrig = false },
t('')
),
} }

View File

@ -31,7 +31,9 @@ let
plugin = pkgs.vimPlugins.luasnip; plugin = pkgs.vimPlugins.luasnip;
config = '' config = ''
require('utils.luasnip').setup() require('utils.luasnip').setup()
require('luasnip').add_snippets('all', require('utf8.snippets')) require('luasnip').add_snippets('all', require('utf8.snippets'), {
type = 'autosnippets',
})
${config.programs.neovim.nvim-snippets} ${config.programs.neovim.nvim-snippets}
''; '';
}; };