4 ms·
I switched a few months ago and I must say I'm really impressed: there is (nearly) no Vim feature I miss! Out-of-the-box features/packages I like: - Default p
by cranium 11y ago
I switched a few months ago and I must say I'm really impressed: there is (nearly) no Vim feature I miss!
Out-of-the-box features/packages I like:
- Default powerline is cool
- "guide-key" package: as you may know, Emacs is based on successions of key bindings to call a function, guide-key tells you what key binding you can do next. Example: "SPC p" is the prefix for most "projectile" (project explorer package) commands, so guide-key shows you what keys you can press and its associated function/subgroup. I think it's the best way to learn your key bindings!
- (from vanilla Emacs, enhanced with Helm) M-x: call a function. While it doesn't seem impressive, EVERY ACTION is a function in Emacs! You can call "evil-next-line" (even if it's now really useful) or "set-default-font", and with Helm you can search in real time what you want. If I want to create a table in org-mode: "M-x org cre" brings "org-create-table". No need to remember the function full name!
- org-mode: Think of it as an editor for all non-code tasks. I personally do my graded homeworks in it and then exporting these in latex/pdf. "C-c C-e l o" <- export file in latex, generate pdf and open. Really quick to do!
Final words: happy to have switched to Emacs, I don't really miss my Vim environment because there are a lot of alternatives out of the box in Spacemacs (thanks to the good integration of Evil).
BTW, I still use Vim to do quick edits in the terminal, solely because Emacs takes more time to boot :)
- atjoslin 11y agoRun `emacs -nw --daemon` to start a background emacs server. Now, you can do `emacsclient -nw <file>` to boot up with almost no startup time. I have vi aliased to this, and `emacs -nw --daemon` opened by launchctl. A gotcha: If you change your emacs config and need to restart, be sure to `pkill emacs` to get rid of the daemon.
- LukeShu 11y agoOr `emacsclient -e '(kill-emacs)'` in case you have anything open or whatever.
- manish_gill 11y agoThe one thing I hate about emacs client (and I was bitching about it on #emacs the other day as well) is that in OS X, a windowed client will just "hang" when exited. It will still be visible in the cmd-tab list, and thus isn't truly exited. Hence, if I want to remove that annoying non-running client, I basically have to kill the daemon and restart. This is particularly annoying when I'm editing configuration. And in many cases, using just the terminal isn't enough because there are quite a few quirks when using emacs in the terminal, the most recent one I found was that <shift><tab> is interpreted as M-[. I wish there was some way to fix this. :(
- michaelsbradley 11y agoIt's not the client that hangs around in the cmd-tab list (and as an icon in the dock) – what's signified is the process for the Emacs daemon. I agree that it would be nice if it could be configured/made to disappear. I use terminal-mode emacsclient on my Mac all day everyday, and `C-h k` shows <shift+tab> is interpreted as <backtab>. That's the case for Terminal.app and iTerm2, though I only use the latter. I'm not sure why yours interprets it as M-[.
- psibi 11y agoI think the hanging thing can be solved by invoking emacsclient in the following way: `emacsclient -n`.
- michaelsbradley 11y ago-n serves a different purpose (the command returns immediately). Even when using that flag, there will be an Emacs icon in the cmd-tab list and the dock after the client is closed.
- JadeNB 11y agoI don't have an `.app`-ified copy of Emacs around to check, but there is a way to hide apps from the Dock and the Cmd-Tab switcher; see http://hints.macworld.com/article.php?story=20010701191518268 http://hints.macworld.com/article.php?story=2001070119151826... . Specifically, you can add <key>LSUIElement</key> <true /> to your app's Info plist (at `$PATH_TO_APP/Contents/Info.plist`). As the other comments point out, this also hides the app's menubar, which may or may not be desireable.
- michaelsbradley 11y agoI have these in ~/.bash_aliases: alias e="emacsclient -t -a ''" alias eb="emacsbare" alias ec="emacsclient -c -n -a ''" alias emacsbare="emacs -nw -Q --eval \"(load-theme 'misterioso)\"" alias vim="e" alias vi="e" eb/emacsbare very quickly fires up a "clean" (ignores init files) terminal-mode Emacs instance. e/vim/vi launches a terminal-mode client for the Emacs daemon, which only takes a split-second if the daemon is already running. If the daemon isn't running, it gets started automatically by virtue of the empty string being passed with the -a flag, per the man page for emacsclient. ec launches a "gui-mode" (X/quartz) client for the daemon, which is started automatically if isn't running, same as before.
- znpy 11y agoActually, inside any client, you can do M-x eval-buffer and re-evaluate your whole .emacs. http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html http://www.gnu.org/software/emacs/manual/html_node/emacs/Lis... A note: I' be careful though, because depending on how you create your variables, thing can go wrong, I guess: if you-re going to use eval-buffer on your whole .emacs, I'd better use, for example, add-hook instead to add-to-list: (add-hook c-mode-hook 'linum'mode) instead of: (add-to-list c-mode-hook 'linum-mode) Just saying. Have fun with your configs :)
- hollerith 11y agoThe first arg to add-hook must be a symbol, like so: (add-hook 'c-mode-hook 'linum-mode)
- DonHopkins 11y agoUniPress "Evil Software Hoarder [TM]" Emacs had a vi emulation mode such that when you typed ":q", it flipped you over into an Emacs shell window with key bindings to behave just like you'd expect had you actually exited your text editor. Of course the shell mode was hacked so "vi foo.c" would flip you back into a vi-mode buffer on foo.c. Poor innocent vi users didn't even realize they hadn't left the editor! It was kind of like being in the Ematrix.
- qnaal 11y agoif you're going to daemonize, make sure you use lucid emacs, unless you're the kind of person who never restarts their X server. the gtk version crashes the emacs server when X exits, see: https://bugzilla.gnome.org/show_bug.cgi?id=85715 https://bugzilla.gnome.org/show_bug.cgi?id=85715
- dan00 11y ago> I switched a few months ago and I must say I'm really impressed: there is (nearly) no Vim feature I miss! Well, I just tried it literally for a few seconds and just stumbled over the not working text objects. I really like things like e.g. 'ci(' or 'dat'. But it always seems like this if I'm trying a vim emulation.
- expando 11y agoEvery text object I've tried has worked great for me (even non-standard ones like cia/caa from arg-text-objects)
- mullr 11y ago'ci(' works, I just tried it. I don't know the 't' parameter there, but 'da(' works as expected as well.
- dan00 11y agoStrange, I just restarted spacemacs and now 'ci(' works. In the previous session I've changed some settings and that seems to have irritated spacemacs. 't' is for html tags so pressing 'cit' anywhere on '<width>280</width>' will do what you're expecting. :)
- mijoharas 11y agoI only just noticed this now, but `dit` and `cit` only works in html (and other web derived modes) in spacemacs. I guess some of the stuff only gets set up on the major modes.
- hammerandtongs 11y agoEvil has full text objects support and ci( works for me though I use Emacs+Evil and not spacemacs. You'll want to add "evil-surround" for dat I found little or no disfluencies in the keybindings/text objects etc and I use them extensively. Though you'll want to add some of the core emacs keys to your repertoire as many of them have no natural vim alternative.