From 21b60db381b81ad742025085c472457d917ffb75 Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 30 Nov 2011 01:14:39 -0800 Subject: [PATCH] Apple-k, Apple-K for underscores and dashes --- README.md | 5 ++++- vimrc | 31 ++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2678267..8bd1257 100644 --- a/README.md +++ b/README.md @@ -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 --- diff --git a/vimrc b/vimrc index b3c5056..59b64c0 100644 --- a/vimrc +++ b/vimrc @@ -250,7 +250,7 @@ imap <%= %>3hi " create <%= foo %> erb tags using Ctrl-j in edit mode imap <% %>2hi -imap _ + " hit \t to run current test nmap t :RunRubyFocusedContext @@ -357,6 +357,8 @@ nmap // :nohlsearch " Use EasyMotion by double tapping comma nmap ,, \\w +" Use EasyMotion backwards by z,, +nmap 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 nnoremap yw yaw - call EasyMotion#InitOptions({ - \ 'leader_key' : '' - \ , '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 _ +imap - + +call EasyMotion#InitOptions({ +\ 'leader_key' : '' +\ , 'keys' : 'abcdefghijklmnopqrstuvwxyz' +\ , 'do_shade' : 1 +\ , 'do_mapping' : 1 +\ , 'grouping' : 1 +\ +\ , 'hl_group_target' : 'EasyMotionTarget' +\ , 'hl_group_shade' : 'EasyMotionShade' +\ })