dotfiles/nvim/.config/nvim/after/plugin/easyalign.lua
Sanchayan Maity 55356513a9 nvim: after/plugin/easyalign: Fix conflicting mapping
'ga' mapping conflicts with the LSP code action mapping.
2021-09-25 18:31:10 +05:30

21 lines
1.3 KiB
Lua

vim.api.nvim_set_keymap('x', 'gA', '<Plug>(EasyAlign)', {})
vim.api.nvim_set_keymap('n', 'gA', '<Plug>(EasyAlign)', {})
vim.g.easy_align_delimiters = {
[';'] = { pattern = ';' , left_margin = 0 },
['['] = { pattern = '[' , left_margin = 1, right_margin = 0 },
[']'] = { pattern = ']' , left_margin = 0, right_margin = 1 },
[','] = { pattern = ',' , left_margin = 0, right_margin = 1 },
[')'] = { pattern = ')' , left_margin = 0, right_margin = 0 },
['('] = { pattern = '(' , left_margin = 0, right_margin = 0 },
['='] = { pattern = [[<\?=>\?]], left_margin = 1, right_margin = 1 },
['|'] = { pattern = [[|\?|]] , left_margin = 1, right_margin = 1 },
['&'] = { pattern = [[&\?&]] , left_margin = 1, right_margin = 1 },
[':'] = { pattern = ':' , left_margin = 1, right_margin = 1 },
['?'] = { pattern = '?' , left_margin = 1, right_margin = 1 },
['<'] = { pattern = '<' , left_margin = 1, right_margin = 0 },
['\\'] = { pattern = '\\' , left_margin = 1, right_margin = 0 },
['+'] = { pattern = '+' , left_margin = 1, right_margin = 1 },
['>'] = { pattern = '->' , left_margin = 1, right_margin = 1 },
['#'] = { pattern = '#-' , left_margin = 1, right_margin = 1 }
}