Last active
August 29, 2015 14:02
-
-
Save nisaacson/4e17cb6abc4345833416 to your computer and use it in GitHub Desktop.
Align code on the = sign with a key mapping using the EasyAlign Plugin https://github.com/junegunn/vim-easy-align
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle 'junegunn/vim-easy-align' | |
map <Leader>r :call EnterAlign()<cr> | |
function! EnterAlign() | |
let save_cursor = getpos(".") | |
let l:win_view = winsaveview() | |
:execute "normal vip\<Enter>=" | |
call winrestview(l:win_view) | |
call setpos('.', save_cursor) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment