October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 64 | Interact with the System Clipboard |
Besides Vim’s built-in put commands, we can sometimes use the system paste command. However, using this can occasionally produce unexpected results when running Vim inside a terminal. We can avoid these issues by enabling the ‘paste’ option before using the system paste command.
This tip is only applicable when running Vim inside the terminal, so you can safely skip it if you always use GVim. We’ll start by launching Vim in the terminal:
| => | $ vim -u NONE -N |
Enabling the ‘autoindent’ setting is a sure way to induce strange effects when pasting from the system clipboard:
| => | :set autoindent |
Finally, we’ll need to copy the following code into the system clipboard. Copying code listings ...