4 ms·
I have been a Vim user for as far as I can remember. Now I am transitioning to Emacs. I keep hearing that you can "live" in emacs but I can't seem to have that
by mrbonner 6y ago
I have been a Vim user for as far as I can remember. Now I am transitioning to Emacs. I keep hearing that you can "live" in emacs but I can't seem to have that revelation, yet.
For example, I often find myself quit Emacs to jump to a different directory just to open a file. I think I am doing this wrong. I have tried Dire/Neotree but those are not providing enough convenience imo.
Do you you a workflow or setup to "live" in emacs? Note: I use pure Emacs and not spacemac or Doom.
- jsrjenkins 6y agoThere is a special mode for looking for files called "Dired". It is very powerful, especially with the extensions. This link is a good introduction to it: http://pragmaticemacs.com/emacs/dired-marking-copying-moving-and-deleting-files/ http://pragmaticemacs.com/emacs/dired-marking-copying-moving...
- kfoley 6y agoYou can navigate to files in Emacs using `find-file` (C-x C-f with standard key bindings). That should prompt you to enter a path, which, without any customization, should perform very similar to a shell prompt in terms of using tab for file completions. A huge improvement to this in my opinion is the use of a completion framework package. I use ivy[0] but helm is also popular and there are others. The main draw in this case is instead of having to tab through completion candidates, they appear as a vertical list which is updated as you type. It also allows more advanced filtering, for example by regex which I find a lot easier to use than shell completion which only supports prefix. For example say I want to navigate to a directory called `the-project` but I always forget whether it's named `the-project` or `a-project`, it doesn't matter because I just type `project` and would see `the-project` as an option so I'd navigate to that and select it (using `C-n` and `C-p` to navigate the list). If that isn't what you're looking for then another option is `emacsclient` [1] which let's you open files in an already existing Emacs process. [0] https://github.com/abo-abo/swiper https://github.com/abo-abo/swiper [1] https://www.emacswiki.org/emacs/EmacsClient https://www.emacswiki.org/emacs/EmacsClient
- caenn 6y agoIf you used Ranger in your vim days it's also available in emacs. Projectile when inside a git repo also has a lot of good stuff for navigation, see projective-find-file and other fn from the package. I will leave this here for the small set of people that use both emacs and windows. The 'everything' extension for emacs is really great, instant HD(s) wide file/folder search. If you don't have Everything.exe installed on your windows machine i'd urge you to go try it. (with or without emacs) As far as emacs integration this is what I use for it. The 2nd function requires the projectile and perspective extensions, it opens a new virtual-desktop-thing inside emacs. (if (eq system-type 'windows-nt) (use-package everything :config (setq everything-cmd "C:\\Program Files\\Everything\\es.exe") (setq everything-ffap-integration nil))) (defun open-file-from-anywhere () (interactive) (everything)) (defun open-file-from-anywhere-in-new-persp-if-in-project () (interactive) (let* ((fpath (everything-find-prompt)) (f-projectile-root (projectile-project-root fpath)) (project-name (projectile-project-name f-projectile-root))) (if f-projectile-root (progn (persp-switch project-name) (find-file fpath)) (progn (message "File is not in a valid project directory") (find-file fpath)))))
- _emacsomancer_ 6y agoIn addition to the other suggestions, you probably want to run Emacs as a daemon so you raise and destroy emacsclients without having to quit. You also may want to run GUI emacs rather than terminal emacs (it has a variety of advantages).