2

I try some vim command, and find the gh command will start a new command mode, which shows --select-- in my screan. just like the --visual-- command mode, that this --select-- mode can select some text.

I want know more about this command mode, then I press F1 to show the vim help file in vi.

how can I find the gh command in this help file ?

2 Answers 2

1

In general, to find help for a command in Vim, use the command mode (the one where you type :wq for exiting):

:help gh

You can press Ctrld to show a list of possible completions after typing this,

:he gh
gh                               c_<Right>                        -menuheight                      zip-copyright                    match-highlight                  Vimball-copyright
ghc                              i_<Right>                        :belowright                      'cmdwinheight'                   netrw-copyright                  <ScrollWheelRight>
'ghr'                            c_<C-Right>                      'helpheight'                     'nosplitright'                   'nowinfixheight'                 <C-ScrollWheelRight>
g:ghc                            c_<S-Right>                      'splitright'                     'winfixheight'                   shift-left-right                 <S-ScrollWheelRight>

As you can see, gh is listed, so just press Enter:

                                                        gh
gh                      Start Select mode, characterwise.  This is like "v",
                        but starts Select mode instead of Visual mode.
                        Mnemonic: "get highlighted".
0

Use :h select-mode and you see the description of the select mode. Here an excerpt:

==============================================================================
8. Select mode                                          *Select* *Select-mode*

Select mode looks like Visual mode, but the commands accepted are quite
different.  This resembles the selection mode in Microsoft Windows.
When the 'showmode' option is set, "-- SELECT --" is shown in the last line.

Entering Select mode:
- Using the mouse to select an area, and 'selectmode' contains "mouse".
  'mouse' must also contain a flag for the current mode.
- Using a non-printable movement command, with the Shift key pressed, and
  'selectmode' contains "key".  For example: <S-Left> and <S-End>.  'keymodel'
  must also contain "startsel".
- Using "v", "V" or CTRL-V command, and 'selectmode' contains "cmd".
- Using "gh", "gH" or "g_CTRL-H" command in Normal mode.
- From Visual mode, press CTRL-G.                       *v_CTRL-G*

...
                                                        *gh*

gh                      Start Select mode, characterwise.  This is like "v",
                        but starts Select mode instead of Visual mode.
                        Mnemonic: "get highlighted".
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.