I use Junegunn’s Vim plugin vim-easy-align to make it easier to align my code. Unfortunately, this plugin does not have a default mapping for aligning the dollar sign ($
).
Because the plugin is designed to be extensible, I was able to add support for aligning by the dollar sign ($
) by adding the following to my .vimrc
file
let g:easy_align_delimiters = {
\ '$': {
\ 'pattern': '$\+',
\ 'right_margin': 0,
\ 'stick_to_left': 0,
\ 'ignore_groups': ['!Comment'] },
\ }
It so amazing!
Thanks!
(and try ‘left_margin’: 1,)