I have below shortcut and function to align code.

map <leader>vga :call Vhdl_GA_All()<CR>

" Alignment
function! Vhdl_GA_All()
   exe ":'<,'> EasyAlign *<space>"
   exe ":'<,'> EasyAlign ("
   exe ":'<,'> EasyAlign )"

Code before alignment:
enter image description here

Select line 2~4 and run <leader>vga
enter image description here

Why first line is not aligned?


Found need to add exe "normal! \e" before EasyAlign.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.