mappings for "insert mode " and other mapping for "overwrite mode"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mappings for "insert mode " and other mapping for "overwrite mode"

Jeri Raye
Hi,

Is it possible to make different mappings based on "insert mode" or
"overwrite mode"

Meaning with insert-mode the cursor is a vertical stripe in between chars.
With overwrite-mode the cursor is horizontal stripe below the char.

Rgds
Jeri

--
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 | Threaded
Open this post in threaded view
|

Re: mappings for "insert mode " and other mapping for "overwrite mode"

Nikolay Aleksandrovich Pavlov
Reply to message «mappings for "insert mode " and other mapping for "overwrite
mode"»,
sent 21:48:46 22 October 2010, Friday
by Jeri Raye:

> "overwrite mode"
It is named ``replace mode'', not ``overwrite mode'' if I understood you
correctly.

> Is it possible to make different mappings based on "insert mode" or
> "overwrite mode"
You can use v:insertmode variable with expression mapping: pretending that you
want to map «,» to «, » in insert mode and leave it as-is in replace mode:
    inoremap <expr> , ((v:insertmode==#'i')?(", "):(","))
See ``:h v:insertmode'' for more details.

> Meaning with insert-mode the cursor is a vertical stripe in between chars.
> With overwrite-mode the cursor is horizontal stripe below the char.
I am a console vim user, so this does not say anything to me. Assuming that it
is a ``replace mode''.

signature.asc (205 bytes) Download Attachment