Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I use Emacs and opening a new file is just pressing “C-x C-f” (find-file), typing the path (completion is available), and pressing enter. As for vim, I would spawn a new terminal (WM keybind, new tab, new pane with tmux), cd to the directory and open it with vim.

The nice thing is that I rely only on the keyboard, no need to point with the mouse. It may not be faster, but typing is sequential and there’s no context switching. So muscle memory helps a lot. Just like you don’t think about each character when you write, I don’t really think about the shortcuts and commands I use.



It's interesting that vim and emacs have this sort of cultural difference where emacs users tend to have one session always open, and vim users are more likely to directly launch a new session per file. I've largely adopted the emacs approach with my usage of neovim, though still use a mix. I have a Session.vim file that opens my windows/tabs/buffers I saved, including remote files using the scp://hostname/filepath syntax. Certain files I edit often enough that I just want them always open, and arranged a particular way. I do sometimes open a one-off separate session to quickly edit a config, though. I don't wanna mess up my muscle memory by introducing too many extra buffers or possibly messing up the order (although if I did do that I could just quit out and reopen the Session.vim file to get back to my saved arrangement).

Another thing I picked up from my time with emacs was making keybinds to interact with the "other" window. One macro I use often will delete the second line of the file in my current window, save, change to the other window, delete second line, save, change back to original window. When activated from keybind it all happens approximately instantly. I also have some binds to jump to the top of the other window's file (without leaving my cursor stuck over there) and so on, letting me keep my cursor in the main area most of the time.


Vim current directory is tied to the process, while each buffer in Emacs have its own default directory.

Also the buffer’s local variable in vim comes from different sources. In emacs, a lot of stuff are tied to a major or minor mode. You only have to toggle them to switch between keybinds, syntax,…




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: