5 ms·
Does anyone actually use select mode?
by anon9001 5y ago
Does anyone actually use select mode?
- walty8 5y agoyes, it's useful to comment out a bunch of lines.
- chrismorgan 5y agoI’m pretty sure you’re talking about visual mode, not select mode.
- nick0garvey 5y agoYes. I use normal select when: - I want to apply a regex to a specific area, e.g. a single function (vjjjjj:s/my_function/my_new_function/g<enter>) - I want to cut some text and I don't want to count how many words out it is (vwwwwx) I use block select when: - I want to delete a section of fixed width formatted text (Vjjjlllx). Useful for manipulating logs with a fixed width prefix. - I want to append text to the start of a line. (VjjjjjjI# <esc>). Useful for commenting out lines.
- CGamesPlay 5y agoYou're actually talking about visual and visual block (although V is visual line and <C-V> is visual block in your examples). Select is a weird mode where typing will overwrite your selection, similar to how it works in a modeless editor like notepad or the HTML textarea.
- nick0garvey 5y agoHuh, TIL. I'm amazed I've been using Vim for this long and there are entire modes I didn't know.
- dpacmittal 5y agoYou're talking about visual mode, select mode is entered by pressing gh in normal mode.
- thewakalix 5y agoSelect mode is actually exactly what I was looking for a few days ago. I had a visual block selected and wanted to replace it, but all I know how to do was delete, reselect, and add.
- strogonoff 5y agoI usually hit “c” in visual block mode, and re-type. How does select mode work by comparison?
- Liquid_Fire 5y agoIn select mode, you just start typing as if you had already pressed c. It works similar to text selections in Windows.
- tremon 5y agoBut to get to Select mode in the first place, you need a key sequence that seems longer than the direct route: - select from block requires Ctrl-G and then start typing, but c or s is more direct - select character uses gh, but c is more direct - select line uses gH, but C is more direct In what circumstances would Select mode be more direct than to go from Visual to Insert, or from Normal to Insert?
- Liquid_Fire 5y agoIn Windows builds of Vim, mouse selections default to Select mode rather than Visual mode. I think that's probably the only reason it was added, and I doubt anyone enters Select mode "manually".
- chrismorgan 5y agoIf I recall correctly, it’s more or less enabled by default in gVim on Windows for mouse selection (see ':behave'). I’ve never seen anyone deliberately invoke it, and I’ve definitely seen people avoid that behaviour on Windows. I would definitely consider it a misfeature, given how it complicates things, muddying modes when invoked, and when a simple c or s from any visual mode has roughly the same effect.
- mFixman 5y agoI use it every once in a while to truncate aligned text in tables. It's not very useful, but I'm glad it's there. The big question for me is whether anyone knew of virtual select mode, enabled by `gR`. It's like select mode except that it replaces screen state instead of characters, so pressing `<Tab>` will replace `tabstop` characters instead of just one.