From c451c1496ebb6f313f43bf204a92c3dd9fd05bee Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 5 Nov 2014 12:18:29 -0500 Subject: 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. --- vimrc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index ebc0eaa..544b8eb 100644 --- a/vimrc +++ b/vimrc @@ -254,6 +254,10 @@ " * Add tq to close a window and go to the previous tab. Works " like 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 hs $Fk0f>a " Reload current file (reopen to see changed made outside of vim) nnoremap r :edit! +" Allow word movement in command mode +cnoremap b +cnoremap f + " Commands -- cgit v1.2.3