forked from bfredl/bfredl.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnippets.lua
More file actions
49 lines (45 loc) · 896 Bytes
/
snippets.lua
File metadata and controls
49 lines (45 loc) · 896 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local newsym
if false then
local syms = vim.fn["julia_latex_symbols#get_dict"]()
newsym = {}
for k,v in pairs(syms) do
if string.sub(k,1,1) == "\\" then
newsym[string.sub(k,2)] = v
end
end
f= io.open('timp', 'w')
f:write(vim.inspect(newsym))
f:close()
else
newsym = require'bfredl.julia_symbols'
end
local h = {}
h.snippets = {
_global = {
todob = "TODO(bfredl):";
todou = "TODO(upstream):";
todon = "TODO(neovim):";
f = "FIXME:";
re = "return"; -- TODO(bfredl): redundant, integrate snippets with ibus-chords properly
};
lua = {
fun = [[function $1($2)
$0
end]];
r = [[require]];
l = [[local $1 = $0]];
};
c = {
vp = "(void *)";
['for'] = [[for ($1 $2 = $3; $2 < $4; $2++) {
$0
}]];
};
julia = newsym
}
function h.setup() -- {{{
local s = require'snippets'
s.use_suggested_mappings()
s.snippets = h.snippets
end
return h