Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigating in Vim's Command Mode

I am a long time emacs user learning Vim. Emacs lets me navigate in the mini-buffer (where I issue commands like C-x C-s) using the same navigation keyboard shortcuts as in any other buffer. For example, I can navigate forward one character using C-f, even while in the mini-buffer. I could also use the arrow keys, but they are too far away.

Is there any keyboard shortcut to navigate in Vim's command mode (:), without using the arrow keys -- equivalent to emacs C-f, C-b? Thanks.

like image 518
Rohit Avatar asked Aug 03 '11 02:08

Rohit


People also ask

How do I go to command line mode?

Then, to open CMD in Windows Setup, simultaneously press the Shift + F10 keys on your keyboard when the installation wizard shows up. This keyboard shortcut opens Command Prompt before boot.

What are the 4 navigation keys in vi?

We can prefix the repeat factor with navigation keys (h, j, k and l). Explanation: The repeat factor can be used as a command prefix with all these four commands.

How do you go to command mode in vim?

To go back to COMMAND mode, you type the esc key. vim starts out in COMMAND mode. Over time, you will likely spend more time in COMMAND mode than INSERT mode. Note that all commands mentioned below (except for arrow keys) only work in COMMAND mode.


2 Answers

Adding to Greg Hewgill's answer, you can use q: to open the command-line window, where you have any Vim editing power at your hand.

like image 143
Boldewyn Avatar answered Sep 19 '22 01:09

Boldewyn


Some from the Vim help:

CTRL-B or <Home>         cursor to beginning of command-line CTRL-E or <End>          cursor to end of command-line CTRL-H               <BS>        Delete the character in front of the cursor (see |:fixdel| if         your <BS> key does not do what you want). <Del>       Delete the character under the cursor (at end of line:         character before the cursor). CTRL-W      Delete the |word| before the cursor.  This depends on the         'iskeyword' option. CTRL-U      Remove all characters between the cursor position and         the beginning of the line.   
like image 23
Jeet Avatar answered Sep 22 '22 01:09

Jeet