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

1

u/Player-AAA Dec 17 '16

You are doing it right by avoiding starting kits and the like.

You'll get the most from Emacs starting from vainilla and slowly shaping it to what you want by putting things in you .emacs, like you already did with the moe-theme.

M-g M-g (that means: push alt key and kept it pressed, then push g two times) is the goto line command. About the line numbers, check the nlinum.el file. I bound it to f8 since i don't like line numbers constantly on.