Friday, July 16, 2010

Re: Cursor position insert mode

> col(".") works ok, but you must stay in Insert mode when checking it.

Thank you very much for pointing this out! This was indeed the error.

Now, I was able to finally get VIM to paste the clipboard as I like it,
pasting always at the cursor position, and leaving always the cursor
after the pasted content:


function! MyPaste()
if col(".") == col("$")
execute "normal \"+gp"
call setpos(".", [0, line("."), col("$"), 0])
else
execute "normal \"+gP"
endif
return ""
endfunction


Might be not the best VIM coding style, it's my first VIM function.

Thanks!
MD.

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