I don't understand pasting in Vim
I have Vim configured to paste external text (i.e. text copied from an external source, not inside Vim) in two manners: Ctrl+v and Ctrl+Shift+v.
The former used to paste text subject to autocorrect action; the latter didn't. I don't know exactly how I did it. I found this in my .vimrc: Code:
" Pasting blockwise and linewise selections is not possible in Insert and But I remember I changed something one day and neither key combination now is affected by autocorrect. They have the exact same effect... or almost. The only difference between them now is that there is some limit to the amount of text I can paste with Ctrl+v. If I go above that limit, something else is pasted. Something I copied elsewhere some time ago, often hours ago and I don't know how or why it is still hanging somewhere. Ctrl+Shift+v doesn't seem to have any limit. It seems to have infinite capacity. I have pasted hundreds of MB of text and it works. My questions today are: - Why is there such a limit? Why do the two actions work so differently? - Where is the Ctrl+Shift+v action configured? - How can I improve my handling of copy/pasting from/into Vim, in case you have a better idea? TIA |
I gave up farting about totally with vim. It's a bit like the lost chord - you get it out once and never find it again. Use Nano. No sweat with the middle mouse button.
|
I have never managed to paste into vim with CTRL-v; I always use CTRL-SHIFT-v. I just tested CTRL-v on Debian Testing; did not paste.
I think the question that should be asked is "why am I able to paste with CTRL-v?" I used to find vim frustrating, then I realized I was approaching it wrong. I was trying to learn too much at once. I concentrated on becoming proficient with a few basic commands (x, i, o, y, p, dd, x, and / mainly) and am now quite comfortable using vim with the kinds of text files that I need to edit. |
Quote:
Also, it might be worth it for you to create your own .vimrc. That way when you come across some functionality you would like to have, you can learn about it, add it to your .vimrc, and that way you know what every line of your .vimrc does. Just an idea. That's how I like to do things :) |
I think the .vimrc suggestion is an excellent one. I used to have one on this computer until I had to reinstall:(.
It didn't do much. Mostly it turned on line numbering and a few other odds and ends. A web search for "vimrc" will turn up a number of excellent articles and examples. I should have a copy somewhere. If I can find it, I'll post it tomorrow. I've made a note . . . . |
You could start here https://www.vim.org/ :)
|
Quote:
Quote:
Quote:
|
I would try simply :r file and that will insert the content. Or you can open several files within vim and yank/put will work among those files. You do not need to complicate it. Originally vi was not meant to handle [external] copy&paste buffers.
|
As promised, here's a .vimrc from one of my machines:
Code:
$ cat .vimrc |
All times are GMT -5. The time now is 07:51 PM. |