History Report a problem
Article Edit this page Discussion

Command-line window

From Vim Tips Wiki

Jump to: navigation, search

Tip 928 Previous TipNext Tip

Created: May 11, 2005 Complexity: basic Author: Wim Coenen Minimum version: 5.7 Karma: 272/90 Imported from: Tip#928


When you hit : to enter a command, or / to start a search, you often want to edit a previous command or search. That can be done using the up and down arrow keys to scroll through the history. Then you can edit a previous line – see :help :.

A superior solution is q: or q/ which gives you a command or search editing window with all Vim's normal editing power.

Related to this is the 'cedit' key, which defaults to <C-F> – see :help 'cedit'. While on the command/search line, you can use the key specified with the 'cedit' option to switch to the command editing window.

You might consider

:set cedit=<Esc>

so you can press Esc to go to the command/search window from the command/search line.

If you always want to use the command editing window, you may experiment with mappings like:

:nmap : q:i
:nmap / q/i
:nmap ? q?i

Use <Ctrl-C><Ctrl-C> to cancel a search started with the above mapping.

[edit] References

[edit] Comments


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pushing Daisies
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Godzilla
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Command-line window"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation


.