All, 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. Thanks, Michael Henry [1]: http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_%28Part_1%29 --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
