I got really excited about one discovery, so I'd like to start a discussion and see if there is a possible fit into vim's feature roadmap.
So, apparently all modern terminals have a feature to tell programs when something is pasted.
Terminal does this by wrapping the paste content with sequences \e[200~ and \e[201~.
Because of this, terminal programs (specifically vim) *could* tell a difference when something is typed vs pasted.
This is nicely explained in the blog article here: http://cirw.in/blog/bracketed-paste
And this is not just theory - the same guy wrote a small plugin that enables this for vim, link: https://github.com/ConradIrwin/vim-bracketed-paste (it's less than 30 lines of viml)
I tried the plugin and it works great! (I'm on OS X, Terminal.app)
The punch line is: as a terminal vim user, I don't have to use `:set paste` ever again!
Now, what do you think: does this feature belong in the "plugin domain" or should it eventually be part of vim?
I'm just a user, so I couldn't help with any of that, but I like the feature so much - maybe my enthusiasm will infect someone else! :)
Bruno
Hi Bram,
glad you think it's useful.
So I just googled it:
it turns out this is available in xterm for years. Here's the blog post from 2009 showing how to make it work with vim and xterm:
http://help.lockergnome.com/linux/Bug-504244-Vim-script-turn-xterm-bracketed-paste-mode--ftopict511918.html
I found other online resources mentioning this in 2010, 2011. But the above link is the earliest.
About screen - here's the patch from March 2013, so I guess it's been added there just recently:
https://lists.gnu.org/archive/html/screen-devel/2013-03/msg00000.html