I am looking for tips for learning Vim or Emacs the smart way

后端 未结 18 1756
迷失自我
迷失自我 2021-01-29 20:34

I am a quite happy user of Eclipse (I mostly develop in PHP and Python), however I found the answers to \"What specific productivity gains does Vim/Emacs provide over GUI text e

相关标签:
18条回答
  • 2021-01-29 20:44

    I would go for Emacs. Explicit command name will makes your task easier. I switched to emacs after I had years of experience with vi and never looked back. Go with tutorial first. Hang out at #emacs in irc and people are happy to help you in real time, for whatever more you need.

    0 讨论(0)
  • 2021-01-29 20:44

    Maybe, a good way is to learn vim/emacs while using eclipse. Try vimplugin or emacsplus plugins for eclipse.

    0 讨论(0)
  • 2021-01-29 20:46

    Using VIM, I find the following quick reference card very helpful, especially for the stuff I don't do everyday: VIM QuickReference

    For emacs, you should read the GNU Emacs Manual. Don't try to do everything all at once. Start with the basic stuff, and then move on to the more powerful features once you're comfortable with the easier stuff.

    0 讨论(0)
  • 2021-01-29 20:47

    Nearly everything you see or interact with in Emacs can tell you about itself -- you just need to know how to ask it.

    To learn Emacs, learn about the current Emacs context: what the values of things are, what the relations between them are, how they are denoted, how you can change them or otherwise interact with them.

    The most important thing to learn is that Emacs is Emacs Lisp -- it is a Lisp ecosystem. Learning Emacs means also learning Emacs Lisp -- the more you know, the better. Lisp is the most flexible and most powerful way in which Emacs realizes itself as "the self-documenting, extensible editor".

    Icicles can help you learn Emacs and Emacs Lisp. It helps you ask Emacs about itself. This page gives an overview of the ways it does that: Emacs Newbie with Icicles.

    0 讨论(0)
  • 2021-01-29 20:50

    I would advise that checking out both is worth the time because of various reasons already covered by other answers or "Emacs vs vim vs XY" threads.

    Still if you would have to pick one of them I'd go with vim because of one thing:

    Availability

    Vi(m) has the advantage that it is installed (not only available) by default on almost any *nix system. So no matter whether it is your system or someone else's or whether you are allowed to make changes to it or not, your favorite text editor and friend is there waiting for you.

    Once you know vi(m) it feels awesome in those situations where you ssh into a machine and need to do something with text (navigating through a file, editing, whatever). You are going to feel like a King. I remember several times when I almost freaked out because nano or pico were not installed and I had to use "this ugly beast vi" which made unpredictable things when I started typing (because I wasn't in insert mode and didn't even know what that was) and when I was happy to have googled that ":wq!" gets me back out of hell. Now I can look back and smile about it.

    I have the general feeling that vim and emacs are not the kind of editor you learn by "playing with it" though

    Vim and Emacs are certainly editors that you "learn by doing".

    Of course the question cries for including these highly scientific text editor learning curve graphs =)

    classical learning curves for some common text editors

    Vim might be a bit harder in the beginning because its modal editing can feel quite unfamiliar at first. I think motivation is the key here. The article "Why, oh WHY, do those #?@! nutheads use vi?" explains the advantages quite well I think. In my opinion it really is worth to give it a try even while the learning curve might be steeper than with other editors and it sounds like you bring the necessary motivation.

    Back to learning by doing.

    Something I wish I would have done the first time:

    Check out Vimtutor. It is an interactive tutorial which demonstrates the power of vim by showcasing it's basic commands and how they can be composed. Just type vimtutor in your terminal.

    This helped me to really "get it" after trying to learn editing with vim several times in the past. The tutorial eases the learning curve dramatically as it explains the commands and makes you actually perform them so they become a habit. It really makes a difference compared to being frustrated because of feeling handicapped. Using vimtutor you also will see what the benefits of modal editing are and instead of fighting or ignoring it you are going to embrace it because you have experienced the advantages at first hand. I guess it would be pretty difficult to learn that all by oneself. So these 30 minutes are quite worth it.

    0 讨论(0)
  • 2021-01-29 20:53

    I have the general feeling that vim and emacs are not the kind of editor you learn by "playing with it" though.

    My experience with emacs is actually quite the opposite. I tried going through the tutorial, but it didn't seem to help much. The way I ultimately ended up learning is with a reference card and just forced myself to use emacs on my code until I got it correct*. Then again, I do also have a screw loose. Your milage may vary. Offer void where prohibited. You get the idea.

    One other piece of advice I recall reading somewhere is to try writing down a list of about 10 commands you want to learn and keep it by you while coding. Once you've mastered those commands, make another list of 10 more. Keep doing this until you've got a big enough chunk of the editor committed to memory.

    *Note that the linked reference card is out-of-date. If you google, you can get a more up-to-date reference card.

    knowing that I have no prior experience whatsoever on any of the two, and that I use and develop (mostly PHP and Python) on GNU/linux systems (ubuntu, archlinux), is there any of the two which would represent a better option to start with?

    I'm an emacs guy, so my opinion should be obvious. That said, you're likely best trying out the one that more people you know seem to use. Having someone who's experienced with emacs (and I'd assume vim) is a great help.

    If you don't know anyone who uses either one, choose whichever one you feel is the prettiest or has the coolest name. You won't know enough to know which one you'll like, so you might as well choose arbitrarily.

    0 讨论(0)
提交回复
热议问题