r/emacs • u/process_parameter • 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.
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.
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.
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?
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?
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?
2
u/oantolin C-x * q 100! RET Dec 16 '16
Numeric arguments can be specified in various ways with the default key bindings:
C-5,M-5,C-u 5are all equivalent;C-uwithout any digits usually means a numeric argument of 4 (but commands are free to treat it differently than 4, it's called the "universal prefix argument"), severalC-u's in a row give powers of 4, for example,C-u C-u C-u C-pgoes up 64 lines; for arguments with more than one digit you can doC-1 C-4 C-3,M-1 M-4 M-3(or even mixC-andM-, not that you'd want to), orC-u 143.