Monday, October 24, 2016

Re: Load one key- map

On Mon, Oct 24, 2016 at 6:25 PM, Guido Milanese
<guido.milanese@gmail.com> wrote:
> Perfect, thank you. I think that using "-c" for short commands and a file for long sequences is a very wise choice.
> An additional question: how could I unmap the keys leaving the vim session without asking my user to unmap the keys manually? Could I run again vim "silently" from my bash script unloading the mapping? For example:
>
> vim -c "MAP KEY"
> # the user works in vim; after he leaves,
> vim -c "UNMAP KEY"
>
> As usual, a great program and a generous group.
>
> guido (italy)

After the user leaves (closes) Vim, the keys aren't mapped anymore.
Starting Vim without the appropriate -c or -S command-line switch will
simply not load it.

If you want a mapping to be loaded every time a user starts Vim, it is
possible too, but then you should create a global plugin or (if the
mapping is defined with <buffer>, to be used only for one filetype) a
filetype-plugin.

See
:help 'runtimepath', and in particular
:help after-directory
:help write-plugin
:help add-global-plugin
:help add-filetype-plugin

This is of course for mappings you want to distribute. Your private
ones you can of course just write into your vimrc.

Best regards,
Tony.

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

Post a Comment