r/coding • • Oct 04 '13

Just use Sublime Text (instead of vim)

http://delvarworld.github.io/blog/2013/03/16/just-use-sublime-text/
43 Upvotes

254 comments sorted by

View all comments

50

u/MediumRay Oct 04 '13

As ever, I say take the rants of bloggers with a pinch of salt. Some things I agree with, (vimscript is pretty whacky). And others I don't (vimscript is hard to learn, most vimmers don't know vimscript). I would like to see the justification for those statements.

"Vim is more efficient is dubious and untestable"

I guess that would be true for all editors, yes. You can't 'prove' efficiency.

Don’t you ever think you can beat a mouse. Only in very few edge cases will it even matter.

Suddenly an expert on efficiency, can definitely say a mouse is better.

In my opinion, you would be mad to say a mouse is anywhere near as efficient, barring very few exceptions. Also you want monospaced characters always, otherwise you can't select/move blockwise. Obviously someone didn't read those two books.

My advice has always been: if you want to be able to edit code at the speed of light, and are willing to put in some time to learn how to do so, vim is for you. Especially if you spend a lot of time on the command line and are editing many files at random that aren't necessarily all one project. If you are more interested in the stuff an IDE has to offer, you can probably forgo vim (not that it can't be used with/as an IDE). Overall I get the feeling the author doesn't use vim all that well.

4

u/pohatu Oct 04 '13

If I were on a terminal editing text over a 2b connection of whatever they had when they invented vi, I'd totally find it awesome that I could count lines and then tell the cursor to jump 20 lines by typing 3 letters rather than typing down 20 times.

but I can't seem to understand how counting lines and then entering a command is faster than just scrolling and clicking. Find is faster than scrolling, sure, but clicking 6 lines below is faster than counting to see its six line I want to go to. Maybe you get. A habit of line number subtracting or something.

12

u/MediumRay Oct 04 '13

I actually use relative line numbering, so I don't need to count the lines (the line my cursor is on is numbered 0, lines above and below go 1 2 3 etc.). But, that isn't really that fast, and I don't use it much, because you need to type 20 then down, then move right somehow to get where you want. Clicking might even be faster. No, what I do 97% of the time is search forward. So if I see that I want to edit a line way down saying println("This is a test");, I would search forward for 'This'. The cursor jumps there. I then hit 'ci"', which means 'change inside the "s (delete what is currently there and prepare to insert text). After that I can jump back to where my cursor was before in a keystroke, or whatever. So you can move faster, I would say. Moving lines around is the fastest though, instead I could have jumped to that line, hit the keys for 'copy line', then jumped back to where I was to paste it there. That would take way longer with a mouse (for me at least).

1

u/unknownmosquito Oct 05 '13

Not to mention you can just enable the mouse, even in console vim or Evil mode in emacs.

Task: I want to change the text inside the quotes of "This is a test" visible halfway down the screen.

Sublime: Click carefully before the T and drag to the end of test. Begin typing.

Vim/Evil Mode: Click quickly anywhere between the quotes. Type ci" and begin typing. Or jump there with f or /. Or use easymotion. Or use line numbers. You know, whatever's fastest. I guarantee you can do it faster in vim.

6

u/Tenobrus Oct 05 '13

Actually...

Sublime: Click quickly anywhere between the quotes. Press Shift+Ctrl+Space and begin typing.

1

u/rs-485 Oct 05 '13

What about brackets? You can do ci( in vim, how do you that in Sublime?

3

u/Tenobrus Oct 05 '13

Shift+Ctrl+Space is actually just "expand selection to context", so it will still work. Or Shift+Ctrl+D, which is specifically "expand to brackets".

1

u/rs-485 Oct 05 '13

It's funny, but I find it harder to memorize such key combinations in comparison to vim's operators. Those key combinations just seem rather arbitrarily chosen, while with ci", it's very clear what it does: Change Inner/Inside ".

3

u/Tenobrus Oct 05 '13

Ok. Each to his own.