4 ms·
> How do you split if ctrl+w is cut word instead? Before I tell you how, I want to tell you the 2 reasons why I don't like splitting with Ctrl-W: 1) because I
by csdvrx 3y ago
> How do you split if ctrl+w is cut word instead?
Before I tell you how, I want to tell you the 2 reasons why I don't like splitting with Ctrl-W: 1) because I think Ctrl-W should the same thing as on readline or emacs 2) because even if existing uses of Ctrl-W were removed from the picture, splitting with Ctrl-W use 3 keys. Why use 3 keys when you can use 2?
I like short sequences, and chording, and there are many 2 keys sequences that are free to use if you know where to look for: I prefer to use what can only be done with MOK sequences, because these sequences are more likely to have a degree of redundancy.
For example, Ctrl-I duplicates Tab: if you use a MOK you can have Tab do something (indent) while Ctrl-I does something else (jump in the edit history). Ctrl-I is "free to use" without limiting function, because keyboards generally have a Tab key. These are "sensible defaults", because most people do that in other editors.
My splits are mapped to MOK sequences (Ctrl-; Ctrl-' Ctrl-\ Ctrl-/ Ctrl-`) but I've thought it may not be a good idea because 1) it's more unusual and 2) I rarely use split in vim so I don't think I can make an educated choice besides having Ctrl-T start a new tab (like it does on a browser), so I've left them out: I've just left the "echo" part.
If splitting is important to you, and you want to try out these MOKs, search for "echomsg.*was hit" and bind your windows split around line 256. I would like to know what you think of these. I may trust your judgement more than mine, if only because I don't use splits much in vim.
If you think these MOKs does the job for you, and if you think splits are important, let me know and I'll add the split mappings to the defaults for the next release (EOY, it may include a CuteBash)
- doix 3y agoI'll be honest, I just took a bit of offence to the "sensible defaults" wording. I think there probably are some things you can do in vim that the vast majority would agree with. But I think you've gone a wee bit too far into just making it your preferences. I totally get your logic by the way, I'm just not convinced it's strong enough to be considered a "sensible default" ;). You're not wrong that it's 3 keys instead of 2, but I find it makes sense. Ctrl-w puts you in (w)indow management mode and then you split (v)ertically or (h)orizontally. I don't split often enough that it matters. I do remap ctrl-w+h/j/k/l to just ctrl+h/j/k/l since I do move around in my splits that saving a keypress does matter. > My splits are mapped to MOK sequences (Ctrl-; Ctrl-' Ctrl-\ Ctrl-/ Ctrl-`) They make no sense to me. I have no idea what any of those key combos do. FWIW, I see you said that it was a bit of a joke in another comment. Maybe I'm just grumpy because I'm sick during the holiday season :(. Also for what it's worth, the general idea is super cool. I love seeing all the cool things cosmo enables
- csdvrx 3y ago> I'll be honest, I just took a bit of offence to the "sensible defaults" wording. Then I have to apologize for the bad joke. I wanted to show cute and inspiring things, that would make people smile during the holidays, not offend people with bad jokes. > They make no sense to me. I have no idea what any of those key combos do. It's made to evoke what the result will look like, based on the characters on the keys (like ; is a thing above the other, so it evokes vertical split) However, I feel Ctrl-T should be the default to create tabs (since that's how anyone does in the browser, while Ctrl-Shift-T reopens) so I'm not sure about how to mix and match all that (+ my lack of use of vim splits) to select defaults that'll give a great experience. > Maybe I'm just grumpy because I'm sick during the holiday season :(. Then get better and let's talk about shortcuts later! Someone who likes window splitting and care about vim shortcuts in vim could help a lot!
- laktak 3y ago> 1) because I think Ctrl-W should the same thing as on readline or emacs OK, but as a vim user you would switch readline to vim mode and never look back ;)