Vi users: Can Vi do this?
Hi. First of all, I SWEAR I'm not trying to start a flame war, but I am really, really trying to pick a good text editor that I can use for life, and I know I want either Vi or Emacs. I'm just getting started as a programmer in any real sense, but at this point I'm comfortable programming in a few different languages and will definitely be learning more. I despise "smart" modern IDEs for a variety of reasons, and I've grown very attached to the idea of having one development environment that I can use for whatever sort of code I want. I also want to feel that sense of attachment, productivity and comfort I keep reading about from those gurus who really know their editor. From what I've seen, I can get that with either of the two conventional giants.
So I've been playing around with both for a week or so, thinking I could easily decide this for myself, and at this early point I am having a much easier time with Vi. From my extremely limited experience, the keybindings seem more intuitive, and frankly I am afraid of the finger contortions it seems Emacs favors, because there is a lot of arthritis in my family and recently I've started having some pain in my hands (not through fault of Emacs--I'm just looking toward the future). Anyway, I thought I had made my decision. I ordered two or three supposedly great books on Vi and got all excited about a month-long intensive Vi training sabbatical. Then, however, I read a couple of very compelling Emacs testimonials here, and now I am second guessing myself. Look at the things Emacs can do! Wow. Here is one of the good parts, from a guy called emacsdude: Quote:
So can any of you Vi guys tell me if Vi (or Vim, actually) can do all of this too? Thank you. |
Personally, I use both vi and emacs. They both have their place, and that place isn't necessarily the same one. I truly believe that ANYBODY who does a significant amount of Linux programming absolutely MUST learn vi. Not necessarily every single keyword or shortcut, but they must be able to use it comfortably and efficiently, including searching, string replace, jumping to certain lines or columns, etc. This is because a significant number of Linux machines don't have emacs, or kate, or pico, or nano, or any other text editor that might be familiar to them. vi is the standard, it's the default. Find the lowest of the low non-graphical embedded Linux system and what'll it have? cd, cp, mv, and vi.
Now that doesn't mean that you must use vi for everything, everywhere. vi is very powerful, it's VERY fast, and it's efficient, however it does have some limitations...namely many of those listed in your quote. Personally, I use vi for quick edits, reading code, and touchups. I would say that based on the amount of time each editor is open on my machine, emacs would win. However, based on the number of times each editor is opened/closed in some amount of time, vi would win hands down. Need to change the starting value of a variable or the ending index of a loop? Pop open vi, change it, save and quit before emacs even has a chance to open. I can't even count the number of times I ask a colleague to read off the equation used in some program, just to see them open it with emacs, wait for it to open, fumble through the Edit > Search dialogues and finally get to what we're looking for after 20-30 seconds, when they could have found the same thing with vi in under 2 seconds. However, when you get into big programming tasks, the multiple buffers of emacs, the incredibly convenient INTERACTIVE string search and replace (which is even case-insensitive but case-aware! I freaking love that!), the syntax highlighting and auto-indenting (including BATCH auto-indenting...just highlight a block of code and hit Esc Ctrl-\), and the syntax auto-completion just can't be matched by vi. |
Can Vim do it?
0) Yes. 1) Yes. 2) Yes. 3) Yes, with plugins. 4) Completion, yes with plugins, don't know about the other stuff. 5) Compiler can be invoked (like any other program), the rest: I don't know. 6) I don't know. 7) Macros: Yes, Scripting: Yes, but with Vimscript instead of Elisp 8) Yes, so this Emacs person does not have tried Vim, as it seems. 9) Yes. 10) Invoke a shell: Yes, for using vim editing in the shell you have to configure your shell to do that. 11) Yes. 12) Yes. I personally am not a fan of Emacs, due to its excessive (and in my eyes unnecessary) use of keyboard combinations, but I have yet to find something that I need for my personal use that Vim does not offer. |
Quote:
Quote:
How do you do that with vim? That's easily my favorite feature of emacs, and I would be very interested in being able to do it with vim as well. |
@Tirsa:
I really wanted to buy into the emacs hype, but then one day I opened vim inside of emacs and something clicked and I haven't really opened emacs since. I also find vim easier on my hands in general, and that might be more of a factor than I previously considered. As a programmer, you'll find that they both require you to shave the yak a bit and wade into the community to find the missing things you need. Other than that, I think they're roughly at parity in features, it's the implementation that differs by a mile. Good luck in your search! Quote:
Scroll down to #7 for one that's all about managing windows in vim (frames, views, panes, whatever...) Quote:
Second, if someone is fumbling around with emacs, that's not really putting the two on equal footing for comparison, right? I think you knew that, though. :) |
Quote:
From the list, what strikes me is that someone is strongly promoting a particular viewpoint while being rather ignorant of the field. That qualifies the list and the advocacy. You say "I despise "smart" modern IDEs for a variety of reasons" but several of the 'features' in the list are fundamental to IDE's. Emacs is often favored because its focus is towards an encompassing IDE. vi is a contrast because its focus is more towards editing. To figure which is best for you, you will need to gain sufficient familiarity with both - and a few others as well including IDE's - and use them productively on your own projects. That is the only way you will be able to clarify your own preferences and values. You will likely find that different tasks are best done with different tools. A true craftsman is not a single tool fanatic but rather a person who knows and understands many tools and is able to make choices about what particular tool will be best for a particular task for the way he does things. If you are looking to gain an expertise that will facilitate the use of good editing tools, become a regex expert and know the differences in implementation by various apps and libraries and system utilities. speaking of system utilities, you are aware that true *nix gurus do everything with ed? Then there's Teco ... |
This
Quote:
Note that vim = vi Improved, ie vim has more features than vi, but contains all the vi cmds (as well). Note also that (on Linux anyway) 'vi' is often aliased to actually call vim. (The really low envs like embedded and rescue envs will be just pure vi, not vim). Oh, and I personally use vi/vim; just in case you cared ;) |
Quote:
Quote:
Sorry, I don't know any jokes about Teco . . . |
Quote:
|
Quote:
The little experience I have with vi's auto-indenting has been horrible. Whenever I run into a distro that has it enabled by default, I disable it immediately. It's easy to tell too, just paste some code into a vi window, and if it has "auto-indenting" enabled it'll tab the crap out of your code so by the time you hit the end of the 50 line program you pasted you're indented 150 columns over... |
Quote:
It's all about using the right tool for the job. Which is why I use both for different tasks, and wouldn't give up either of them. |
Quote:
I've watched those Vimcasts before, and they're great! Actually, one of the really good books that I mentioned earlier that I just ordered was written by the producer, Drew Neil. It has great reviews. http://www.amazon.com/Practical-Vim-...2&keywords=vim I'm really looking forward to reading it! |
Quote:
Code:
set pastetoggle=<F2> |
Quote:
Thank you. Edit: Wow, I actually found these great videos by Derek Wyatt and I think they have all the information I need about that. These are really good videos. I know what I'll be doing for the next two days now. Might be too basic for some here, but here they are: http://www.derekwyatt.org/vim/vim-tutorial-videos/ I am watching them on vimeo because the quality is better, but the blog gives a list of their proper sequence. |
fyi, vi and vim are not the same thing. although everyone knows you are talking about vim.
Nothing real important to add, but I have only ever used vim and I honestly cant even stand using a traditional word editor or even an email editor anymore. For that matter more times then I can count i have put ":wq" at the end of an email. I would say pick one but dont be afraid of knowing the other... even though I never really have used emacs. |
All times are GMT -5. The time now is 04:40 PM. |