Monday, May 25, 2015

Re: Newbie question about mapping...

> Does anyone know how I can prevent the cursor from moving when I go from
> INSERT to normal mode...

That's Vim's usual behavior.

> or revise my mapping so that it works regardless
> of where the cursor is within the word when ctrl-d is pressed?

You can use <C-O> instead of going in full normal mode:

inoremap <C-D> <C-O>gUiw

The problem is that you will end up at the beginning of the word, no
matter where you started. Perhaps that's not a problem?

Best,
Paul

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: