On Fri, Oct 1, 2010 at 4:18 PM, sc <tooth...@swbell.net> wrote:
> On Friday 01 October 2010 14:44:31 Ven Tadipatri wrote:
>
>
> i have several lines relating to them in my .vimrc:
>
> nmap <S-Insert> "+gP
> vmap <S-Insert> "-d"+P
> imap <S-Insert> <C-O>:set paste<CR><C-R>+\|<C-O>:set nopaste<CR>
> cmap <S-Insert> <C-R>+
> imap <C-Insert> <C-O>"+y
> vmap <C-Insert> "+y
> vmap <S-Del> "+d
> imap <C-Del> <C-O>daw

Unfortunately I haven't come across a system yet where the + buffers
were enabled. That's why I had to jump through all these hoops with
/dev/clipboard with Cygwin, and xclip on the Linux machines that used
X11.

So here's the latest attempt at pasting:

For Cygwin:
nmap <C-v> iz<Esc>mz:execute "normal a".system("cat /dev/clipboard")[:-2]<CR>`zx

For Linux:
nmap <C-v> iz<Esc>mz:execute "normal a".system("xclip -o")[:-2]<CR>`zx

or map it to the Middle Mouse:
map <MiddleMouse> iz<Esc>mz:execute "normal a".system("xclip -o")[:-2]<CR>`zx


Apparently when I execute a command, it puts it on the next line, but
this "normal a".system, passing it a system command pasted it right
where I want.  Well, almost, because if I pasted it at the beginning
of the line, it pasted *after* the first character, which was
annoying. So I did another hack using marks to paste.

Ctrl+insert is a good idea if you don't want to overwrite the ctrl+v,
which is used to print out an escape character. That's why I was made
the key mappings for normal mode only, not visual or command mode.

Thanks,
Ven

>
> and lately, if i want to quit an app i am copying from before
> i paste i make sure and start klipper beforehand
>
> sc
>

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to