Michael Henry wrote:
> I'd like to advocate the deprecation of the use of :vmap command
> in most places it is currently being used, for the following reasons.
>
> Lately I've been running into problems caused by the use of
> :vmap in plugins. Despite the 'v' in the name, :vmap is not
> just for Visual-mode mapping; instead, it creates a mapping for
> both Visual and Select modes. This leads to unintended
> interference with Select mode's defined behavior, which is
> especially noticeable with "snippets" plugins (such as
> UltiSnips) that use select mode extensively.
>
> Select mode is intended to resemble the selection mode in
> Microsoft Windows (according to :help Select-mode). In Select
> mode, typing a printable character deletes the selection and
> enters insert mode. To retain this expected behavior, select
> mode mappings of all printable characters must be avoided;
> unfortunately, such mappings are fairly commonly found in
> plugins today due to their use of :vmap instead of :xmap.
>
> In my opinion, :vmap should be replaced in almost every case
> with :xmap to avoid the unintended Select-mode mappings. Only
> certain non-printable mappings make sense for both Visual and
> Select modes, such as mappings for clipboard operations (cut,
> copy, and paste).
>
> Though the Vim help states that :vmap applies to both Visual and
> Select modes, there is nothing in the documentation that points
> out the negative effects of using :vmap, nor does it recommend
> the use of :xmap as a "best practice". I propose that we modify
> the Vim documentation and Wiki[1] to clearly steer users toward
> :xmap and away from :vmap, and that we put out a call to plugin
> authors to remove any undesirable Select-mode mappings. I'm
> looking for general agreement with this idea before I create any
> documentation patches or Wiki updates.
Did you read :help Select-mode-mapping ?
When a :vmap is used in Select mode Vim temporarily switches
to Visual mode. Quite often this works as expected.
Thus :vmap isn't that bad.
--
ARTHUR: Well, it doesn't matter. Will you go and tell your master that
Arthur from the Court of Camelot is here.
GUARD #1: Listen, in order to maintain air-speed velocity, a swallow
needs to beat its wings 43 times every second, right?
ARTHUR: Please!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---