Vim is a great text editor - try it
joelhughes.co.uk
joelhughes.co.uk
* Why, oh why, do those nutheads use vi? http://www.viemu.com/a-why-vi-vim.html
* Graphical vi/vim cheatsheet & tutorial http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
There may be a steep learning curve ...
Can someone explain the axes of the graph in which "steep learning curve" equates to "takes a long time" ??I can.
It requires that you put knowledge on the X-axis, and time on the Y-axis, which is completely at odds with the usual way of doing things.
Like many idioms you have to read this as meaning one thing even though it says another. You have to read this as "it takes a long time," even though that's not what it says.
Language - I don't know how it works.
And sometimes it doesn't.
</rant>
Having thought this through a little more, it seems more like bumps. For example, you can't do anything with Vim until you learn basic motion and insertion. That a bump. Then, you learn how to use the more complex motions, and get another bump. With something that has a steep learning curve it is done in bumps, rather than being smooth, because partial knowledge doesn't help any. If you think about it, if you only know the j and r commands in vim, you're not going to be doing anything at all, you're going to need to know at least hjkli before you can even use it.
Neither a pedagogical nor an intuitive analogy -- but fun!
Since I don't write parsers for natural languages, I like that kind of expressions more than they irritate me.
vi fans might think that is related to me prefering emacs... :-)
Edit: Grammar, spelling. Sigh.
esc (escape) = go to the default mode
i (insert) = when you want to make changes to the document
esc + : (escape, colon) = think of this as control + whatever
:w = (w)rite - save your file
:q = (q)uit - quit vim
:wq = (w)rite, then (q)uit
:q! = (q)uit!, discarding any changes
Just those few things will let you use vim well enough while you're figuring out all the really cool stuff it can do.Emacs can be treated similiarly: C = control M = "meta", usually the alt or option key. You can use escape if you want.
C-x C-f = control x (do something) + control f (find file) - open a file
C-x C-s = save a file
C-x C-c = quit
C-k = (k)ill - this is similar to cut
C-y = yank - this is similar to paste
For emacs, it may be easier to start with cua mode - M-x cua-mode
(btw, m-x means "run this function")
Cua mode gives you a copy, cut and paste that works the same as your operating system.The main reason to learn vi is that it is installed by default on so many systems, including most ancient Unixes.
When your task is to edit a config file and you don't have time/permissions to install your editor of preference.... vi is the only choice.
Emacs and others may not be present on a system when you really need it.
A basic competence in vi is essential if you're going to deal with Unix. Even if you prefer Emacs (like me) or other myriad tools.
Also, it's worth learning ed because the ex prompt in vim shares most of its functionality, and because sooner or later you'll realize how lucky you are that you don't have to work on a teletype. :)
I.e. how good is it at handling projects, as opposed to just files?
You can also plug it into Eclipse via eclim http://eclim.sourceforge.net/
" session.vim
tabe file1
tabe file2
tabe file3
...
when i start work, i do gvim -S session.vim and i'm all set.It's not about the subject, it's about the content.
There are still interesting discussions to be had about multiple-decade-old text editors, but this is not one of them.
Having said that, I would like to add something positive to the discussion. I think whichever editor you choose, you should learn to move the cursor around without using the arrow keys. There is considerable value in keeping your hands on home row. Every time you reach for the arrow keys you add latency to your workflow. It adds up.
I think you're completely ignoring the next generation of hackers, which is unfortunate. I've been working on getting past vim's learning curve for over a year, on and off. True, this submission sucks, but it lead me to find this: http://www.viemu.com/a-why-vi-vim.html, which is pretty informative for a beginner.
However, this does not require the spamming of "editor" advocacy posts (where "editor" has meant "vim") recently.
In the mean time, maybe the discussion will justify its continued existence on the front page.
http://cd.textfiles.com/fredfish/v1.6/FF_Disks/571-600/FF_59...
It took me a long time to finally get comfortable with Vim. I would load it up every few weeks, learn a couple of commands or things like using split windows and then get frustrated/held up enough that I would go back to Textmate. After going through the process for a good few months, I then somehow managed to make it through a day without getting frustrated once. Then on the second day I literally felt like I was flying through my code. TBH I have never felt this productive in an editor before.
I would constantly read people saying that watching someone in Vim is like a work of art and never quite understood what they meant. But now I do. The speed at which I can navigate through a file, move text around, move around my project. Even simply never having to move my hands away from the home row makes me feel more focused on what I'm currently working on.
Please do not do this. It leads to really banal "vote up if you like _ too" posts on the front page.
I think a lot of people find vi unpleasant because it so unapologetically makes the trade-off of having dozens of (composable) single-character commands you have to memorize upfront, rather than a more conventional interface whose advanced features you can gradually learn. You can't really get an accurate impression of vi's strengths until you've already committed to memorizing a lot of commands - the terseness itself is a major feature in the long run. (Emacs is similar in this regard, but with very different trade-offs.)
For most programs, this trade-off is probably hard to justify, but for something that one spends a lot of time working with directly (such as a structurally-aware text editor, photoshop, autocad, etc.) it's probably reasonable.
When I'm editing big files/coding I use Cyberduck to SSH/SCP files over to TextMate, which works well most of the time. The only time it doesn't work is when I need to sudo edit that file, because Cyberduck can't sudo.
Also, Komodo Edit ( http://www.activestate.com/komodo_edit/ ) is a modern free, multi-platform editor which has nice Vi support.
You see, cults that are divorced from empiricism _do_ exist in CS; I'm sure of this. But I'm not sure of whether people who feel such strong love for the command line belong to one or not.
As a pure text editor, Vim seems really nice. However, once I start wanting to do what I take for granted as fairly basic things, I want the mouse and graphics more and more. For example, say I just want to have program output, a couple of code listings, and a visual debugger all on the screen at once across multiple monitors with integration between them. People swear that the Unix prompt is better anyway. However, they all seem to be programmers whose careers peaked in the 70s or 80s too! I'm a Unix neophyte but my first impression in trying to do C programming in vi is that without all the comforts that something like Visual Studio gives me, it just sucks. I'd love to be proven wrong actually, but the people on the other side of the argument also seem to be dinosaurs (albeit genius dinosaurs) who don't even think that trace-through debugging is a good thing. Heck, even Linus lost that fight.
Vi-style editing inside a modern IDE like Eclipse or Visual Studio does seem interesting though.
C programming in vim might seem masochistic compared to Visual Studio. I'd suggest that Emacs offers a richer set of features when building software in C, complete with autocompletion, SCM integration, and build commands.
You can also use Emacs (or just GNU Screen) to have split views of source code and program output and the debugger (gdb) in one window. The real advantage of the command line environment is the ability to create new tools. When you're in Visual Studio or Eclipse it's a much more formal and involved process to create a custom command or automate something and integrate it with your workflow. With the CLI you can just throw together the tool you have in mind in whatever language is most suitable, and integration is not an issue because the shell (hosted in Emacs or not) is an integral part of your "IDE" at this point.
Compared to tools like Visual Studio and Eclipse, the trek is longer but the peak is higher with Emacs and the CLI.
What are these, anyhow? Whenever I've used Visual Studio or Eclipse it's felt like a burden.
Integrated debugging. (I know gdb is incredibly powerful, but it seems too much to have to reprogram my brain for yet another editor within an editor.) Errors and warnings appearing while I type. Ctrl+click to go to source for any function I'm viewing. Variable and function auto-complete. Integrated documentation for functions that appears as I am typing. Quick and easy navigation of a file hierarchy. (I know vi and emacs allow this but it requires a level of mastery and key memorization for benefits that seem far from clear to me.) Managing project settings. Refactoring.
For someone that has achieved mastery over Unix over many many years, these things either seem unnecessary or they have a substitute (that's perhaps even better). However, I guess I'm wondering if there is a group of people who aren't old programmers from the 80s who started with something like Visual Studio or Eclipse, used it enough to achieve a level of mastery over programming that way (with a brain trained to use the mouse), and then after that found a gain switching to command-line type tools, that was worth the many many additional hours of brain re-training.
I now use a number of editors and IDEs. Vim is not not of them. I launch it once in a while, just so I would not forget how it feels (and would not forget how to :wq). That's all.
As far as the holy flame war on editors, I do not have much to say about it, and will avoid reading much about it.
I use both, but tend to use them in different situations. Major, multi-file editing in Emacs, but quick edits or work on other computers in vi.
More comparison: http://news.ycombinator.com/item?id=230990
Plus, I'm not buying it. If it's so great, why do you even have to market it? Wouldn't it just sell itself? But no. Instead we get these "VI is great" vs "Emacs is better" discussions every-f*cking-time. And I've had it. Just use your old, old, old piece of software, be happy about, and stop trying to convince me.
That's kinda silly. That's like saying "why does Apple spend jillions of dollars marketing the iPhone if it's so great?" Some people genuinely don't know about [pick your editor], and some people like their tools so much, they like to tell you about them. Isn't that the whole point of blogs, anyway?
Because it leads to massive profit. I don't think it's pure altruism motivated by a desire to give better user experiences.
quit being a curmudgeon. this is one happy human sharing something they love with others. if you don't want any of it, just keep moving. your negativity does not advance the human condition.
I guess to compare, you'd have to have used an IDE with GUI for 13 years too? I bet you'd be very effective that way too.
Others, who basically edit text for a living, like to explore their options.
You don't rant at every ad you see, do you?
If it's so great, why do you even have to market it? Wouldn't it just sell itself?
Countering this is a common meme in HN articles - that you can't just write some polished software in a room somewhere and expect people to beat a path to your door for it.