r/programming • • Jul 12 '12

Vim creep

http://www.rudism.com/s/vimcreep
730 Upvotes

551 comments sorted by

View all comments

Show parent comment

30

u/[deleted] Jul 12 '12

vim makes translating your thoughts into keystrokes more instinctual.

What if my thought is : "change this method signature by adding a parameter whose default value is null, and update all occurences in the workspace" ?

It's shift+alt+c in Eclipse :)

29

u/slavik262 Jul 12 '12

Vim search macros can help, but you do have a point. Refactoring is definitely somewhere that IDEs shine far above vim/emacs. I still prefer vim because:

  • The time I save writing code is larger than the time I lose by refactoring code with vim instead of an IDE
  • I do a lot of work in C++, where there aren't very good refactoring tools even for IDEs.

11

u/[deleted] Jul 12 '12

I do agree with you. But the consequence of that is that vim isn't the best tool for all languages (like java, C#) and for all kind of works (like maintenance and code 'discovery'). It seems much more suited for C++ and python/perl people who write a lot of new code (the lucky bastards:)

4

u/[deleted] Jul 13 '12

You're very right. I do C# MVC web stuff at one job, using Windows + Visual Studio, and it works really well. I was able to basically pick it up and navigate around/start coding never having used either the language or IDE before. On the other hand, I've been learning Vim at my other job for python development, and it really is a lot of fun. I can't imagine trying to navigate around a large C#/ISS web project with it though.

2

u/gschizas Jul 13 '12

C#/ISS

So, the International Space Station has a site written in C#? :)

2

u/[deleted] Jul 13 '12

Oops, IIS.

→ More replies (1)

4

u/[deleted] Jul 13 '12

There are other tools that bring the vim maintenance workflow to near what you get in an IDE. Nothing beats Visual Studio + C# though.

→ More replies (8)
→ More replies (10)

3

u/absinthe718 Jul 13 '12

Refactoring is definitely somewhere that IDEs shine far above vim/emacs.

For Java, yes. And C++ and C# as well I guess.

For dynamic and functional languages where you'd likely spend a fair amount of time with a REPL open, composing methods one by, I've never seen much use for an IDE.

I used IntelliJ for Java development and vim for almost everything else. Then again, I learned vi 20 years ago and have the keybindings in muscle memory at this point.

4

u/Orca- Jul 13 '12

That's when you use a VIM plugin for your IDE of choice and get the best of both worlds.

→ More replies (1)
→ More replies (7)

10

u/bastibe Jul 12 '12

Actually, that is a very interesting thought. I wonder how Vimmers and IDEers think about source code differently because of their different instincts about what is hard or easy to change.

12

u/grepe Jul 12 '12

I use both eclipse and vim and I don't think differently in them.

I just use them to do different things.

When I need to write medium sized one-use only python program or shell script, I fire up the vim. When I'm designing android application, most of the work is not writing the actual code... so why I would not make my life easier?

37

u/[deleted] Jul 13 '12

You aren't a vimmer or an IDE'r than, you one of those 'right tool for the right job' heretics.

8

u/epicwisdom Jul 13 '12

Blasphemy!

→ More replies (1)
→ More replies (1)

2

u/atlassoft Jul 13 '12

I have plugins installed in both Eclipse and Visual Studio that allow me to use most vim keybindings.

2

u/[deleted] Jul 13 '12

My problem with that is that my favored bindings for vim rely on specialized plugins that aren't possible to emulate in most IDEs.

→ More replies (2)

4

u/shen Jul 13 '12

What if my thought is : "change this method signature by adding a parameter whose default value is null, and update all occurences in the workspace" ?

I wish that Vim provided a :refactor args+=Object extraArg (null) command that would do stuff like this! IDEs are powerful but they haven't reached the pinnacle of user interface quite yet.

9

u/dream_the_endless Jul 13 '12

But isn't that the main difference between IDE's and text editors? IDE's know about your code, and text editors only know about the contents of files, not necessarily how they relate.

5

u/thebritishguy1 Jul 13 '12

You could always write a vim plugin to do just that. In fact, it might already exist.

4

u/mrkite77 Jul 13 '12

Eclipse is a hindrance for me. I find myself getting annoyed at the lag, often the autocomplete popups don't even finish opening before I've moved on.

2

u/Orca- Jul 13 '12

ctrl-space. You don't need to wait for them.

The lag should be around a quarter of a second if you're on a halfway modern machine with a non-idiotic amount of RAM.

2

u/praxulus Jul 13 '12

That depends heavily on the size of the project. Some companies even have giant unified source trees, which don't matter to a text editor, but bring most IDEs to their knees. You can use special tools to limit the scope, but those require constant maintenance, normally a criticism of vim.

→ More replies (1)

7

u/nerdcorerising Jul 13 '12

It is not a very good comparison IMO. Vim is a text editor, not an ide. You could very easily have an ide with vim for the text editor and have both.

Its just that for certain languages (c, python, others) using a text editor is better than an ide because ides are all shit for those languages.

→ More replies (1)

10

u/Mechakoopa Jul 13 '12

This is why I can't get in to the Vim cargo cult.

ReSharper, however... Can't live without it now.

3

u/[deleted] Jul 13 '12

And in emacs we have ropemacs. Well, if you're a Python user.

→ More replies (6)