aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2014-11-05 12:18:29 -0500
committerTeddy Wing2014-11-05 12:28:25 -0500
commitc451c1496ebb6f313f43bf204a92c3dd9fd05bee (patch)
tree7173be8eba7db9726ad37960ef8a26fd753e818e
parentcb713087e2074f252776072d8684f93d00aa6dc8 (diff)
downloaddotvim-c451c1496ebb6f313f43bf204a92c3dd9fd05bee.tar.bz2
vimrc: Add command mode mappings for word movement
Never being able to move by word in command mode would always get on my nerves. In particular if I was trying compose a long command. Sure you can bring up a command window but that's not what I think of first when starting to writing a command. Luckily `cmdline.txt` in vim help has the answer! Since Shift-Left/Right doesn't work for me and I'm using Control-Left/Right to move between OS X spaces (not even sure if the Control modifier version works for this either), create bash/emacs-style mappings to move between words in command mode. I'm sorry I didn't find this earlier but it does feel good to have a big annoyance solved.
-rw-r--r--vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index ebc0eaa..544b8eb 100644
--- a/vimrc
+++ b/vimrc
@@ -254,6 +254,10 @@
" * Add <leader>tq to close a window and go to the previous tab. Works
" like <leader>td but doesn't delete the buffer.
"
+" 2014.11.05:
+" * Add command mode mappings to allow movement forward and backward by
+" word. OS X Terminal doesn't handle the Shift & Control mappings.
+"
" Pathogen
@@ -558,6 +562,10 @@ nnoremap <leader>hs $F<i<cr><esc>k0f>a<cr><tab><esc>
" Reload current file (reopen to see changed made outside of vim)
nnoremap <leader>r :edit!<cr>
+" Allow word movement in command mode
+cnoremap <Esc>b <S-Left>
+cnoremap <Esc>f <S-Right>
+
" Commands