4 ms·
Comes with every *nix distribution. Fast to start. I use Emacs for programming but if I have one single file, like a config file, that needs a quick edit, use
by JJMcJ 6y ago
Comes with every *nix distribution.
Fast to start. I use Emacs for programming but if I have one single file, like a config file, that needs a quick edit, use vi(m) because otherwise I have to either:
1. Go to my open Emacs and navigate to the location of the file needing the quick edit
2. Open a second Emacs instance, and hope I don't lose the desktop settings for the "real" instance.
Especially if the file needs to be edited sudo.
If there is a way to open a file in the existing Emacs instance without navigating, I would be glad to use it except for sudo.
The way that "firefox some-local-file.html" will open up that file in the existing Firefox instance.
- b5n 6y agoI'm confused by your workflow. Why are you opening a second Emacs instance? In Emacs you just C-x C-f /path/to/config, for sudo C-x C-f /sudo::/path/to/config. Starting location will be home, or the parent of the active file (if the active buffer is an editor).
- dnquark 6y agotl;dr: terminal -> vim == less context switching Even though I live in Emacs, I frequently use GP's workflow as well. For me, it's often the fact that I am already working in the terminal when I need to edit the config, so going to Emacs is a context switch. Moreover, I often fist do a cd /path/to/config; once there it's trivial to do vim foo or sudo vim foo. I have an alias that can send that file to emacsclient -- but again, it takes me away from the terminal, and will not work with sudo. Also, I've tried possibly every emacs package that helps with path completion, but they all seem to get in the way when I already know exactly what I want. Vanilla bash completion (and don't forget about fzf!!) are a better experience for me; YMMV.
- JJMcJ 6y agoTIL about /sudo:: I will look at it further. For the other it's usually something like /usr/x/y/z/a/b/c/config.ini Yeah, I want to type that path into Emacs when I can vi config.ini or sudo vi config.ini and be done in seconds.