Apple-k, Apple-K for underscores and dashes

This commit is contained in:
yan 2011-11-30 01:14:39 -08:00
parent 0fcd53f289
commit 21b60db381
2 changed files with 24 additions and 12 deletions

View File

@ -72,7 +72,10 @@ These are things I use every day to be insanely productive. Hope you like em.
* Ctrl-\ - Show NerdTree (project finder) and expose current file
* cf - Copy Filename of current file into system (not vi) paste buffer
* // - clear the search
* ,, - use EasyMotion - type that and then type one of the highlighted letters. I'm just exploring this one.
* ,, or z,, - use EasyMotion - type that and then type one of the highlighted letters. I'm just exploring this one.
* Apple-k and Apple-K to type underscores and dashes, since they are so common in code but so far away from home row
* yw - remapped to yaw, meaning yanking a word will yank the entire word no matter where your cursor is
* W - write a file (instead of :w, saving you keystrokes for the most common vim operation)
Setup for Git
---

31
vimrc
View File

@ -250,7 +250,7 @@ imap <silent> <C-K> <%= %><Esc>3hi
" create <%= foo %> erb tags using Ctrl-j in edit mode
imap <silent> <C-J> <% %><Esc>2hi
imap <silent> <C-;> _
" hit \t to run current test
nmap <silent> <Leader>t :RunRubyFocusedContext<CR>
@ -357,6 +357,8 @@ nmap <silent> // :nohlsearch<CR>
" Use EasyMotion by double tapping comma
nmap <silent> ,, \\w
" Use EasyMotion backwards by z,,
nmap <silent> z,, \\b
" User LustyJuggler buffer switcher by hitting S
" and then using the homerow keys to select the file
@ -384,13 +386,20 @@ nnoremap W :w<CR>
nnoremap yw yaw
call EasyMotion#InitOptions({
\ 'leader_key' : '<Leader><Leader>'
\ , 'keys' : 'abcdefghijklmnopqrstuvwxyz'
\ , 'do_shade' : 1
\ , 'do_mapping' : 1
\ , 'grouping' : 1
\
\ , 'hl_group_target' : 'EasyMotionTarget'
\ , 'hl_group_shade' : 'EasyMotionShade'
\ })
" in code, undescores and dashes are very commmon, but
" the key is really far away. remap Apple-k to give us
" underscores and Apple-Shift-K to give dashes.
" home row for the win!
imap <silent> <D-k> _
imap <silent> <D-K> -
call EasyMotion#InitOptions({
\ 'leader_key' : '<Leader><Leader>'
\ , 'keys' : 'abcdefghijklmnopqrstuvwxyz'
\ , 'do_shade' : 1
\ , 'do_mapping' : 1
\ , 'grouping' : 1
\
\ , 'hl_group_target' : 'EasyMotionTarget'
\ , 'hl_group_shade' : 'EasyMotionShade'
\ })