Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to queue commands in Vim?

Tags:

vim

vi

Is it possible to queue up commands? For example, (this is extremely contrived), could I type something like:

:vsp, q

To open a vertical split and then quit it immediately?

like image 970
David Tuite Avatar asked Mar 02 '12 11:03

David Tuite


People also ask

What does GG mean in vim?

gg | G. These commands let you move around the entire file. gg will move you to the first line in the file, and G will move you to the last line in the file. Alternatively, if you type nG where n is a number, you'll jump to that to that line.

How do I use command F in vim?

If you press "F", Vim will move the cursor backwards instead of forward. Given the previous sentence, if pressed "Fq", and the cursor was at the end of the line, it would move to the "q" in "quick".

What does DW do in vim?

dw will delete from cursor to beginning of next word, so will not delete the entire current word under the cursor unless the cursor happens to be at the beginning of the word. So bdw will delete the whole word and the space(s) after it (unless the cursor is already at the beginning of the word).

What is vim commands?

It can be used to edit all kinds of plain text. It is especially useful for editing programs. There are a lot of enhancements above Vi: multi level undo, multi windows and buffers, syntax highlighting, command line editing, filename completion, on-line help, visual selection, etc..


2 Answers

You can execute more than one command by placing a | between two commands.

For example:

%s/htm/html/c | %s/JPEG/jpg/c | %s/GIF/gif/c

Source: vim wiki

like image 87
DonCallisto Avatar answered Sep 21 '22 19:09

DonCallisto


You can, use a | between the commands.

like image 24
hochl Avatar answered Sep 21 '22 19:09

hochl