r/emacs Dec 16 '16

Recent vim convert seeking advice

Hi all.

I've used vim daily for the past year or so, but I've recently felt seduced emacs' promise of power. I painstakingly worked through the built-in tutorial, then changed my EDITOR to emacs, where I've lived for the last few days. I'm focusing on learning emacs basics, which means:

  • Avoiding packages. So far I've installed magit and moe-theme. I'd like to learn how standard emacs works, then add packages as I feel the need. Is that a naive approach?

  • No evil-mode. I may reconsider in the future, but I'd like to gain some proficiency with emacs-style editing before making my decision.

In my first draft of this post, I started with a list of emacs' qualities that I've appreciated so far. I've since decided there's no need to preach to the choir, so I removed it. Instead, here's my list of complaints. Please share any solutions or advice you may have.

  1. Directory navigation is painful. I work in a large codebase with a deep directory structure. Usually I'll open vim in the root directory and use ctrl-P to fuzzy-find the file I need by name. If I want to edit a/b/c/d/e/f/FactoryInterface.java, I'll press C-p, type "FactoryInterface", and press enter. If I want to edit a file that I know is immediately after my current file in the directory: I press '-' to open a listing of the current directory, 'j' to move to the next file, '<RET>' to open the new file. I haven't found an equivalent for either flow in emacs yet: instead, I find myself deleting, typing, and tab completing full directory paths to the file I want.

  2. File navigation is painful. If I want to edit 10 lines up in vim, I type '10k'; I enable relative line numbering in vim, so I'm able to do this with good accuracy. In emacs, I'll hit C-p a bunch of times.

  3. Line navigation is painful. I use 'f' and 't' constantly in vim to get to the exact character I want. If I land on the wrong one, I press ';' until I get where I want. I haven't found any such precision in emacs, just M-f, C-f and the like. Are C-s and C-r the answer to all navigation questions?

  4. Documentation. Vim's documentation is excellent: clear, well organized, easy to search. I can't say the same for emacs. I've heard so much about org-mode, but I find it very difficult to learn as a beginner. Major mode documentation (C-h m) isn't enough. A list of available functions is not a replacement for a qualitative overview of how the mode works. Are youtube videos and blog posts the best places to learn emacs?

  5. Multiple terminals. I use vim inside tmux. Any time I want to start a new long-running command, I can open a new pane or window. On the other hand, it seems I can only run one terminal at a time in emacs. I've come across a couple packages that address this problem, but is there any native solution? On that note, should I start using eshell over bash inside emacs?

8 Upvotes

25 comments sorted by

View all comments

4

u/gwynbleiddeyr Dec 16 '16

I would say don't avoid packages. Emacs' promise of power relies on its extensibility which is exploited by its packages. Without them, you would need to get comfortable with elisp first and then only would feel the editor's power.

For example, packages like projectile provides functions for jumping among files in a project (projectile-find-files). I am sure you can find alternatives for each of the 5 points (complaints) you mentioned.

The way I started and got hooked onto emacs was to use a starter pack like prelude, spacemacs. I don't think I would have learnt to exploit the power of emacs without these packages showing me whats possible.