Odi's astoundingly incomplete notes
New entries | Codeslow pasting in vim
I often copy text files via SSH by just opening the target file in vim and then pasting the text into the terminal.
So what's going on here? vim is writing to its swap file. Character by character. Dutifully flushing each character out of the buffers. Very good in case you lose power, except that it really slows us down here...
Simple solution: disable vim's swap file with the -n option.
vim -n targetfile
- Ctrl-A Ctrl-C
- ssh targethost
- vim targetfile
- gg (top of file)
- dG (delete to end of file)
- :set paste (no auto indent)
- i (insert)
- Shfit-Ctrl-V
So what's going on here? vim is writing to its swap file. Character by character. Dutifully flushing each character out of the buffers. Very good in case you lose power, except that it really slows us down here...
Simple solution: disable vim's swap file with the -n option.
vim -n targetfile
Add comment