I am new to Vim, however I am learning to love it. As a former/current Windows user, there is one shortcut that I depend on and would like to configure in Vim.
On windows I can use ctrl-arrow left and ctrl-arrow right to skip over words left and right.
I just don't want to press the over arrow a bunch of times when moving any text within the editor. It can be really handy to just right over four words by pressing the arrow four times (with control held down).
Example of functionality I want
Let's say my cursor is represented by a pipe: |
Sample text:
The brown |fox jumped over the lazy dog. " before pressing ctrl-[right arrow]
The brown fox |jumped over the lazy dog. " after pressing ctrl-[right arrow]
- Has anybody else had similar interests?
- Is there an easy way to get identical/similar functionality?
- Any help would be much appreciated!
- Sorry if I messed up any terminology (let me know and I will update anything that needs fixing).
Update: Thanks for the responses. It's good to know that this is possible with w and b. I will settle for that if needed, however I would like to attempt this anyways for the sake of learning from the exercise, as well as for future vim users attempting this.
- I am currently using Bash on Ubuntu 14.04 server running in VirtualBox on Windows 10.
I edited my vimrc (found in
/etc/vim/vimrc
) to show this at the end of the fileexecute "set <xUp>=\e[1;*A" execute "set <xDown>=\e[1;*B" execute "set <xRight>=\e[1;*C" execute "set <xLeft>=\e[1;*D"
w
,b
, and some related motions. By default this is actually mapped to<C-Left>
and<S-Left>
already..vimrc
(~/.vimrc) so you don't need root if you want to copy your mappings to another computer.