Created
September 21, 2010 22:27
-
-
Save awebneck/590705 to your computer and use it in GitHub Desktop.
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
" Normal-mode bindings for easy camelCase editing: | |
" cm begins at the current position and deletes until | |
" the end of the word or the next capital letter | |
" (exclusive), then places you into insert mode in the | |
" deleted space | |
nmap <silent> cm :let save_search=@/<CR>v/[A-Z]\\|\([A-Za-z0-9]\)\@<lt>=\(\W\\|_\)<CR>hx:let @/=save_search<CR>i | |
" cu begins at the beginning of the current word or | |
" previous capital letterand deletes until the end of | |
" the word or the next capital letter (exclusive), | |
" then places you into insert mode in the deleted | |
" space. | |
nmap <silent> cu :let save_search=@/<CR>/\w<CR>?[A-Z]\\|\(\W\\|_\\|\n\)\@<lt>=[A-Za-z0-9]<CR>v/[A-Z]\\|\([A-Za-z0-9]\)\@<lt>=\(\W\\|_\)<CR>hx:let @/=save_search<CR>i | |
" , moves you to the beginning of the next word or | |
" next capital letter. | |
nmap <silent> , :let save_search=@/<CR>/[A-Z]\\|\(\W\\|_\\|\n\)\@<lt>=[A-Za-z0-9]<CR>:let @/=save_search<CR> | |
" < moves you to the beginning of the current word or | |
" previous capital letter. | |
nmap <silent> < :let save_search=@/<CR>?[A-Z]\\|\(\W\\|_\\|\n\)\@<lt>=[A-Za-z0-9]<CR>:let @/=save_search<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment