Hacker News new | ask | show | jobs
by camflan 6135 days ago
vim
10 comments

+1, vim hands down. Cross platform, powerful, lightweight, configurable, etc
another +1, but you need to learn to use it properly. Tags, windows, changing files, external commands, macros, etc. It's not user friendly, in fact it's downright user hostile, but it's powerful, and written for hackers.
vim is one of the most user friendly pieces of software I have ever used. The interface is incredibly efficient. The designers put great effort into making sure that common tasks were one or two keystrokes that usually don't even require moving your fingers off the home row.

Just because it's not the most discoverable interface doesn't mean it's user hostile. I wish more software designers would look at vim as an example. A text editor falls into the category of software which users spend a ton of time using. For those types of software a steeper learning curve is completely accpeptable if it means the users can operate the software without even consciously thinking about it once they've learned how to use it.

Reading this crystalised some thoughts I've had for a long time, but never been able to express clearly.

Yes, vim is a non-discoverable interface.

http://www.google.com/search?q=discoverable+interface

( Side note: from that search I found this:

http://www.catb.org/~esr/writings/taouu/html/ch01s01.html

There it lists "... concision, expressiveness, ease, transparency, and scriptability." It then expands on each, but mysteriously quote "Discoverable" in place of "scriptability." Very odd.

But I digress ...)

Now the question is - without having to wade through plodding tutorial after plodding tutorial, how can we help people discover the interface? This doesn't just apply to vim, it applies to your web site, or application, or even your company procedures.

It's now a long time since I learned about :sp and ctrl-w to create and move between windows in vim. How can we help others find these things? How can we help them find the fast way of doing things on our web facility?

As a parting note - I wouldn't equate efficiency to "user-friendly."

First problem: vim has already implemented any feature you can imagine, with more refinements and related features than you can imagine. But you have to imagine it before you can find it...

Second problem: And even then, you can't find it in the help (it's organized like a professional index - like that of a legal textbook - you have to know what you're looking for before you can find it). Google solves this problem.

Google also helps solve the first problem, of "what to search for": you search by describing the difficulty or problem you have. A brilliant resource for this is Stackoverflow. It's works well for developer-centered, technical questions. The internet is the vim help: "a user generated FAQ". But this is just a way to cope with poor discoverability - the real answer is to design the interface to be discoverable.

You only need 1 tutorial to discover vim, and it comes with the program and requires 20 minutes.

For me "discover" means "edit without the mouse." Once you do that, you're hooked - you can discover the voodoo magic at your leisure, from then on.

More vi/vim tips in the MOTD/fortune issued on login on some hosts (FreeBSD pops to mind).

fortune in /etc/profile is something I miss about older Unixes and Unixalikes that seems to be evolving away.

Actually, I found vim quite discoverable, you can pretty much type :help <topic> on anything and you'll see ton of stuff around that are interesting.
I agree. It's like Photoshop: at first you're like "WTF were they thinking?" until you really use it and see what geniuses they were.
Downright user hostile? Vim has the best help system I've ever used. Everything is documented, and a few keystrokes away
You're very right. I've been using it for years and I still haven't gotten around to 'properly' learning vim.

It's not exactly laziness, it's more that I got really spoilt at some point in the past by writing my own editor, but maintaining and porting it to new platforms as well as lots of work on customer machines has made it infeasible to keep the project going.

So, I use vim. But at the bare minimum level, I really should go and do something about that.

Thanks for the prod!

You don't really have to learn how to use all the bells and whistles for it to be effective and ideal. Heck, I use it because it saves me having to transfers files or allows me to develop on a separate box through ssh if I don't feel like setting up expand drive or the likes.

Also, hjkl is the most beautiful thing I've ever experienced, I constantly wish TextMate and VisualStudio gave me the separation from edit/navigate mode like VIM does.

I recently discovered mvim on OS X and it really convinced me to buckle down and start to learn and more importantly use vim again as my primary editor. One thing I find is that you need to do a fair bit of customization before vim fits for you. I stumbled onto Todd Werth's vim configs (http://blog.infinitered.com/entries/show/9) and they were immensely helpful to me in finding ways to make vim more useful and efficient. For most of the coding I do, vim is now my favorite editor.

That said, it does depend on what kind of development you're doing. I think that in some cases, you can make life harder for yourself by straying from what most developers in your chosen language/framework are using. If I need to code up some .Net stuff, I'm going to use the MS tools. Likewise, if I'm doing heavy Java work, I'm going to likely use Eclipse (even if it's a tad bloated for my taste). If I'm on the Mac doing iPhone development, I'm going to use XCode. Sure, I could use vim for all of the above, but these IDEs are already very well optimized for their respective languages, and vim feels a bit out of place for me.

I also like vim but I sometime feel jealous of the emacs users for debugging and org mode.
I have tried to use Vim a few weeks back. It works great. I have the minibuffexplorer and NERDTree installed. So it was basically like an IDE for me.

BUT everything goes downhill when the "window" arrangements are messed up. I am like, WTF did this open in the upper window. HTF do I move this "window/screen" from A to B. When this happens, I restart Vim and then open the files again. Really annoying. I wonder how expert Vim users go about this issue? Any tips?

:h windows

I prefer using tabs with Vim. Here's a short overview:

* :tabnew to open a new tab.

* :tabe <FILENAME> to edit a file in a new tab.

* :q or :close to close a tab.

* :tabnext and :tabprevious to move between tabs.

* Ctrl+PgUp and Ctrl+PgDown are bound to :tabnext and :tabprevious. On my MacBook, I bind those to Cmd+[ and Cmd+].

* And, of course, :h tabs to find help.

I have added these line in my .vimrc.

map th :tabnext<CR> map tl :tabprev<CR> map tn :tabnew<CR> map td :tabclose<CR>

Why th and tl? You already have gt and gT.
Well just binding it to h/l combination. Easy to follow.
I use my window manager for managing windows, unlike a lot of vim users. Most ppl don't think about it too much, but maybe your window manager is the problem? Maybe it should do what you want vim to do. Have a look at a tiled wm like dwm, wmii or awesome.. etc...
Is there a "learn you a vim" or "poignant guide to vim" out there? Because the handful of times I tried vi/vim I got some stuff done, but didn't really grok it.

This goes for Emacs, too. I get the feeling I've never really used these tools the way they're meant to be used.

The best way to start with Vim is the included 'vimtutor' command, which opens up a document that guides you through basic editing operations (on itself).

After that, being around other Vim users (in person, on the vim-users mailing list, or subscribing to the !vim group on identi.ca, etc.) is best - being able to ask someone "Is there a better way to do X?" or have someone watching over your shoulder say "I can't believe you're doing that the slow way!" is a great way to learn.

The best long-term solution, I've found, is to remember that laziness is one of the great Programmer Virtues, and pay attention whenever some editing task gets tedious, and take a moment to look for a solution in the (amazing complete and well-indexed) Vim online help (":help") and perhaps the Vim Tips site (http://vim.wikia.com/)

you can check out these links http://www.moolenaar.net/habits.html, http://jmcpherson.org/editing.html, http://www.viemu.com/a-why-vi-vim.html. I loved vim after reading these articles.
Vim tutorials, splitting the beast into manageable chunks:

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...

I'm curious if anyone is using vim on windows as the OP mentioned he is using Notepad++ and Visual Studio (both Windows environments)? If you are using vim, what has your experience been like?
I use it with cygwin, because the unix utilities are a must have.

You can use it natively, and it works fine too, but I really like my unix utils

Works fine. Unfortunately, developing without Unix stinks. and Cygwin is a hack (very slow). Vim is much more powerful with Unix tools on hand. I learned Vim on XP (no choice of OS, so it was the best choice).
No need for cygwin (for some things at least). I downloaded the win32 ports of GNU utilities, and put them all in a directory which I then add to the PATH.

http://unxutils.sourceforge.net/

Doing so, not only can I use them in vim (!sort, !ls, etc), but I also get a friendlier cmd :)

Voxli uses gvim on Windows and Mac, without Cygwin. I switch to Visual Studio or Xcode for debugging and compiling, and it's never been a problem. There are also some clever plugins to open a pipe to Visual Studio so you can kick off a compile directly from Vim, but I haven't needed them yet. Also we had to write some scripts to feed the proper paths to etags depending on the development environment (include Windows or Mac toolkit headers, etc).
To compile from Vim, use vcbuild (for C++) or msbuild (.NET) as your makeprg (you will need to add them to your path first. For vcbuild you can do it by using "%VS90COMNTOOLS%\vsvars32.bat"). Then set errorformat and your ready to go :)
Derek Wyatt is creating a very nice screencast series on Vim.

Check it out: http://derekwyatt.org/

Read this a while back and remember enjoying it quite a bit. (He talks about vi + other stuff).

[Original source seems to be unavailable at the moment]:

Interview with Bill Joy, August 1984, Unix Review magazine http://74.125.95.132/search?q=cache:N14AkASeqMoJ:www.cs.pdx....