Friday, May 28, 2010

RE: Mapping the Super / Windows key

LuKreme wrote:
>>> if !has("gui_macvim")
>>> vnoremap <C-X> "+x
>>> vnoremap <C-C> "+y
>>> imap <C-V> "+gP
>>> cmap <C-V> <C-R>+
>>>
>>> " Pasting blockwise and linewise selections is not possible in
>>> Insert and " Visual mode without the +virtualedit feature.
>>> They are pasted as if they " were characterwise instead.
>>> " Uses the paste.vim autoload script.
>>>
>>> exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
>>> exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
>>>
>>> " Use CTRL-Q to do what CTRL-V used to do
>>> noremap <C-Q> <C-V>
>>> endif
>
> Someone want to explain to me what this means (syntax-wise)?

It's too complex to explain! However if you are really keen, put
the cursor on the following line and type gf to open the file:
$VIMRUNTIME/autoload/paste.vim

Read :help autoload when you have a spare couple of hours.

In the above, I don't know if this line:
>>> imap <C-V> "+gP
is supposed to work (it looks like something is missing, but
mainly it is redundant due to what follows).

I'm pretty sure the following line should be removed as
pointless since (I think) all Vims will take Ctrl-Q instead of
Ctrl-V for some time (except for those terminals where Ctrl-Q is
XON).
>>> noremap <C-Q> <C-V>

I use the following:

" Select all, cut, copy, paste
nnoremap <C-A> ggVG
vnoremap <C-X> "+x
vnoremap <C-C> "+y
nnoremap <C-V> "+gP
cnoremap <C-V> <C-R>+
exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']

John

--
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

No comments:

Post a Comment