7 ms·
(Serious) I really want to learn either Vim or Emacs but I've never been able to decide which one to learn. Every time I've tried to search about this topic I
by Raphmedia 10y ago
(Serious)
I really want to learn either Vim or Emacs but I've never been able to decide which one to learn. Every time I've tried to search about this topic I end up in petty wars. Help?
- Tyr42 10y agoJust use whichever your social group uses, as they'll likely be helping answer any questions about it. Then, if your friends use emacs, use evil-mode because vim is the best.
- IanCal 10y agoThey're both great, but have different philosophies. Just try one and see if you like it. If you really don't get on with it, try the other one.
- bandrami 10y agoEven though I'm more of an Emacs user, I'd say if you're going to learn one, learn vi. Not vim, mind you: nvi, the original one (you can emulate it in vim with "set compatible"). Use it for a few months until you get muscle memory for it. Just about any UNIX-like system you'll work on, anywhere, has at least the old vi, and it's very useful to just have that muscle memory tucked away.
- Raphmedia 10y agoThat's actually a very good point. Thanks!
- moosingin3space 10y agoWhat's more, if you prefer the Emacs environment, you can run a vi-like editor in it (Evil). Emacs keybindings, on the other hand, are the default keybindings for GNU readline, which is used in a lot of shells and related programs. Additionally, I know that OS X allows you to use Emacs keybindings in any text field. (I am not a mac user, can't comment on this.) (Disclaimer: I am a happy Spacemacs user, and it would take a lot to pry it away from me.) I'd recommend learning vi, so you can learn how awesome modal editing is. Then, learn Emacs' basic commands for line editing (so as to make readline apps easier to work with). Once you've done that, evaluate whether a (Neo)vim with plugins or Spacemacs setup is better for you, then choose one of those.
- DeadBabyOrgasm 10y agoAs an avid vim user who has tried Evil mode, emacs, and even spacemacs, I fully agree with all of the reasons you listed. To add to it: - *-mode (specific syntax highlighting, commands, etc. based on project or task) - edit/save remote files via built-in TRAMP [0] - built-in plugin manager (interactive, or via emacs init config) - MELPA [1] - Non-blocking (e.g., run tests in one buffer while editing source in another) - client-server approach (neovim adopted this, but emacs has had far more time to work out the kinks) The main reasons I stay with vim are: - already committed to vi-like muscle memory (and evil-mode, while admirable, doesn't cut it) - no translation of VimL configs and plugins to Emacs Lisp - many plugins for languages, frameworks, etc. which I use daily are severely out of date in emacs (and I'm too lazy to maintain them myself) [0]: http://askubuntu.com/questions/79100/how-to-open-a-remote-file-ssh-with-my-local-emacs http://askubuntu.com/questions/79100/how-to-open-a-remote-fi... [1]: http://melpa.org/ http://melpa.org/
- moosingin3space 10y agoI prefer the Emacs environment: I love TRAMP, org-mode, and the simplicity of getting a fully-featured IDE just by adding a list to my spacemacs configuration. Do you use neovim?
- frederikvs 10y agoAs a vim user, I have to disagree with the "Not vim" part. Learning only vi would lose too many of the advantages of vim. Use vim, learn vim all the way. If/when you're working on an "old" vi (e.g. the one in busybox, for embedded developers), you'll need to drop some of the more advanced stuff, but you'll still be able to do what you want, edit some config file or such, though it may feel a bit awkward at times. But when you're doing the heavy editing, you really want to use all of vim.
- bandrami 10y agoDisagree. I'm talking about building basic editor muscle memory and knowing the base set of ex commands that you can use literally anywhere. For that matter I'd say what's really important is that you learn ex.
- WhatIsDukkha 10y agoVi is vim without text objects ie pretty poor (and one of the most important things a vim user should know). Your advice is very misleading in 2016. I don't think there is an active vi codebase, vi is actually vim in compatibility mode in most operating systems.
- bandrami 10y agonvi is actively maintained by the BSDs, which all ship it as the default system editor. Apple did too until IIRC two versions ago.
- frederikvs 10y agoI'd advise you to learn vim, for a couple of reasons. The main one is the concept of composability [0] - in vim, you're speaking a mini-language. You have commands (delete, copy, make uppercase,...), and a number of movements (right, down, to the next occurrence of a word, to line 27,...) or objects (word, line, paragraph, html tag, text within quotes, ...) to work on. These can be combined in any way you like, any command can be applied to any movement or object. So if you have a plugin like vim-angry that adds a "C-style function parameter" text object, all the commands you know can be applied to that. In contrast, in emacs, you have a number of commands (kill-line, kill-word, ...), and that's it. You have to get by with those. If they didn't implement the command you'd like to use, tough luck. A second (minor) reason for me is that I work in the embedded software world, and usually on an embedded linux, there's at least some variant of vim or vi available, while emacs is very rare. Take my advice with a grain of salt : I've never really used emacs, so I can't compare from first hand. From what I've heard, emacs is also a very good editor. To me, the question "should I use vim or emacs" is more or less the same as "should I use firefox or chrome" - I'm a chrome guy myself, but I don't consider firefox to be crap, nor its users to be idiots. Internet explorer on the other hand,... So my advice : learn vim. And if you don't, learn emacs. Just learn to use either one properly, and you'll be way faster at editing than people who don't use those. [0] a.o. https://medium.com/@mkozlows/why-atom-cant-replace-vim-433852f4b4d1#.ot06wyos5 https://medium.com/@mkozlows/why-atom-cant-replace-vim-43385...
- omaranto 10y agoI'm not sure I'm convinced by the composability argument. Isn't composable the default for text editors? Emacs (and most text editors) let you select a portion of text (Emacs calls this marking a region) and then decide what to do with it: delete it, cut it (Emacs calls this killing), convert to upper case, etc. Vim mostly uses the other order: Commands first, motion or text object later (except in visual mode where it's like other editors: Select something first, command later). So you just need to implement a bunch of selection commands to get Vim-style composability. I think lots of these modern text editors like sublime or atom come with select word, select parenthesized expression, select paragraph, etc. If the editor is extensible you can define new selection commands and compose them with the existing commands that operate on a region, just like Vim. Emacs certainly has a bunch of marking commands. The extra commands you mentioned in Emacs (kill-word, kill-line, etc.) are just for convenience: Shortcuts for common cases. In Vim you can delete to the end of the word with dw. In Emacs you could also do a 2 keystroke solution: do mark-word, delete-region (you could use backspace, Control D or delete for that second second thing since they "operate on the region of the selection is active", so C-@ <backspace> would do it). Unlike Vim you also have the option of a single chord with the convenience command kill-word.
- omtose 10y agoI was sort of in your situation a while ago and wanted to learn vim, but was a bit put off by all the legacy that it carries (also spoiled by sublime's multiple cursors). I then discovered kakoune[1] and liked its design. I started getting familiar with it and using it more and more, and I think its core is much more solid than vim/emacs. It definitely doesn't have the same community support and plugins but it's already quite feature rich. [1] https://github.com/mawww/kakoune https://github.com/mawww/kakoune
- Karunamon 10y agoIt'll probably be easier to go from Vim to Emacs (since Emacs has a really good Vim emulation plugin) than the other way around.
- shubb 10y agoVim is a useful skill to have because sometimes you need to configure a server. However, I'd encourage you to really learn a modern editor like Sublime before emacs, then visit emacs long enough to figure out if you want it.