Home » Questions » Computers [ Ask a new question ]

How to paste from multiple clipboards vim without leaving insert mode?

How to paste from multiple clipboards vim without leaving insert mode?

Suppose you are typing in vim and there are 5 common expressions that you need to insert into the text over and over.

Asked by: Guest | Views: 335
Total answers/comments: 2
bert [Entry]

"ctrl-r follwed by the register lets you paste the contents of a register without leaving insert mode.

Ctrl + r"" Put from the default register

Ctrl + rd Put from register d

By the way, in vim they're called ""registers"" not ""clipboards"" and the verb is ""put"", not ""paste"". (Reminder, to get a visual selection into register d, you would use ""dy)"
bert [Entry]

If its always the same expressions, e.g. in java programming things like "private static void main(String... args)" you can use a plugin like snipmate. You can configure it so you can just type "main<Tab>" and it will exapnd to the long java code needed, and it has more cool features...