Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function! s:Gm(isVisual)
- normal! ^
- let first_col = virtcol('.')
- normal! g_
- let last_col = virtcol('.')
- execute 'normal! ' . (a:isVisual ? 'gv': '') . (first_col + last_col) / 2 . '|'
- endfunction
- nnoremap <silent> gm :call <SID>Gm(0)<CR>
- vnoremap <silent> gm :call <SID>Gm(1)<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement