nvim: Add easy-align
This commit is contained in:
parent
7887a04d62
commit
801f9725b4
2 changed files with 26 additions and 0 deletions
21
nvim/.config/nvim/lua/modules/easyalign.lua
Normal file
21
nvim/.config/nvim/lua/modules/easyalign.lua
Normal 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 }
|
||||
}
|
|
@ -115,6 +115,11 @@ local init = function ()
|
|||
use 'lambdalisue/edita.vim'
|
||||
-- Take care of sudo
|
||||
use 'lambdalisue/suda.vim'
|
||||
-- Alignment
|
||||
use {
|
||||
'junegunn/vim-easy-align',
|
||||
config = "require('modules.easyalign')"
|
||||
}
|
||||
-- LSP
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
|
|
Loading…
Reference in a new issue