Search code examples
visual-studio-codevim

Vim notation <S-RIGHT>, <S-LEFT>, <C-RIGHT>, <C-LEFT>


I'm trying to understand the notation provided by vim in their documentation regarding something written as or w which is to navigate through word like this https://vimhelp.org/motion.txt.html#%3CS-Right%3E. My conclusion yields that <S> here means shift and <C> is control or command in mac. However, when I try to press shift+right arrow key, it seems to not be working. Can anyone help validate what it is?

Note: I'm running the vim controls in Visual Studio Code in Mac OS


Solution

  • First, Vim is an old and ever-evolving project where:

    • features are added, tweaked, or even removed all the time,
    • different builds may have different features, even when built from a same revision.

    This means that the documentation at https://vimhelp.org/, which is automatically kept up-to-date with the very last revision, is very likely to be irrelevant to your Vim. The single source of truth is always your Vim's documentation, accessible via :help.

    Second, :help provides a link to a comprehensive explanation of its syntax on its very first screen: :help notation, which has all the info you would need:

    […]
    <S-Up>      shift-cursor-up
    <S-Down>    shift-cursor-down
    <S-Left>    shift-cursor-left
    <S-Right>   shift-cursor-right
    <C-Left>    control-cursor-left
    <C-Right>   control-cursor-right
    […]
    

    Including the general meaning of <S- and co.

    Third, and that's the kicker: VSCodeVim is a Vim emulator, not Vim itself, so there is no reason whatsoever to expect anything to work the same—or at all—in one or/and the other. And, quite logically, it means that Vim's documentation is largely irrelevant if you use VSCodeVim, and that, if VSCodeVim had an actual documentation, it would be irrelevant for a Vim user.

    The closest to a documentation they have is this file, where <S-Right> is only mentioned in insert mode, not in normal mode, which is the one you want. With the (lack of) information at hand, we can only be left to assume that VSCodeVim doesn't have normal mode <S-Right>.

    Use their issue tracker next time you have a non-programming question.