. . . if you forget which commands deal with windows, just type @b[ESC-?]@t[window]@b[ESC].
This weird command is presented with such a benevolent innocence as if it's the simplest thing in the world.I think the better advice for command-line editing would be to set up the mouse.
The general form of `b` is `[count]b` where
[count] An optional number that may precede the command to multiply
or iterate the command. If no number is given, a count of one
is used, unless otherwise noted. Note that in this manual the
[count] is not mentioned in the description of the command,
but only in the explanation. This was done to make the
commands easier to look up. If the 'showcmd' option is on,
the (partially) entered count is shown at the bottom of the
window. You can use <Del> to erase the last digit (|N<Del>|).
b [count] words backward. |exclusive| motion.
https://vimdoc.sourceforge.net/htmldoc/intro.html#[count]https://vimdoc.sourceforge.net/htmldoc/motion.html#b
For `c` it’s
["x]c{motion} Delete {motion} text [into register x] and start
insert. When 'cpoptions' includes the 'E' flag and
there is no text to delete (e.g., with "cTx" when the
cursor is just after an 'x'), an error occurs and
insert mode does not start (this is Vi compatible).
When 'cpoptions' does not include the 'E' flag, the
"c" command always starts insert mode, even if there
is no text to delete.
{motion} A command that moves the cursor. These are explained in
|motion.txt|. Examples:
w to start of next word
b to begin of current word
4j four lines down
/The<CR> to next occurrence of "The"
https://vimdoc.sourceforge.net/htmldoc/change.html#cI do prefer vi bindings at the same time though. Vi bindings and mouse support complement each other well, you don't have to choose one or the other, just use whichever feels most natural and convenient in that exact moment.
I think it's a question of context and familiarity. To a vim user, like me and, I assume, ahmedfromtunis, their examples do indeed seem simple and natural. Presumably, to an emacs user, the example you quote (if it's quoted literally—I don't use emacs and can't even tell) is just as natural, and assuming some comfort with emacs is presumably OK in a manual for the software!
How do you get familiar with the software, if the manual expects you to be an expert in it already?
edit: And of course, CTRL+R, the best time saver of all
I WANT to love it - and if I was only ever working on one, or a small number of systems that I was the only one working on I’d probably do it. I’m ALL about customizing my environment.
However ssh into various servers through the day (some of which are totally ephemeral), and having to code switch my brain back and forth between vim mode and emacs mode in the shell would just slow me down and be infuriating each time I connect to a new box.
A mistake 3 words earlier?
meta-bbbd (not as elegant, I admit)
delete the whole thing?
ctrl-ak (this is even quicker than vim, especially if capslock is mapped to ctrl)
the control-based emacs movements work system-wide on macos btw. I am using ctrl-p and ctrl-n to go up and down lines, ctrl-a and ctrl-e to go to beginning and end of lines while writing this comment in by browser (which has vimium extension)
Sometimes I wish vim just had full emacs bindings while in insert mode. But I don't like to mess with defaults too much.
I keep thinking I should give vim readline a try though, so maybe today. Thanks for the comment.
Doing control+o in insert mode temporarily places you into normal mode so that you can execute one normal-mode command, and then go back to insert mode again--no need to hit 'i' again.
So, instead of '<esc>cc', '<c-o>S'.
The one you suggest however requires 4 strokes (ctrl then o then shift then s), 4 keys (ctrl, o, shift, s) and 2 combinations.
The "cc" sequence deletes the line and switches automatically to insert mode. To forgo the switch, the sequence then becomes "dd".
<esc>S
Esc exits insert mode (of course) and capital S erases the line and puts you in insert mode at column 0 (just like in (n)vim, right?).
Like I said, maybe I configured that? But 'S' is standard vim-stuff... (I'm not able to double check my config at the moment).
[Edit: right after hitting submit I realized that my way is perhaps "arguably" simpler because I do have to hit shift to get capital S. So I'm also hitting three keys...]
I really need to get around to playing with it more. I just hope that especially now with genAI that it's not too late for learning it further.
<esc>3bcw
What is your keyboard layout? This looks like a crime against humanity on a regular qwerty kb.If I hit CTRL + ARROW_LEFT 3 times, I am done a lot faster I guess. But I am open to learn, do people really use that and achieve the goal significantly faster?
Many people these days, including yours truly, have caps-lock mapped to ctrl if held or esc if tapped. That’s good ergonomics and worth considering for any tech-savvy person.
Instead of the 3b I would type bbb (because I agree with you that typing numerals is a pain).
So (caps lock)bbbcw isn’t bad. It’s better than it looks, because if you’re a vim user then it’s just so automatic. “cw” feels like one atomic thing, not two keypresses.
And importantly, it doesn’t involve any chords.
Your Problem with vim is you don't grok vi
https://stackoverflow.com/questions/1218390/what-is-your-mos...