Live data from Hacker News

Reasons To Give The Vim Text Editor A Chance

makeuseof.com

31–40 of 68 posts

Re: Reasons To Give The Vim Text Editor A Chance

#31

Just last week I was about to start learning Vim, but after perusing the shortcut list I decided I could do better, so I rolled my own. Basically it's just a multi-modal keystroke catcher/dispatcher running transparently in the background. The upshot is that most of the commands work transparently in my IDE, in notepad, and even this little textbox I'm typing in right now! Unfortunately, the original point was to inc…

Open source it and we can all waste time playing with the code!

Definitely. I'm gonna dogfood it a few more weeks and then throw it up on github.

Re: Reasons To Give The Vim Text Editor A Chance

#32
post #27

Earlier quoted context omitted.

I'm a full-time Vim user. This was my problem when I started with Vim. But then I learned to love GDB and other command-line development tools. At first it seemed a bit archaic to me, a Visual Studio user at the time, but when I got a hang of it, I stopped missing IDE debugging. Now I'm at the point where I feel crippled trying to develop in an IDE (no split windows, to vim-style macros, inefficient use of screen spa…

What about project-wide find and replace? I have been looking to switch to vim, but I do this fairly often and don't see anything that compares to what a good ide can do in vim (without bash command madness).

Try bufdo, argdo, windo, and tabdo depending on the subset of files you'd like to modify. E.g., to replace "foo" with "bar" in all open buffers:

  :bufdo %s/foo/bar/g | update
Although I wouldn't knock `bash command madness' for this sort of task. :)

The Unix shell is pretty much designed for advanced text manipulation across files. E.g., to replace all instances of foo with bar in HTML files, recursively:

  $ find . -name '*.html' -exec perl -i -lpe 's/foo/bar/g' {} \;
vim and the shell are not so far apart and complement each other well, so it pays to understand them both.

Re: Reasons To Give The Vim Text Editor A Chance

#33

Coincidentally, all the points equally apply to Emacs. Well, except the last one, I guess.

Exactly. Emacs doesn't need an elaborate case for its defense; non-modal is more natural/easier-to-learn/BETTER (control-this, control-that) than modal. Not merely my 2 cents -- it's the TRUTH!

Long time vim user here, and I'm considering learning emacs. How do you know it's the truth? And, how did you get started?

Re: Reasons To Give The Vim Text Editor A Chance

#34

Earlier quoted context omitted.

Dvorak has actually been shown to really be no better than QWERTY - http://reason.com/archives/1996/06/01/typing-errors/3

You're right about that, but Dvorak is much easier on the hands. The average distance travelled by your fingers is greatly reduced. (It looks like Colemak beats both, though: http://colemak.com/Compare. )

I type Colemak 99% of the time, but the 1% I don't, it can be a really frustrating experience. It amazes me that 20 years of typing ability was forgotten almost entirely in a month.

Re: Reasons To Give The Vim Text Editor A Chance

#35
post #33

Earlier quoted context omitted.

Exactly. Emacs doesn't need an elaborate case for its defense; non-modal is more natural/easier-to-learn/BETTER (control-this, control-that) than modal. Not merely my 2 cents -- it's the TRUTH!

Long time vim user here, and I'm considering learning emacs. How do you know it's the truth? And, how did you get started?

I've been using emacs since the 1980s, got started in school because it's the editor one of my early comp. sci. courses used. Tried vi a few times, and I still use it occasionally on systems where emacs is not available (this is one real advantage of vi[m] it tends to be on even the most bare-bones systems), but the separate input and command modes have never really felt natural to me.

Re: Reasons To Give The Vim Text Editor A Chance

#36
post #5

I love vim, I use it daily, but always for quick text editing. For real coding I need an IDE (netbeans). I never understood how people can code without debugging, profiling, code exploring. I'll probably get voted down, but, what Vim saves me, I wasted it on debugging. So I don't see any advantage using it as my primary editor.

Well.. apparently people are using "print" still, but fwiw, most professionals I know (including myself) who use vim also use screen, which lets you keep your commandline utils for debugging, etc, a keystroke or two away.

Re: Reasons To Give The Vim Text Editor A Chance

#37
post #7
post #5

I love vim, I use it daily, but always for quick text editing. For real coding I need an IDE (netbeans). I never understood how people can code without debugging, profiling, code exploring. I'll probably get voted down, but, what Vim saves me, I wasted it on debugging. So I don't see any advantage using it as my primary editor.

Most people that use vim also don't use graphical debuggers. I use the "print" statement.

Someday, you'll get to work in a language that has a good REPL, and you'll never want to go back to printing. :)

Re: Reasons To Give The Vim Text Editor A Chance

#38
post #5

I love vim, I use it daily, but always for quick text editing. For real coding I need an IDE (netbeans). I never understood how people can code without debugging, profiling, code exploring. I'll probably get voted down, but, what Vim saves me, I wasted it on debugging. So I don't see any advantage using it as my primary editor.

There is no reason you can't use both. I tend to structure my projects using an IDE but do most of my text editing in vim.

Nothing beats vim for grunting through a pile of code that needs cleaning up. Just set up your IDE and vim to autoload when it detects changes.

My workflow generally goes Edit in vim -> check IDE for syntax errors -> Run/Debug -> repeat.

Re: Reasons To Give The Vim Text Editor A Chance

#39
post #14

Earlier quoted context omitted.

Spewing print statements all over a piece of code is as bad as any other shotgun debugging technique. The reason breakpoints and watches were invented were to reduce reliance on bad ways of doing things.

What's good about print statements is that they don't require me to do anything more than once. When you run code in a debugger, there is a lot of manual interaction involved. continue, break, see where you are, think about that, poke around, repeat. With print statements, you run your test, analyze the output, and make the changes. It's all automated except for the analysis step, which is all the human should be doi…

I agree somewhat (although I do feel that debuggers are useful) in that IDEs can influence the design of your program by encouraging a debug first development style similar to "programming by coincidence"

Re: Reasons To Give The Vim Text Editor A Chance

#40
It's not surprising to see that the logo isn't amongst the list :)

I use a mix of Elvis and Vim as I'm training up on vi-likes, and I'm not sure which I prefer yet. Vim has more-intuitive-to-me stuff like character-by character deleting (ie characters are removed when you delete, not when you leave Insert mode), but elvis has things like pressing = twice to reflow paragraphs.

Vim may win in the end as Elvis is hard to google for...

Post reply on HN