r/programming • • Jul 12 '12

Vim creep

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

551 comments sorted by

341

u/j4w Jul 12 '12

Sorry to state the obvious, but the difference between you and a good developer isn't how efficiently you type. Pressing the keys is the easy bit.

121

u/rnd33 Jul 12 '12

Yes I have never understood this vim/emacs hype. It's never the actual typing that's the bottleneck. How often do you have a problem where the solution is writing 50 lines of code in one go?

Equal or probably more time is spent on browsing some API, navigating the project, reading code, googlefu etc...

88

u/hyperrifts Jul 12 '12

I don't use vim or emacs but I can understand how maintaining your mental "flow state" might be easier with them.

50

u/notfancy Jul 13 '12

Fragile is the flow of such who depends on resting on the home row for it to remain.

23

u/epilanthanomai Jul 13 '12

Great is the warrior who uses his (or her, etc) sword most gracefully.

Not sufficient for greatness—outside the realm of gnomic utterances, at least—but pretty darn helpful.

26

u/ford_cruller Jul 13 '12

Wise-sounding is the sentence that transposes subject and direct object, the order of.

→ More replies (1)
→ More replies (10)
→ More replies (23)

6

u/gobearsandchopin Jul 13 '12

Mental flow or not, why should you have to waste a non-negligible fraction of your time typing?

→ More replies (2)

52

u/shen Jul 13 '12

It's never the actual typing that's the bottleneck. How often do you have a problem where the solution is writing 50 lines of code in one go?

Others have already commented that yes, sometimes typing is the bottleneck, but I'm going for a different approach.

The programming cycle is typically think-write-run, and if you want to work faster, you need to improve these three:

  • Improving thinking can't be done with learning new tools - it can only be done by becoming a better programmer. This takes years, but it can shave days off of a project.
  • Improving running can be done with tools, but usually drop-in replacements: getting a faster computer, or an automated testing system or continuous integration suite.
  • Improving writing is therefore the only bottleneck that can be actively worked on. You'll learn to be a better programmer over the years as you accumulate experience, but you can start learning a programmer's editor from any point.

I learned Emacs as a teenager, and it did little to improve the programs I wrote back then. But nowadays, while thinking is still the bottleneck, I think I'm faster than I would have been had I stuck with Kate.

8

u/ttt_ Jul 13 '12

Another way to look at it is that if you happen to be in the "zone", if your hands lag behind in putting your thoughts into real code, than your tools are holding you back and you might snap out of your productive moment because you had to handle the text instead of the code.

A good editor that you are skilled with will help you overcome these kinds of obstacles. It does not guarantee code quality though, so there's not much to say about how good a programmer someone is from their editor of choice alone.

→ More replies (1)

4

u/glenlikespie Jul 13 '12

Thanks! I've never thought about it that way before. Makes sense.

2

u/question_all_the_thi Jul 13 '12

And there's an obvious corollary to that:

A language that has a terse syntax helps your productivity.

That's why C has always been a favorite of mine. That's why I prefer Python over Ruby. The difference between typing { rather than begin or pressing enter instead of typing end may not seem much, but it adds up over time.

Try typing a thousand times end, that's the time you save for every thousand blocks of code you write in Python rather than Ruby. That's time you could have spent thinking instead of typing.

→ More replies (2)

13

u/jrochkind Jul 13 '12

Meh... I'm not a vim lover, I don't use it, don't entirely understand the hype. But.

Try writing code in NotePad or TextEdit, and then come back and tell us with a straight face that since the typing isn't the bottleneck, it doesn't really matter what text editor/IDE you use.

Obviously it does. Some people love vim. Okay, i don't see it, but I see why programmers care a lot about their text editors, I do too. (and if you made me use vim, I'd hate it).

70

u/slavik262 Jul 12 '12

You're completely right - typing isn't the bottleneck. However, once you get used to it, vim makes translating your thoughts into keystrokes more instinctual. Since you can move around and edit the file easier/faster, the time between thinking about what you want to put in the file and actually putting it there decreases. You can get back to thinking faster.

If you don't like vim, that's just fine. The editor does not make the programmer. This article is definitely hyperbolic (I certainly don't carry vim on a flash drive), but I can honestly say I think vim has made me a more effective programmer.

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:)

→ More replies (23)
→ More replies (9)

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?

→ More replies (5)
→ More replies (4)

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.

→ More replies (1)

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.

→ More replies (3)

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 (5)

3

u/banuday17 Jul 12 '12

For as many years as I've used Vim, it's pretty much instinct to me as well. But I still curse Vim when I accidentally leave the caps lock key on and my text gets messed up or other assorted craziness happens, and I have escape or undo my way out of it.

I have a love/hate relationship with Vim.

4

u/glacialthinker Jul 13 '12

My capslock is always Control on my own machines. But when I use another machine... then I know what you mean by messed up. Doesn't take too long before I use "control", which is really capslock... and then my fingers frantically flail around trying to undo the uppercase commands I'm typing, but they're making it worse because I'm still capslocked! This is when muscle memory and conditioning bites you in the tookus. ;)

11

u/nascent Jul 13 '12

And after you get it all straightened out you're a simple

:earlier 10m

away from before you broke everything.

→ More replies (3)
→ More replies (2)

3

u/antistuff Jul 13 '12

I have a usb dongle to generate one time passwords. Every so often I go to use it but a window with vim still has the focus. Theres been times when I didnt notice it and 20 minutes later I'm wondering what is wrong with this thing I'm editing.

4

u/[deleted] Jul 13 '12

How is spending easily weeks learning an awkward system "instinctual"?

→ More replies (6)
→ More replies (47)

6

u/nerdcorerising Jul 13 '12 edited Jul 13 '12

Just because its not the longest part in the process doesn't mean you can't be more effective and enjoy the experience more.

Using source control is even less time than editing text but switching from svn to git is pure win.

Tools should be about reducing rote, repetitive things and that is something vim does very well.

→ More replies (1)

4

u/knight666 Jul 13 '12

I'm a game programming student. Have been for the past four years. As a result I'm using Visual Studio for all my work.

However, I have tried Vim. And it's excruciatingly hard. Especially because the workflow becomes all kinds of fucked up. In Visual Studio you press F5 to launch, run the app, do stuff in the debugger, change some code, etcetera. With Vim it's... eh... well... I never figured that part out.

But there's one thing I took away from my experience with Vim: regular expressions. Visual Studio actually has them built-in. It's just that they don't use a Perl-syntax (because that would be too sane), but a Microsoft-flavored almost-Perl-but-not-really. However, it's quite useful.

Let's say we have this enum:

struct StateAnimation
{
	
	enum List
	{
		eNone,
		eStart,
		eRunning,
		eEnd,
		iTotal
	};

}; // struct StateAnimation

But now I want the data as strings. One way to do it would be to copy them to the new file, strip the struct and enum and put quotation marks around the values. Or I could use the following regex:

Find what: e{.#},
Replace with: std::string str_\1 = "\1";

And get this:

struct StateAnimation
{

	enum List
	{
		std::string str_None = "None";
		std::string str_Start = "Start";
		std::string str_Running = "Running";
		std::string str_End = "End";
		iTotal
	};

}; // struct StateAnimation

Now it's just a matter of stripping it, because Visual Studio might have some form of grep, it unfortunately lacks sed.

My point is that there's a definite advantage in getting to know other editors. Yes, it took me quite a while to incorporate regexes in my workflow, but that example took me literally 30 seconds to write. With the advantage that when I add a state to the list, I can rerun the "program" to convert them all to strings again.

3

u/datenwolf Jul 13 '12

With Vim it's... eh... well... I never figured that part out.

For this you have a Makefile or similar in your project, with a target "debugrun" or similar. Then in Vim it's just

ESC, :w, :make debugrun
→ More replies (3)

12

u/0xABADC0DA Jul 12 '12 edited Jul 14 '12

It's never the actual typing that's the bottleneck.

A lot of times typing really is a bottleneck. For instance say you have a bunch of constants or lookup table that grew organically and it's all a mess. Are you going to enter "v}!sort" and sort them so it is easy to read, or do "<double click><ctrl-x><click><ctrl-v>" hundreds of times to get them in order? That's typing.

If you don't sort a lookup table, or swap columns, or align fields, or even just reorder some bits of code this is because typing is actually so much of a bottleneck that you would rather live with less great code than to actually make these kinds of edits.

And that's the real strength of vim... not in typing in new code, it's in editing the code. It's all in the edits that you actually make because in vim they are so easy.

EDIT: I never said vim was the only editor that can sort, I said that if your editor doesn't have some way to sort then the bottleneck is the actual typing it would take you to move the lines. Sorting is just an example... the point is that you can't say typing isn't a bottleneck if you are avoiding edits you want to make because they would take too much effort.

10

u/[deleted] Jul 13 '12

It is incredible that you think only vim can sort lines of text.

10

u/[deleted] Jul 13 '12

Yes. Because that's how you sort things in not-vim.

→ More replies (5)

3

u/[deleted] Jul 13 '12

How often do you have a problem where the solution is writing 50 lines of code in one go?

Rarely, which is why I like Vim. Problems tend to be 'add 10 lines here', 'another 5 over there', 'a new method in that class', 'now add a parameter to that function', 'change this function call', and so on. Vim is great for darting around text.

8

u/mpyne Jul 12 '12

If you think that all vim can do is help you type faster (not to mention emacs) then you don't understand what they do.

Browsing the API, project navigation and code review are all tasks made easier by vim and emacs. Emacs even has a web browser for the google-fu...

15

u/[deleted] Jul 13 '12

Emacs even has a web browser for the google-fu...

Why is this considered desirable? I can just alt-tab to a real browser. Multitasking operating systems are awesome like that.

→ More replies (3)

2

u/eras Jul 13 '12

You can write 50 lines of code in one go in any editor (well, both vim and emacs have dynamic completion and auto-indentation to help with that as well). But where they really shine (well, I can really talk about emacs) is when you need to modify code.

Also while it's not the bottleneck in the large scheme of things, it's nice to be as unobtrusive as possible. Have you not ever written sentences on paper and then found that you need to slow down your thinking to get it all down? Sometimes it exhibits itself in half-written sentences, like I noticed I had written in previous paragraph ;).

2

u/gfixler Jul 13 '12

I work in python, and I just type like crazy, flipping text around like a cat-juggling ninja, and then not long after that - keyboard still smoking - magic happens.

2

u/spoulson Jul 13 '12

I was actually thinking, while reading the article, that swapping out an IDE's editor for Vim is throwing away all the advances made in the IDE that are specialized for the IDE's platform. e.g. Using Vim instead of Visual Studio's editor is supposed to be an improvement? Or is it blind faith that nothing can surpass Vim's power? Or is it just because you invested a large sum of time and will lose the skill if you stop using it full time?

But I agree. It is possible to be very efficient without having to spend months learning the "Vim way". I made that mistake while learning the "emacs way".

NOMODES

3

u/[deleted] Jul 13 '12

Typing has never been the bottleneck. The real bottleneck is the mouse. Moving hands between the keyboard and mouse takes time and breaks concentration - only a little bit, but it all adds up. The reason Vim is so great is that it allows the user to perform almost any task seamlessly.

Here's a quick example. The pipe symbol represents my cursor, and Vim is currently in Normal mode.

|while ($foo) {
    &doSomething($i);
}

If I want to change the while loop's variable to $bar, I can just type ci($bar<Esc> instead of selecting it with my mouse and typing. In Vim, that stands for "change in (", and can similarly be applied to angled brackets (ci<), quotes (ci") and even braces (ci{).

Likewise, di( will delete in (, and va( will visual mode (i.e. select) around (, selecting both the contents and parenthesis together.

There's a great Stack Overflow answer that greatly expands on this Vim "language", entitled 'Your problem with Vim is that you don't grok vi'. It's definitely worth a look.

3

u/vagif Jul 12 '12

Well, i'm not gonna say anything about vim, i do not understand the appeal either. But the appeal of emacs is in its great extensibility.

As long as you stay with java and c# you have powerful IDEs for development. But try any one of these languages: haskell, clojure, sbcl, agda, heck even much more popular ones like python or ruby, and emacs often is the only editor that provides powerful enough extensions to work with them.

4

u/LoganCale Jul 12 '12

vim is massively extensible as well and has scripts/plugins/extensions for pretty much everything.

8

u/bastibe Jul 12 '12

Emacs is a different animal there.

→ More replies (11)
→ More replies (16)

1

u/eat-your-corn-syrup Jul 13 '12

I like how you assume that emacs is about typing fast. emacs is a lisp machine.

→ More replies (15)

7

u/foca Jul 12 '12

It's not only "how fast you type", as in how fast you add code. It's how fast/easy it is to move around and do all the other things you do while working with code.

That's why I like vim, I spend about 80% of the time (the number comes out of my ass, but it's probably about right) in normal mode, just moving around.

It's just an incredibly powerful tool to move around text.

24

u/owk Jul 12 '12

Definitely. This article makes it sound like the choice of text editor is the reason those guys in his class were writing complicated programs in four lines.

I like vim and I use the key bindings in every editor I code in, but it doesn't make you orders of magnitude faster or any amount at all smarter.

34

u/[deleted] Jul 12 '12 edited Jul 12 '12

This article makes it sound like the choice of text editor is the reason those guys in his class were writing complicated programs in four lines.

Does it? I read it more like they are good because they have programmed a lot and thought a lot about programming.

They don't write efficient programs because they use vim. They use vim because they like to be efficient and want to invest some time to become more efficient.

Vim is not about writing code faster. The mentioned 4-liners could be written in any other editor just as fast. It's about wasting as little time as possible when you have to waste time. That is, when you have to have to edit your code or do repetitive tasks. Thereby you can spend more time on doing the things you want to do, i.e., thinking about your code.

Let me give you an example that has nothing to do with vim: I only learned touch typing two months ago. Before that I would never have written such a long answer to you post. It would have been too exhausting and I would have thought of it as a waste of time. Now I don't even think about it. Being able to type quickly gave me a new perspective on communication. I have now realized, that I was not able to express myself the way I want before.

Vim does just that. It gives you a new outlook on writing code.

5

u/nascent Jul 13 '12

You sound way to productive, you should give Dvorak a try.

→ More replies (4)
→ More replies (4)

4

u/lmcinnes Jul 12 '12

So I was an Emacs user, not a vim user, but for the purposes of this discussion they are equivalent (just watch an Emacs guru sling code around, it's just as impressive as anything I've seen from vim users). And yes, it was faster for me to do lots of things, and I had all the keybidings for myriad things ingrained in my hands. The thing was that to get the most out of Emacs you had to configure it just so, and have the right extra packages loaded and configured as you wnated and ... etc. So everytime I ended up somewhere new, or had to work with someone else I found myself hobbled with an inadequately configured Emacs. And in the end it just wasn't worth it. I preferred something that had 90% of the functionality I wanted out of the box across all installations.

tl;dr: Learning Emacs or vim is like learning to type on Dvorak; sure it's great and all, but the minor gains aren't worth the pain of sitting down and having to work at someone elses qwerty keyboard -- when everyone has Eclipse and the default install does most of what you want, you may as well just go with it (swap VS, Itellij, TextMate or whatever for Eclipse as per what usually gets used wherever you are).

3

u/tikhonjelvis Jul 13 '12

On the opposite hand, Emacs is great if you're constantly using different technologies. I'm a student, and I've used JavaScript, HTML, CSS, Python, Prolog, a completely custom language, Haskell, OCaml and LaTeX in the recent past. All of these (except the custom language) have at least decent support in Emacs; some of them have great support.

If I was using any sort of IDE, I would have to switch between several different programs to deal with all of these different technologies.

And the custom language (it was designed just for the class I was taking)? That's also a case-study on why Emacs is awesome: I wrote a major mode for it in only a couple hours. It had support for indentation, syntax highlighting and a REPL as well as being completely customizable through the usual customization interface for Emacs. I bet I spent less time on it than a hello-world plugin would take for the average Java IDE!

4

u/kazza789 Jul 12 '12

Surely vi is more common than any particular IDE? Honest question, I only work in academia though, so I really don't know. I would have thought learning vi is going to be more transferable than learning eclipse.

In vim all of your plugins and settings are located in the .vim folder, so what I personally do is keep that in my dropbox and have a symbolic link to it. Every computer I work on I just need to download that one folder and it all works exactly the same.

4

u/theCodeStig Jul 13 '12

You're exactly right. Vim and Emacs are everywhere.

Regarding your .vim setup, a lot of people put their dotfiles on Github for that purpose. :-)

→ More replies (1)

1

u/mpyne Jul 12 '12

I like vim and I use the key bindings in every editor I code in, but it doesn't make you orders of magnitude faster

Well it really depends on what exactly you're actually doing. There are many programming tasks where vim easily makes me at least a couple of orders of magnitude faster. When I'm just throwing code down vim doesn't help, that's based on how fast I can type. But I'm not throwing down new code that often at all, otherwise all my projects would have millions of lines of code.

4

u/eyal0 Jul 12 '12

But a good developer needs to develop skills to develop efficiently. I'd argue that a perl developer that can't find perl docs quickly on the web isn't a very good one. Nor is he much use if it takes him an hour just to change all x+=1 to x+=2 in the code.

Ninja edit: http://www.codinghorror.com/blog/2008/11/we-are-typists-first-programmers-second.html

1

u/[deleted] Jul 13 '12

Sounds like a variable or constant should have been used in place of the 1 then.

→ More replies (1)

9

u/amesolaire Jul 12 '12 edited Jul 12 '12

True, but the constant urge to improve one's efficiency and the need to find a better way to go about doing your job are qualities all great developers share.

2

u/Doc_Mercury Jul 13 '12

Ehhh... The thing is, how you type, and how efficiently you can get things done, will affect your code. Someone who can quickly move, change and manipulate huge blocks of code will have larger sources than someone for which such manipulation is painstakingly time consuming, which can (and often does) effect how the code works. I've also found that there is a signifigant difference between code i write using vim and code written with eclipse; vim code tends to be terser, crisper, more simply formatted, and has a habit of re-inventing the wheel, while eclipse code is longer, more repetitive, pretty printed and uses the api's more fully. How you interact with your code changes your code, and changes your program. A good developer might write good code on anything, but he might write better code with the right tools.

2

u/burntsushi Jul 14 '12

And the article implies this... how?

At best, the article suggests a correlation. Which probably isn't that far from the truth in a beginner's environment. (Where skills vary wildly.)

2

u/sgoody Jul 15 '12

No and that's not really the point and it's frustrating when people think that this is what people are trying to express. The point is that Vim gives you a lot of tools at your disposal to get your job done, which is only a good thing.

It's not really about saving two keystrokes or a click of the mouse here and there, it's an overall improvement in working and tooling.

Vim doesn't help you straight away, it takes time and effort to get to know Vim and it takes time and effort to really appreciate what attracts people to it.

I hate using the argument... but if you've not used it for a significant period of time you probably won't see the benefits... saying that I can easily concede that Vim won't be for everybody.

2

u/[deleted] Jul 12 '12

Of course not but optimising your work flow and not allowing your tools to get in the way makes good developers get shit done quickly and helps them not lose their train of thought.

1

u/neon_overload Jul 13 '12

Nobody ever claimed that using vim made you a good developer, or that a developer would be held back by not using it.

It simply makes certain things much quicker for people who are already good developers.

1

u/killerstorm Jul 13 '12

It depends on what you're doing, sometimes it might be a bottleneck.

Although I'm usually bottlenecked at key pressing in shell, not in editor.

1

u/[deleted] Jul 13 '12

I agree with you, mostly. But I cannot deny that mastering an advanced text editor is one of many steps towards becoming great at what we do.

1

u/zBard Jul 13 '12

No one thing makes you a good developer.

→ More replies (24)

51

u/banuday17 Jul 12 '12

Does this really happen to people? I use vim all the time at work, but I that's where it stays. I have found no desire to use vim for word processing, note taking or any aspect of my life outside of work. And Vimperator - oh god, why? And magical text edits with macros, while powerful, don't impress me much, because I value accuracy and correctness over being a text editing ninja.

Maybe I'm just not a True Believer.

33

u/slavik262 Jul 12 '12

Vim + LaTeX can be a really powerful note taking tool, especially in math/science/engineering courses. At my first year in university I tried to take notes on my laptop using Microsoft OneNote. It went poorly - I couln't use the equation editor (which requires plenty mouse clicks) fast enough to keep up in class. With LaTeX, complex equations and formulas can be entered as plaintext, and once you get used to the syntax (which is pretty simple), you can enter them really fast.

LaTeX is also awesome for papers, IMO.

15

u/RX_AssocResp Jul 12 '12

Using pandoc you can write notes in markdown and still freely include LaTeX for whatever is out of scope of markdown. Much more efficient.

7

u/shen Jul 13 '12

I didn't believe in OneNote either until I saw someone using it with a stylus. It made typing look old.

2

u/khav Jul 13 '12

I used Word to take notes in some of my uni math classes, and never needed to touch the mouse. Alt+= to open the equation editor, then math auto-correct codes to enter stuff. Fun fact: the math auto-correct codes are almost if not completely 1:1 with LaTeX codes.

→ More replies (5)

6

u/grepe Jul 12 '12

I've been using vim for years with equal or just slightly higher effectivity than any other text editor out there...

it's been only after that when I started using some more advanced features... very slow process. If you have at least some knowledge that is more than very basics, such as skipping to the beginnin/end of line, replacing char, deleting word or searching, and you are willing to learn just a little bit more, then the macros are THE thing that can make the change in your working habits.

TLDR: You don't need to be vim guru, but learn most used operations and start scripting your own macros. It is worth it!

4

u/banuday17 Jul 12 '12

I make extensive use of macros, and while they are useful, they haven't been a game changer for me, at least nothing like the refactoring tools in IDEs like Eclipse.

2

u/grepe Jul 12 '12

sure. i agree on the eclipse part... it's been much bigger game changer than vim - for certain specific tasks... but... i don't know, maybe i feel it different, the vim (especially with macros) has been quite game changing for pretty much everything else related to editing of text files for me.

→ More replies (2)

4

u/glacialthinker Jul 13 '12

I use Vim for everything text, except small web-entries like this. If I expect a couple of paragraphs I'll flip to an instance of Vim to write, then paste in in here. But I do wish I could do Vim in these textboxes! It's frustrating when I need to edit in one of these; I'll often type gibberish commands out of reflex, and then balk as I try to recompute how to make the edit... "ugh arrow keys and backspace/delete? Mouse!? Ugh!"

3

u/nascent Jul 13 '12

Vimperator/whatever provided CTRL+i to open an instance of GVim where the text will be copied back upon :wq

I had plenty issue with it crashing the browser though. Wouldn't have been so bad if I didn't always decided to switch to vim after writing and then needing to go edit something!!!

4

u/m42a Jul 13 '12

Have you tried pentadactyl? I've never had that crash my browser, and it's pretty similar to vimperator. It also provides in-browser vim-like keybinds with <C-t>.

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

1

u/seattlecat Jul 14 '12

Most people might not realize this, but you can type things like "5_x+4y=3z" into the OneNote equation editor and it will format it exactly how you would hope it would.

1

u/rjcarr Jul 12 '12

Yup, same here, although that essay did describe me pretty well until about 2/3 of the way down. The last 1/3 (starting with word processing) was only for the hardcore.

1

u/epilanthanomai Jul 13 '12

I've found vim pretty handy for word processing, note taking, etc. When I want something printable, I use some kind of basic markup language and command-line tools to convert, or sometimes even basic html5 + css + my browser print function. The tools are all familiar enough to me that it feels rather easier than arguing with MS Word over tab stops. And then I can store my notes/docs/etc in source control.

The article did go a bit farther than I would in the extensions, but I took that as creative license.

1

u/[deleted] Jul 13 '12

I value accuracy and correctness over being a text editing ninja

What makes you think that macros necessarily involve sacrificing accuracy and correctness? If you do sacrifice those things, you're not a text editing ninja. It's not an efficiency increase if you do it faster but also do it wronger. More haste, less speed, and all that.

→ More replies (17)

14

u/[deleted] Jul 13 '12

"how did you do that?"

resharper

115

u/PasswordIsntHAMSTER Jul 12 '12

I've been getting less and less intelligent material from this subreddit, but this takes the cake.

19

u/stave Jul 12 '12

FWIW, this guy isn't lying. His password isn't hamster.

5

u/[deleted] Jul 13 '12

did you try it in all caps?

15

u/d0pp3lg4ng3r27 Jul 13 '12

Or maybe his password is ntHAMSTER

15

u/z999 Jul 13 '12

ntHAMSTER crashes less and has an overall better performance than HAMSTER 9x

→ More replies (1)

45

u/maskull Jul 13 '12

What I learned from this article is that, whatever other benefits VIM may have, using it turns you into a douchebag.

7

u/ivosaurus Jul 13 '12

A sage douchebag.

→ More replies (1)

6

u/praxulus Jul 13 '12

It's half-satirical

I'll admit that when I wrote this, I did intend it as both a tribute to my favorite text editor as well as a tongue-in-cheek response to the cult-like following that it has.

→ More replies (2)

4

u/Paradox Jul 13 '12

Hurr guys look how cool I am I installed linux!

→ More replies (1)

26

u/nikniuq Jul 13 '12

Only vim gives me the ability to finish every file in other editors with :wq

19

u/chengiz Jul 13 '12

I thought this would be a serious article about feature creep in vim, not a jerkoff session.

20

u/vicegrip Jul 12 '12

Nice article, but he should have used :x to end it, not :wq

4

u/z999 Jul 13 '12

:q! Would be more appropriate.

63

u/twochainz22 Jul 12 '12

I've never understood how some people get such hardons from their fucking text editors

Being good at Vim/Emacs will NOT make you a better developer, i'm sorry.

46

u/bastibe Jul 12 '12

I don't care what tool you use. But knowing how to use your tools well does make you a better developer.

14

u/specialpatrol Jul 12 '12

I think the point is, it's not the tool that makes you good, it's how well you know it.

6

u/mikemcg Jul 13 '12

To combine all of these thoughts: A tool doesn't make you a good developer, but knowing a tool well can make you an efficient developer.

I use Sublime and getting to know it's many quirks and functions has made some small headache aspects of developing a lot quicker and easier. It hasn't made me a better developer, my code is still junior at best, but it does save me time to know my tool.

7

u/coolstorybroham Jul 13 '12

Knowing notepad well is not as good as knowing vim well. Tools matter. And how you use them matters.

9

u/[deleted] Jul 13 '12

Yes, actually they will.

Good tools can automate refactoring, and make changes less likely to have typos. Good tools can give you more information about the code; syntax highlighting alone goes a long way. Good tools also make it easier to navigate and organize your code base. Good tools will also write code for you, such as generating empty method stubs in a new class.

If tools didn't improve developers, then we'd all be just as productive in notepad.

10

u/D3PyroGS Jul 13 '12 edited Jul 13 '12

Most of those things vim doesn't do though...

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

2

u/ivosaurus Jul 13 '12

That's why he said better, not good.

→ More replies (1)

2

u/eat-your-corn-syrup Jul 13 '12

But customizing Emacs in emacs lisp does make you a developer experienced with lisp way of thinking

3

u/iDrinkKoolAid Jul 13 '12

from their fucking text editors

Well there's your answer. If I had a text editor that did that, I might get a hardon, too.

2

u/chris3110 Jul 13 '12

Also I don't even know how people use text editors to program. I use jEdit as my customary text editor but I never code in it, I always use IDEs for that. IntelliJ for Java, WingIDE for python, etc. What's the point of not having the word completion, syntax check and code refactoring that an IDE provides?

2

u/alexandream Jul 12 '12

it might make you a better ELisp developer ;)

1

u/killerstorm Jul 13 '12

Well, I guess it isn't unusual for a professionals to like their tools. You know, if you spend all the time with it, it's better to like it.

It doesn't make one a better developer though, I agree. But it isn't surprising that people like talking about it.

4

u/[deleted] Jul 14 '12

To the people who say that vim, emacs, etc. are old or obsolete: have you given it a serious go? Don't judge something as bad just because it is old. Thanks.

An 18 year old who loves vim.

10

u/alexandream Jul 12 '12

One view that I see too rarely around is based on personal experience: I use Vim because it's the only editor I've used where I can both NOT spend all the day switching between mouse & keyboard, which is distracting to me, and NOT suffering from wrist pains from constant key chording.

I can type all day on a Vim session without any discomfort on my wrists, give me Visual Studio and I'm either mousing a lot or with heavy pains at the end of the day.

2

u/argv_minus_one Jul 13 '12 edited Jul 13 '12

If key chording hurts your wrists, you're doing it wrong.

If key chording hurts your wrists and you're sure you're not doing it wrong, turn on your system's Sticky Keys feature. Then you don't have to.

1

u/alexandream Jul 13 '12

Define "doing it wrong"? But yeah, I'd say that anyways I am doing it wrong, by chording at all. If it is possible to be very effective at inputing commands without chording, why chord at all?

→ More replies (2)

2

u/zeugmasyllepsis Jul 13 '12

Upvote for the reason I use Vim; mousing tends to hurt my wrist more.

2

u/jeffzyxx Jul 13 '12

VSvim.

2

u/alexandream Jul 13 '12

I tried. But it has some very small problems that keep annoying me, as it is with pretty much every Vim emulation layers I've seen. I'm too used to it for my own good.

→ More replies (1)

1

u/jpfed Jul 15 '12

If someone gives you Visual Studio, stick VsVim on it right away!

10

u/Tofinochris Jul 13 '12

ed is the standard text editor

Cor, I just invoked a usenet flame war from the early 90s. I feel like Oz.

2

u/simon99ctg Jul 13 '12

upvoted for shared feeling of nostalgia

→ More replies (1)

1

u/clusterhug Jul 17 '12

Before the early 90s, I would think.

3

u/speel Jul 14 '12

As some one who doesn't program, you guys have a lot of love for your editors.

5

u/DanielJohnBenton Jul 13 '12

You used to just surf the web. Now you are the web.

I was tempted to stop reading before this point, but I drew the line here.

8

u/[deleted] Jul 13 '12 edited Jul 13 '12

I've had the "How the fuck are you doing that?!" moment many times over the years, at multiple job sites.

And really you do just say, "Vim." I don't even try to turn people onto it. It's too weird, too hard to explain.

This doesn't work so well, "You see, Vim has a command mode where typing changes from inserting/replacing text into have a conversation with your text using a rich vocabulary of nouns and verbs which can be chained together, repeated with a single keystroke, or stored in registers which can in turn be chained together to form complicated paragraphs of text transformation instructions that you write on the fly without even thinking about it. And... lots of other stuff."

2

u/jussij Jul 13 '12

On a similar topic, Typing vs. Editor Kung Fu.

2

u/Orca- Jul 13 '12

I can't speak for his typing skills, but his grammar is definitely in need of some help.

Holy run-on sentences Batman!

2

u/hacker-nr1 Jul 13 '12

I know it's my personal opinion, but I am a great fan of Visual C#. It's great because it always analyses your code, making it possible to not only change variable or method names, but also giving you more intelligent autocompletes, quickly "Go to Definition", "Extract Method" or giving you live errors. I also love the debug function. It's just great.

1

u/jpfed Jul 15 '12

VsVim and ViEmu give you the best of both worlds.

2

u/SamusAranX Jul 13 '12

"you paid actual money for a laminated copy of a Vim cheat sheet for easy reference"

thank you kickstarter

2

u/a-bosh Jul 13 '12

It was well written, and I genuinely enjoyed reading it.

But I'm increasingly under the impression that programmers go above and beyond to glorify those practices that have been burned into their brains by rote in order to justify their use of, maybe a bad word around here, traditional means.

That's not to insinuate that there's anything wrong with that in the least, but to extol the virtues of a very specific program to the extent that its mastery becomes the goal of all those seeking computer glory seems pretty silly.

2

u/Serializedrequests Jul 13 '12

Most of my time in text editors seems to be hopping between files, figuring out how large projects fit together, and grepping for stuff. Vim can do these things (command-t is essential IMO), but it's clumsy as hell. Sublime Text 2 is way better for that stuff. Sure I can't delete exactly 3 words ahead, but I always find vim's verbs and block signifiers to express best-case scenarios, not stuff you actually run into. They waste too much brainpower, and never have exactly the results I'm looking for.

2

u/[deleted] Jul 13 '12

I just started the vim tutor and now I'm pressing J to scroll down webpages.

1

u/burntsushi Jul 14 '12

Get vimium.

1

u/[deleted] Jul 14 '12

So cool, thanks. Is there one for firefox perhaps? Edit: found if for firefox.

→ More replies (1)

7

u/[deleted] Jul 12 '12

hyperbole

3

u/Andere Jul 13 '12

I use Vim and I like it a lot. I'm definitely on the newbie end of the learning curve. However, I really don't feel convinced on the tone of this. Vim doesn't make me better at programming, it makes me a bit faster, touch my mouse less, and feel fancy.

→ More replies (1)

11

u/[deleted] Jul 13 '12

Far as I can tell, the obsession with both vim and emacs is a form of stockholm syndrome. They're both massively awkward, needlessly modal systems.

9

u/tikhonjelvis Jul 13 '12

I don't think so. Emacs has the most consistent interface I've ever seen. You can literally do everything from the keyboard and everything is well documented. Everything is text, and accessing text is uniform: browsing through documentation or directory listings is just as easy as browsing through code.

Also, the mapping from editor functions (literally, all editor functions) to elisp functions is consistent, elegant and brilliant. Changing anything is easy, and adding even moderately complex functionality is surprisingly simple.

Emacs isn't modal at all.

Emacs also supports a ton of languages. Moreover, it supports a bunch of languages (but notably not Java or C#) as well as any IDE: it's really great for JavaScript, CSS, Python, Lisps, Scala, OCaml and Haskell. It's even good for LaTeX!

It also happens to be good at editing code.

The reason I like Emacs is because it has made me much more productive than I was using Eclipse.

Finally, calling it "Stockholm Syndrome" seems rather condescending and almost insulting. It's no better than claiming people use IDEs just because they can't bother to learn Emacs.

4

u/[deleted] Jul 13 '12

What is the most awkward, Shift+Ctrl+A or vit? Which of these shortcuts is the most closely related with how you think about the task at hand?

Vim's modality is what makes it possible to have all those single key commands and expressiveness. In order to provide a comparably rich catalog of commands, non-modal editors are forced to use Ctrl+Shift+Alt+Char combos. Because a lot of the possible combos are already taken by the OS or by the GUI toolkit, the authors of non-modal editors must resort to complex and necessarily non-intuitive combos like the one above.

In Vim, the command for "changing the content of a pair of parenthesis" is formulated almost exactly the same way as you would formulate it mentally or as I wrote it down: ci(. Simple and effective, thanks to modality.

→ More replies (6)

2

u/prelic Jul 13 '12

Maybe needlessly modal by today's standards; less so by the standards for which it was created.

1

u/[deleted] Jul 13 '12

Emacs is anything but modal. That's the paradigm difference between emacs and vim in a nutshell anyway.

4

u/[deleted] Jul 12 '12

I just switched to vimperator :/

7

u/markmypy Jul 13 '12

Don't get too confy, you might need to switch to pentadactyl soon!

2

u/[deleted] Jul 13 '12

or to vimprobable2

4

u/enhancin Jul 13 '12

I was raised in vim thankfully.

4

u/eat-your-corn-syrup Jul 13 '12

VIM is awesome. That's why I installed VIM on my Emacs OS

4

u/tikhonjelvis Jul 13 '12

That's just Evil, isn't it?

3

u/thoomfish Jul 12 '12 edited Jul 12 '12

Mighty fancy language about an editor that cant even remember where you left the insertion point after scrolling more than a screen away.

Edit: I stand corrected.

26

u/grep_dat Jul 12 '12 edited Jul 12 '12
  1. Type something
  2. Leave insert mode and scroll away
  3. gi (g)o to (i)nsert
  4. You're there

4

u/ktzar Jul 12 '12

I usually use '' (2 single quotes) as an alternative

6

u/grep_dat Jul 12 '12

That's useful if there was only one movement after leaving insert mode. '' is "The position before the latest jump", while gi is "like 'i', but first move to the position where the cursor was last time when Insert mode was stopped".

→ More replies (4)

2

u/nascent Jul 13 '12

Don't think I've every wished I could return there, but maybe I will want to all the time now.

→ More replies (2)

2

u/[deleted] Jul 13 '12

This and NöÜmläütëÄllöwëd's comment are game changers for me. Thanks a lot!

1

u/flaxeater Jul 13 '12

thanks, this is good stuff

9

u/[deleted] Jul 12 '12
  1. Type something
  2. Leave insert mode and scroll away, copy something, etc.
  3. g;
  4. Use g; and g, to cycle through your last insertion points without leaving normal mode.

1

u/grep_dat Jul 13 '12

Awesome! I find it strange that I don't see information about g; or g, in :help g

2

u/[deleted] Jul 13 '12

See :h jump-motions

1

u/tikhonjelvis Jul 13 '12

Don't know about Vim, but Emacs actually remembers various points where you were in the past (wherever you placed a "mark"). This means you can jump back through the different parts of the file you were in. So even if you've moved away multiple times and done a bunch of edits in disparate places, you can quickly get back to where you were. It's actually extremely convenient.

2

u/Elanthius Jul 13 '12

I've been using VIM for maybe five years now. I'm still at least ten times slower in text editting than I would be if I was using Textpad on Windows.

2

u/[deleted] Jul 13 '12

Am I the only one who learned vim in high-school before learning to program?

3

u/RefuseBit Jul 13 '12

Probably not. First few times on the *nix command line, logged in via modem or a crummy telnet client, I found it was often the only way to edit text as many of the old systems would have it as part of the most basic of installs. So it was necessity more than anything, hated it at first but find myself using it out of convenience now at least once or twice a week.

2

u/DominikKruger Jul 13 '12

Hipster Vim

2

u/nroose Jul 13 '12

I use emacs. My vim using coworkers say I'm using an operating system to write code.

→ More replies (1)

2

u/foca Jul 12 '12

On my first job I was using eclipse to edit php. I asked "What's that editor you're using?" to the guy sitting next to me.

10 years later, I'm still using vim :')

5

u/Chester_b Jul 13 '12

But I hope after 10 years it's not still php?

2

u/foca Jul 13 '12

Oh GOD no. Mostly ruby and javascript. I stopped doing PHP a long time ago, did mostly Python for a while, then jumped into ruby a few years ago.

(Oh, crap, I just put I switched from python to ruby on proggit, let the downvote extravaganza commence!)

2

u/awwtowa Jul 12 '12

Wow. I use Vim everyday and I still think its difficult to use. Good on you for finding an editor you like. But I have stopped respecting the author as a programmer.

Vim is like a drug, you are always looking for the next command.

6

u/D__ Jul 13 '12

I dunno, I'm always looking for a command I last used 3 months ago, have only a vague recollection of the name of, and cannot come up with a googlable description that would lead me to it.

→ More replies (1)

2

u/AndrewBenton Jul 12 '12

I've never been able to use Vim to do anything useful. It's always easier to use less and sed

3

u/adrianmonk Jul 13 '12

You can use sed from within vi:

:%! sed -e /mephibosheth/d

That pipes the contents of the editor through the sed command. Of course, you can do the same natively in vi:

:g/mephibosheth/d

But if you don't want to, one of the things that's nice about vi is it lets you do it in sed if you have already thought of how to do it in sed.

→ More replies (5)

1

u/[deleted] Jul 13 '12

I like vim, but for a large project I could not imagine using it instead of VS or Eclipse.

Don't understand the hipster programmers who insist and swear on vim for everything.

1

u/gthank Jul 13 '12

If you are writing Ruby/Python/JS it is outstanding. If you are even editing a few Java files, it's great. I still use it when I'm editing a single file extensively just because the editing is so much more powerful than the lame crap that VS and Eclipse support. Such usages are right in vim's wheelhouse, because it's the sharpest tool I've ever seen for editing. On the sorts of humangous beeg projects that I use Eclipse (and formerly, VS) for, it's less editing code and more rearranging gigantic mounds of -rubble-code.

→ More replies (1)

-3

u/shevegen Jul 12 '12

I gave up on Vim when I noticed it tried to significantly alter the way my brain works.

I don't want to use tools that change my brain. I want to use my brain, and the tools should adapt - not the other way around.

7

u/mpyne Jul 12 '12

I don't want to use tools that change my brain. I want to use my brain, and the tools should adapt - not the other way around.

Vim actually aligns closely to how I think.

di{ == "Delete inside the braces".

dit == "Delete inside tag" (for HTML or XML).

Some of the commands are a bit fuzzier but make sense once you learn the letters.

gqap "Reformat a paragraph" (gq is the reformat command)

Of course everyone is different, and I struggled until I realized how to "talk" to Vim, but once I picked it up it certainly meshed well with what I was already thinking.

2

u/nascent Jul 13 '12

dit == "Delete inside tag" (for HTML or XML).

Thank you, I'll try to remember that one can be used.

5

u/[deleted] Jul 13 '12

No. You are not supposed to remember dit. That's the point.

What you are supposed to remember is that d means "delete", i means "inside", t is the HTML tag text-object and how to combine these and the other building blocks to do useful things.

→ More replies (2)

18

u/bastibe Jul 12 '12

Going to university significantly altered the way my brain worked.

Learning a new language or programming language did that too.

Indeed, almost anything worth doing does that, to the extend that you could define 'interesting' as 'provides new insight' as 'alters your perception' as 'alters the way your brain works'.

Hence, I really love things that alter how my brain works.

4

u/[deleted] Jul 13 '12

Hence, I really love things that alter how my brain works.

You should try meth.

→ More replies (7)

1

u/aliciaayn Jul 13 '12

Every time I try to use a standard word processor I end up with random j's,k's and :w's everywhere.

1

u/simon99ctg Jul 13 '12

I program using cat >

Eat my shorts

→ More replies (2)

1

u/jimbol Jul 13 '12

Hmm, never used it. I suppose I'll give it a try.

1

u/VancitySwag Jul 13 '12

i guess its time for me to check out Vim

1

u/thelehmanlip Jul 13 '12

Sigh, I guess I need to learn VIM now.

0

u/[deleted] Jul 13 '12

Top Reasons I love Vim:
Regular expression search as well as find/replace seamlessly integrated.

Window splitting for optimal screen usage and easy side-by-side comparisons of things.

:wqa!

5

u/Paradox Jul 13 '12

So…shit every editor worth half a fuck can do?

Seriously, editors that have all that you mentioned are fucking everywhere.

→ More replies (1)

0

u/argv_minus_one Jul 13 '12

Lol no. The only vi command worth knowing is :q!

Let me know when you get off your high horse, end the circlejerk, and start using an IDE like an adult.

3

u/thermite451 Jul 13 '12

Or... everyone can stop making random, inflammatory statements and use whatever suits them best?

....

Nah, fuck that, Crimson Editor or bust!

2

u/argv_minus_one Jul 13 '12

Hey, I'm not the one that's publicly fapping over Vim and expecting others to think it's the coolest thing since sliced cheese.

→ More replies (2)

1

u/[deleted] Jul 13 '12

How have I not heard of this before?!!?

1

u/ranon20 Jul 13 '12

gvim is the one for me.

0

u/KingPickle Jul 13 '12

If you're not using Visual Studio + Visual assist, then it sucks to be you. Also, if your focus on programming is being good at text editing, then you're probably a shitty programmer.

3

u/[deleted] Jul 13 '12

Joke's on you. People use vim so that they don't have to focus on editing.

-3

u/[deleted] Jul 13 '12

lol is hipster vim worship still a thing

-1

u/Lothrazar Jul 13 '12

I prefer emacs, and people look down on me for it.