Live data from Hacker News

Why Vi Rocks

why-vi.rocks

11–20 of 80 posts

Re: Why Vi Rocks

#11

I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio. All the examples listed are pretty uncommon or trivial in any of the other IDEs (aside from the regex part, which is cool, but I never want to be in a place where I have to regex my code...ever). 90% of the time I’m doing simple code maintenance, with an occasional refactoring. And I know devs that swear by vi...they are dev…

> but I never want to be in a place where I have to regex my code...ever).

I use regex search and replace fairly often; why are you so opposed to it?

If I need to change $t1 into t1 in a group of 6 lines (something I did today), its pretty easy to just make that replacement automatically. Doing it by hand would just take longer.

> ... with an occasional refactoring

That's exactly what I use the feature for.

Re: Why Vi Rocks

#12

I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio. All the examples listed are pretty uncommon or trivial in any of the other IDEs (aside from the regex part, which is cool, but I never want to be in a place where I have to regex my code...ever). 90% of the time I’m doing simple code maintenance, with an occasional refactoring. And I know devs that swear by vi...they are dev…

First, I also had trouble with XCode. About the regex in vi: there is a technique of writing/maintaining code based on substitutions instead of inserting/deleting. It can be very powerful but you have to "write" your code thinking about the patterns and maintaining some kind of structure. I am not saying that it is good or recommended. It's interesting. I coded for like 5 years like that. I was maintaining a codebase completely solo. When working with a not very synchronized team or having tools like resharp or omnisharp etc avaliable, I don't think it would pay off.

Re: Why Vi Rocks

#13

I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio. All the examples listed are pretty uncommon or trivial in any of the other IDEs (aside from the regex part, which is cool, but I never want to be in a place where I have to regex my code...ever). 90% of the time I’m doing simple code maintenance, with an occasional refactoring. And I know devs that swear by vi...they are dev…

At any rate, it's a good thing that literally every single IDE can do search and replace with regexes.

Re: Why Vi Rocks

#14
Vim is like Dvorak. The cognitive burden for remembering which key maps to what is high unless you use it 24/7.

Re: Why Vi Rocks

#16

I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio. All the examples listed are pretty uncommon or trivial in any of the other IDEs (aside from the regex part, which is cool, but I never want to be in a place where I have to regex my code...ever). 90% of the time I’m doing simple code maintenance, with an occasional refactoring. And I know devs that swear by vi...they are dev…

Searching with regexes is more likely to be useful when trolling through log or data files than code. Even then, the most common cases for me are searching for a string only at the beginning or ending of a line, or only searching for instances that are not part of a larger word.

I search for /def.*partial_name/ frequently when I can’t quite remember what a method is called in Ruby.

Re: Why Vi Rocks

#17

i see people struggling, fighting with Intelli-J every day. I wish I could give them vim as a gift. All the extra stuff you think you can't possibly give up you don't need. I'm a professional text file editor. Vim is like playing the piano. I guess what I'm saying is learn to play the piano for real, and don't spend your life in a piano-player-helper IDE thing.

We have this and it works very well https://github.com/JetBrains/ideavim

Plain Vim does not have the semantic / refactoring capabilities of a real IDE. This plugin gives the best of both worlds.

Re: Why Vi Rocks

#18
post #14

Vim is like Dvorak. The cognitive burden for remembering which key maps to what is high unless you use it 24/7.

It's actually not that hard:

The formula: number(Optional) action movement

Examples:

2 dl - delete two characters right

dw - delete a word

yb - copy back a word

y/foo - copy to the search foo

4cw - change the next four words

actions: yank(copy, delete, change)

movements: /(search), t(til character), f(to character), many many others (l, h, j, k, *, #, T, F)

Combine as you see fit.

Re: Why Vi Rocks

#20

i see people struggling, fighting with Intelli-J every day. I wish I could give them vim as a gift. All the extra stuff you think you can't possibly give up you don't need. I'm a professional text file editor. Vim is like playing the piano. I guess what I'm saying is learn to play the piano for real, and don't spend your life in a piano-player-helper IDE thing.

Vim is a fantastic text editor, but it is not an IDE replacement. Here's just a few IntelliJ features I use daily that Vim doesn't have: Go to declaration, find usages, rename method/class, change method signature, auto-import, shortcut to override method, easy-to-configure style rules, really good code completion, quick access to javadoc.

I could keep going. Again, not hating on Vim. I use Vim keybindings in IntelliJ! I just don't think it's the best tool for working in large codebases.

Post reply on HN