Created
September 23, 2017 13:59
-
-
Save romainl/775d7858348b49d66536fdffa73df789 to your computer and use it in GitHub Desktop.
Fun with non-empty lines
This file contains hidden or 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
" jump to next non-empty line | |
nnoremap <key> :<C-u>call search('^.\+')<CR> | |
" jump to previous non-empty line | |
nnoremap <otherkey> :<C-u>call search('^.\+', 'b')<CR> | |
" extend visual selection to next non-empty line | |
xnoremap <key> :<C-u>k`\|call search('^.\+')\|normal! <C-r>=visualmode()<CR>``o<CR> | |
" extend visual selection to previous non-empty line | |
xnoremap <otherkey> :<C-u>k`\|call search('^.\+', 'b')\|normal! <C-r>=visualmode()<CR>``o<CR> | |
" operate to next non-empty line | |
omap <key> :<C-u>normal! v<key><CR> | |
"operate to previous non-empty line | |
omap <otherkey> :<C-u>normal! v<otherkey><CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment