2 ms·
It's not that you "can't" do certain things in Sublime. But Sublime and other "normal" editors have only a few primitives in terms of editing and moving, wherea
by twh270 6y ago
It's not that you "can't" do certain things in Sublime. But Sublime and other "normal" editors have only a few primitives in terms of editing and moving, whereas vim has a language that lets you compose more complex commands from a set of primitives.
The general form of a vim command is:
(repeat)(verb)(motion/object)
That is, I want to perform 'verb' 'repeat' times on a 'motion' or 'object'. Examples:
fX == 'f'ind the next occurrence of character 'X'
3fX == repeat 'fX' 3 times
w == go to the next word on the line
3w == repeat 'w' 3 times, i.e. go 3 words right
dw == delete word
3dw == delete 3 words
dfs == delete to the next occurrence of 's'
yw == "yank" (copy to the buffer) the next word
y3w == yank the next 3 words to the buffer
H, M, L == move the cursor to the top, middle, or bottom of the screen
zz == center the current line of text in the editor window.
8j == move the cursor 8 lines down
ma == create a bookmark 'a'
`a == go to bookmark 'a'
"ay == yank to buffer 'a'
"ap == paste buffer 'a'
. == repeat the last editing command (insert, delete, yank...)
I like vim because its commands are both efficient and precise. I don't need to look and make sure the cursor is at the right position or that I've selected what I want to cut/copy correctly. I know it's correct because I typed it in. And I don't need to move my hand to the mouse or arrow keys. And bookmarks and buffers are great.