nvim: Add easy-align

This commit is contained in:
Sanchayan Maity 2020-10-30 11:38:04 +05:30
parent 7887a04d62
commit 801f9725b4
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,21 @@
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 }
}

View file

@ -115,6 +115,11 @@ local init = function ()
use 'lambdalisue/edita.vim' use 'lambdalisue/edita.vim'
-- Take care of sudo -- Take care of sudo
use 'lambdalisue/suda.vim' use 'lambdalisue/suda.vim'
-- Alignment
use {
'junegunn/vim-easy-align',
config = "require('modules.easyalign')"
}
-- LSP -- LSP
use { use {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',