-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathalign.lua
38 lines (28 loc) · 954 Bytes
/
align.lua
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
return {
'junegunn/vim-easy-align',
on = { '<Plug>(EasyAlign)', 'EasyAlign' },
keymaps = {
{ 'n', '<leader>A', '<Plug>(EasyAlign)' },
{ 'x', '<leader>A', '<Plug>(EasyAlign)' },
{ 'n', '<leader>a', '<Plug>(LiveEasyAlign)' },
{ 'x', '<leader>a', '<Plug>(LiveEasyAlign)' },
},
config = function(config)
local conf = config.align
vim.g.easy_align_ignore_groups = conf.ignoreGroups
vim.g.easy_align_delimiters = conf.delimiters
end,
defaultConfig = {
'align',
{
delimiters = {
['>'] = { pattern = '>>|=>|>' },
['/'] = { pattern = '//+|/*|*/', delimiter_align = 'l', ignore_groups = { '!Comment' } },
[']'] = { pattern = '[[]]', left_margin = 0, right_margin = 0, stick_to_left = 0 },
[')'] = { pattern = '[()]', left_margin = 0, right_margin = 0, stick_to_left = 0 },
['d'] = { pattern = ' (S+s*[;=])@=', left_margin = 0, right_margin = 0 },
},
},
ignoreGroups = { 'Comment', 'String' },
},
}