Sure, but who does that?
In any text editor on the Mac its:
- Command-Left to move to the beginning of the line
- Shift-Command-Right to select to the end of the line
- Command-C to copy
- Command-V to paste
One annoying thing about that, though, is that it doesn't copy the newline itself, so if you want to paste the line and the line terminator multiple times, you need to do something more like: - Command-Left to move to the beginning of the line
- Shift-Command-Right to select to the end of the line
- Shift-Right to select the newline
- Command-C to copy
- Command-V to paste
But, of course, most full-featured text editors make that easier. In Sublime and Atom, it's: - Command-L to select the current line
- Command-C to copy
- Command-V to paste - [2] Command-Left to move to the beginning of the line
- [3] Shift-Command-Right to select to the end of the line
- [2] Command-C to copy
- [2] Command-V to paste
Total keypresses: 9Total keypresses for yyp: 3 (4 if you have to esc to normal mode first)
My point being that even the simple and straightforward actions you provided are more complex than they seem.
Secondly, that's just using the minimal set of shortcuts that work anywhere. If you're in an actual editor, it almost certainly has a shortcut like Ctrl-Shift-D for duplicate line.
And I think a lot of vim users might be surprised how simple and straightforward things can be in a modern editor.
Similarly, if I want to change them or delete them the y becomes a c or d.
works with ( and { and ' as well. also, ```ca"``` will do the same but include the " in the change. (change around the ")
not sure if it's built into the stock vim but ```cit``` will do a change inner tag for html and xml tags too.
Neat, I didn't know that - thanks for the tip!
e.g. in Sublime:
>if I want to duplicate a line
Ctrl-Shift-D
>If I want to change the contents of a quoted string
Ctrl-Shift-M selects inside parens. It doesn't do quotes by default, but there might be a way to enable that.
EDIT: I looked this up afterwards, and discovered Ctrl-Shift-Space selects a quoted (or parened) block, although it includes the quotes.
>If I want to change each line from the current line to the next blank line to a continuous quoted string
Okay, this seems a bit contrived, and I'm not convinced the average vim user would bother with this rather than just doing something like I"<Esc>}kA" or whatever.
Unless you're bulk editing, in which case I think Sublime's regex find and replace would be similarly effective, and probably easier to get right than typing the whole command in one.
I will note however that selecting text and pressing a paren key wraps it in parens, and as above it might be possible to make that work for quotes.
I know, I'm talking about milliseconds (or nanoseconds) here, but when I use vi, it's just, sort of "constant", like playing the piano. I never break my rhythm.