I accidentally pressed gh
in normal mode and started a selection, so I looked up the doc and found :h Select-mode
.
From what I understand the select mode is close to the visual mode excepted that:
- Typing a printable character,
<CR>
or<BS>
will delete the selection, start insert mode and replace the selection with the input. hjkl
and other normal or visual mode movement won't extend the selection unless they're prefixed with<Shift>
<CTRL-O>
and<CTRL-G>
will switch to visual mode.- The doc also says the following, which if I understand correctly means that it is possible to do linewise selection which are then treated characterwise:
When using an operator in Select mode, and the selection is linewise, the selected lines are operated upon, but like in characterwise selection. For example, when a whole line is deleted, it can later be pasted halfway a line.
I am a little confused because I don't understand why this mode was created: all I can see is that it is less convenient than visual mode and doesn't provide more features.
Also, the searches that I have made all give results about doing selection in visual mode but do not treat select mode.
So my questions are:
- Why was the select mode created?
- What are its advantage compared to visual mode?
- What is a use case where it is more interesting to use select mode?
MetaNote I have no idea which tag is relevant to this question, feel free to retag if needed.
c
), so depending on what you want to do, select mode could be useful. Pity I keep forgetting about it.c
is a saved keystroke because the selection is not as convenient as in visual mode (since you can't usee
oriw
directly).'selectmode'
containsmouse
and'mouse'
contains a flag for the current mode, selecting with the mouse will start select-mode (according to the doc).