Hacker News new | past | comments | ask | show | jobs | submit login
Spacemacs – Emacs advanced kit focused on Evil (github.com/syl20bnr)
227 points by weavie on April 17, 2015 | hide | past | favorite | 102 comments



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 :)


Run `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.


I 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.


UniPress "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.


Actually, 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/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 :)


The first arg to add-hook must be a symbol, like so:

   (add-hook 'c-mode-hook 'linum-mode)


Or `emacsclient -e '(kill-emacs)'` in case you have anything open or whatever.


The 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. :(


I 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=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.


I think the hanging thing can be solved by invoking emacsclient in the following way: `emacsclient -n`.


-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.


It'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-[.


if 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


> 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.


Evil 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.


evil-surround is not necessary for dat, that is present in core evil.


'ci(' works, I just tried it. I don't know the 't' parameter there, but 'da(' works as expected as well.


Strange, 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. :)


I 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.


The "t" text object should work in all modes, if it isn't working for you then there's something going wrong.


Every text object I've tried has worked great for me (even non-standard ones like cia/caa from arg-text-objects)


I like this development. I feel that we have three editors (really types thereof) for a reason.

The Sublime/TM/Notepad++ crowd cares about OS-native integration. I use Sublime frequently because after a solid decade+ living in OSX land, my fingers know how what to do, and neither vim nor emacs respect that without considerable massaging.

Vim fans want to use an elegant command syntax. I watch vim users code and always make a point to learn how to vim, eventually. The only reason I don't, is because I haven't.

Emacs users want/need the programmable, extensible runtime. Emacs is a programming language; particularly in Lisp development, Emacs often contains programs that are basic/standard parts of the toolchain and not found in other editors. I use Emacs because I like it, but more importantly, because I have to.

Combining the elegant syntax of Vim with the extensibility of Emacs, as well as some out-of-the-box support for the basic OS-native commands, is a very good start.


I feel similarly to this. Emacs got extensibility down and probably would have destroyed Vi. Vim added Vimscript, but it is not what most would call elegant, nice, or any of the other things we want in a language. Adding extensibility is what kept Vim around.

I like the design of Emacs, and I also like Lisps in general, but the Vim editing model is the best for me.

It looks like Neovim is going to address many of the issues with Vim.


As an emacs fan, I find vim model simple, abstract and efficient. Emacs default paradigm has amazing foundations but give fingercuts too often and lack composability while vim is quite self consistent (how ironic giving lisp essence).

That said, growing your editing system by evaluation a small function is still a bliss. Go lisps.

#repant


That's a very good way to put it.

Vim's editing model is much more functional (a la functional programming) than Emacs', whereas the latter's foundation is much more functional.

I keep thinking I should try Emacs with one of the Vim-ulators, but I've got a pretty good flow going in Vim and I've got a lot of other things I'm trying to learn right now, not to mention paying work to do.


Me too, since many people report emacs evil mode being pretty polished by now, I'm tempted to try a fresh emacs setup. There's also lispy.el, which is IIUC a paredit superset in vi-command-clothing.


Although me too comments are not encouraged on HN, I've got to add a "Me too" to your "Me too". I used Emacs for 20 years and on a whim decided to learn Vim. Once I got the hang of it (telling the editor what I want to do rather than moving the cursor all over the place), I couldn't go back to Emacs. I've tried Evil a couple of times a few years ago and it just didn't work for anything other than superficial commands. The reports I'm reading in this thread are making me very, very excited to try it again!


Who knows, with the functional trends, and the work on guile emacs, maybe there will be a window for an emacs sibling with simpler core and combinator-like interactions.

vi objects feels a lot like lazy partial application with sane defaults: effect <| (move or stay) <| (count or 1)


It's not for Vim anymore but can adapt to many editing styles.


FWIW, I use Sublime/Jetbrain products for most of my programming and I always turn on vim keybindings. It isn't 100% the same as actual vim, but it is still faster than a mouse for me.


I've never got into any of these Vi/Vim emulators because they vary from pure Vim in subtly unexpected ways and typically don't support plugins or vimrc setup. Neovim will change all that, being based on direct socket-based communication with actual Vim, so it really will be possible to get the best of both worlds.


ideavim is easily the best vim emulation I had ever used until I tried spacemacs/evil. Ideavim blew the eclipse vim modes out of the water


And they fixed some annoying inconsistencies with recent releases. It's pretty good now. Makes developing Java in an IDE tolerable.


Personally I enjoy any editor that doesn't get in my way, I really want to learn Emacs and / or Vim, but it's not exactly a downhill experience as say Notepad++, Atom, and other editors. I enjoy the idea of having all the Emacs or Vim super powers, but I can't seem to get used to it, I either use nano while on the terminal or just a full on IDE.


Part of the foundation of understanding and appreciating text editors is understanding and appreciating the value of text, rather than trying to abstract it away under an IDE's several layers of GUI controls, widgets, and platform-specific APIs often designed by a single company that's trying to convince you to lock the future of your career and/or company to its platform.

Furthermore, neither emacs nor vim are hard to learn. There's a widespread myth perpetuated both by novices and elitists that it's an all or nothing kind of thing. The reality is that even in vim you can use arrow keys and mouse/trackpad scrolling and ignore hjkl if you want. You could, for example, use terminal vim every single day and use only about 5.5 vim-specific commands: i, ctrl-c, :w, :q / :q!, and ZZ. With gvim or macvim, you could reduce that to two: i and ctrl-c.


Learning vim is like learning Kung Fu, you practice the same awkward route motions until they're so natural that you don't even notice you're doing them. Sadly, it's not a quick process, but it's worth it.


It's true. It made me develop an automatic reflex to hit the Esc key every time after inserting a couple of characters, even when I wasn't using vi at all. It was pretty annoying. Imagine typing a document in Word and pressing Esc constantly. Fortunately I switched to Emacs and the reflex went away.


But don't you find yourself hitting C-a to go to the beginning of a line and then insert a line break, then inadvertently deleting everything on the page. As an Emacs user, I do this all the time.


One nice thing about OSX is that some emacs movements work in most programs.

C-a, C-e, C-n, C-p, C-k, C-y (kill yank not quite the same)

Edit: C-f and C-b too

Edit 2: Just checked and word is not one of these programs :(


Here's a link to add Emacs keybindings to Word on Mac OS X. Hopefully it's still accurate.

http://emacsblog.org/2007/02/18/emacs-key-bindings-in-ms-wor...


It's faster than you'd think. I was far better with Vim than Textmate within a month of my switch.


Not to take away from the rest of your comment, but Macvim in insert mode works exactly like any other Mac text entry program. All of your regular keyboard shortcuts work as you expect them to, as does the mouse.


I used Vim my whole career. But I always hated all the little bugs.

Then I found Spacemacs a couple weeks ago and switched. I had an equivalent environment set up in a few days.

Now I'm moving forward with the ability to do almost anything I want, and all of Vim's warts gone.

Vim really is a shitty editor with an awesome UI on top.

Emacs is a completely configurable, actually good editor. Now with Vim's awesome UI.


Vim is shit so you installed a vim emulator?


He said that the Vim UI is good (aka the modal editing) but everything else is crap. So, Evil gives that interface and better platform.


When I saw this thread, the initial thought I had was "pff, another emacs thread about vim users".

But this is absolutely perfect (either for transition, or for someone like me that just wants to try a transition but does not know where to start).

Thanks for sharing. Beautiful work. :)


I tried to use it to switch to Emacs, and was disappointed like each time I try to switch to Emacs.

Among the problems and warts:

- The Spacemacs doc is on their repo, not in Emacs! (except if you manually fire a buffer with SPC f f ~/.emacs.d/doc/DOCUMENTATION.md)

- Emacs has an interactive interface for editing configuration variables. You will arrive to this interface from the Emacs doc, but it does not have Spacemacs-like keybindings and I'm not even sure it's supposed to work with Spacemacs

- I could not find the doc for ex/vim commands. I suspect there is no equivalent to ":h :foo"

- In vim, it is possible from any mode to get back to the normal mode by typing 'ESC'. In Emacs, C-g aborts a keybinding. However those two are not unified by Spacemacs.

- I use vim with several buffers. However launching "emacsclient -t foo.txt bar.txt" will open them sequentially, and I can not use :n / :N to go back and forth.

- The fact that there are several interactive interfaces for switching buffers and/or opening files is confusing. Typing a file-name in helm-mini creates a "fundamental" buffer that is not a file. I lost some work because of this.

If there were just one or two of these warts and inconveniences, I would get use to them or fix them, but right now there are a little too much. That said, the premise is really attractive, so I can only hope these problems will get fixed over the years so that I can go back to it someday.


> - The Spacemacs doc is on their repo, not in Emacs! (except if you manually fire a buffer with SPC f f ~/.emacs.d/doc/DOCUMENTATION.md)

You can explore the doc for each layer by "SPC f e h". You can even jump to source from there.

> - Emacs has an interactive interface for editing configuration variables. You will arrive to this interface from the Emacs doc, but it does not have Spacemacs-like keybindings and I'm not even sure it's supposed to work with Spacemacs

Everything that works in stock Emacs should work in Spacemacs. Stock Emacs key bindings are always there. Spacemacs stuff, as its name implies, is in the SPC key.

> - I could not find the doc for ex/vim commands. I suspect there is no equivalent to ":h :foo"

I think it should exist. Maybe you need to ask the gitter chatroom. Stuffs like s/foo/bar works for me. However, even NeoVim wants to remove it: https://github.com/neovim/neovim/issues/1089

> - In vim, it is possible from any mode to get back to the normal mode by typing 'ESC'. In Emacs, C-g aborts a keybinding. However those two are not unified by Spacemacs.

You do it with evil-escape: https://github.com/syl20bnr/evil-escape, which is built-in Spacemacs by default and press "fd to escape everything. You can change it to anything you want.

> - I use vim with several buffers. However launching "emacsclient -t foo.txt bar.txt" will open them sequentially, and I can not use :n / :N to go back and forth.

The next version you can use "SPC b n" and "SPC b p" to go back and forth. However, you can use "SPC b s" to switch between buffers and press "C-c o" to open another window side by side. To split window, use "SPC b -" to create a window below and "SCP b /" to create a window right. Jump to each window based on the number on its modeline, i.e. "SPC 1" jumps to window 1, "SPC 2" to jump to window 2.

> - The fact that there are several interactive interfaces for switching buffers and/or opening files is confusing. Typing a file-name in helm-mini creates a "fundamental" buffer that is not a file. I lost some work because of this.

It's a feature. It means that when you switch to a non-existent buffer, you can press RET to create it. It's quite handy to create a scartch buffer of a specific major mode. If you want to open a file, don't use a command that open buffer but a command that open files. I believe in Vim I can create empty buffers.


> You can explore the doc for each layer by "SPC f e h". You can even jump to source from there.

But does it offer an access to the main docs? When I type "spacemacs" in there I get an empty README.md.

> Everything that works in stock Emacs should work in Spacemacs. Stock Emacs key bindings are always there

Yep, but I'm not an Emacs user so I do not know them!

> I think it should exist.

Well, you can try :h for yourself...

> However, even NeoVim wants to remove it: https://github.com/neovim/neovim/issues/1089

They are talking about removing Ex mode, not ex commands!

> I believe in Vim I can create empty buffers.

I don't believe in Vim you get an easy way to create a buffer that has a name that is not a filename...


Thanks a lot for all these answer! I will try Spacemacs once again.


I've been using spacemacs off and on for a few months, (although never as my primary editor). I really like their out-of-the-box config, and it's much easier and better than my previous copypasted amalgamation of an init.el file. I have a few qualms with it though.

- It completely takes over emacs. Your modifications now go in ~/.spacemacs. Don't touch ~/.emacs.d/ Want to install something from melpa? Make a spacemacs configuration layer. That aspect feels like a strong step away from the emacs ethos where you're on the same footing as the editor authors. I don't like the inversion of control.

- It's unstable. Fairly often I'll update and something will fail, leaving me helplessly with emacs keybindings. Thankfully, a revert is easy.

- The last one is a problem with evil in general, you'll still occasionally find yourself in emacs mode, where hjlk and more importantly ":q" don't work


Well it's still in Beta though but I must say it's still excellent. This is from an Emacs user, currently using holy-mode (basically another way of saying Emacs mode in Spacemacs terminology and it's actually a mode configured for Emacs users).


So.... who wants this? Vim users like vim as it is, warts and all. Emacs users already use emacs and typically don't want to learn vim.


I want this. Well, in fact, I already use Emacs with Vim keybindings, so I don't need it, but I would have loved it some time ago.

What I (and I believe most vim users) like about vim is not the software itself, but the concept and ideas behind it: the modal editing, the movement commands, the composability of them, etc.

But the truth is that Emacs is, for lots of usages, better software. It's more extendable, has more features, it's even better written.

So using Emacs with a vim-friendly UX seems like a great idea.


Twenty five year Vi(m) user here.

I switched to Evil and Emacs last year.

The combination of Vim and Emacs is a much better Vim.

org-mode is life changing.

In general I've found that the plugins in the Emacs environment make more sense and simply work better then Vim equivalents.


Me! 20 year Emacs user, switched to Vim after I realized how much I like modal editing. I miss the things I used to have in Emacs, though.

But for a less selfish reason, our team usually does pair programming and we often pair program, each with our own computer connected through a shared tmux session. Because most people on the team prefer Vim, we have standardized on that which is really hard for new people on the team who have no experience with modal editors. Having a compromise where both people can use the same editor without forcing people to one paradigm or the other would be fantastic.

Having said that, I tried out Evil mode a few years ago and it fell pretty widely from the mark for an advanced vi user (not just Vim). It had basic support, but if you did any of the complicated stuff that makes vi efficient, it didn't really work. Some people in this thread are saying that this has improved substantially so I'm really looking forward to trying it.


I'm attracted to it as a clojure developer. This seems to offer a superior nrepl integration and a debugger.

That said, vim with neobundle, unite, fireplace, rainbow parens, vim-sexp, vim-repeat, vim-surround, and one of the many tmux integrations makes for a good enough clojure dev experience.


Unite, fireplace, rainbow parens, vim-sexp and vim-surround are all available in Emacs with its own and better implementation.

If you want Unite equivalent, check Helm which is created before Unite and is still actively maintained. See one of Helm package demo: http://tuhdo.github.io/helm-projectile.html. The same for rainbow-parentheses. Actually, Emacs got something better than rainbow-parentheses for visual aiding parentheses: https://github.com/syl20bnr/spacemacs/issues/1173

For proper sexp manipulation, check this guide with great animations: http://danmidwood.com/content/2014/11/21/animated-paredit.ht...

For Clojure, in Emacs you got a debugger than can step expression by expression: http://endlessparentheses.com/cider-debug-a-visual-interacti...

If you want to know features for Clojure that already configured in Spacemacs, check its Clojure documentation: https://github.com/syl20bnr/spacemacs/tree/master/contrib/la...

You got all IDE features like refactoring and jump to symbols

More demos:

Here are some nice features that Emacs and its 3rd packages provide:

- Powerful automatic indentation with aggressive-indent: https://github.com/Malabarba/aggressive-indent-mode(scroll down for demos). It does not only indent the current line, but the whole semantic context around your cursor.

- Live grep:http://tuhdo.github.io/static/live_grep.gif

- C/C++ refactoring with built-in parser: https://github.com/tuhdo/semantic-refactor/blob/master/srefa...

- Lisp Code reformatting: https://github.com/tuhdo/semantic-refactor/blob/master/srefa...). As far as I know, there's none Lisp code reformatting outside of Emacs.

- Access to a list of project with a few key strokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Quickly access any file in your project, as large as Linux kernel, instantly, regardless of where you are in the project, and within a few keystrokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...)

- Jump to any file depends on context, even if the file path is in a plain ASCII text file: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Copy files from anywhere to anywhere: http://tuhdo.github.io/static/helm-projectile/helm-projectil...)

- Delete files anywhere; files are always at your finger tip to do whatever with them: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Switch between other files with same names but different extensions: http://tuhdo.github.io/static/helm-projectile/helm-projectil...). Work not only for C/C++ but other languages, and is customizable. You don't have to configure anything, like adding include paths for the command to search. Everything is automatic. Just use it as it is.

- Jump to tag definition, from its own parser or external parser like GNu Global: http://tuhdo.github.io/static/c-ide/helm-gtags-jump-dwim.gif

- Jump up to parent: http://tuhdo.github.io/static/c-ide/senator-go-to-up-referen...

- Do you like outline tree?: http://tuhdo.github.io/static/c-ide/sr-speedbar.gif

- Interactive outline tree: http://tuhdo.github.io/static/c-ide/helm-semantic-or-imenu-w...

- Easily move back and forth using the interactive outline tree: http://tuhdo.github.io/static/part3/helm-semantic-or-imenu-2...

- References retrieved from its Emacs internal parser: http://tuhdo.github.io/static/c-ide/semantic-symref.gif

- Beautiful compile output: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

- Frontend support for GDB: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif

- Code completion: http://tuhdo.github.io/static/c-ide/semantic-boost-demo.gif

- Open man page for symbol at cursor: http://tuhdo.github.io/static/part3/helm-man-woman.gif

- Emacs open 39MB C file: http://tuhdo.github.io/static/performance.gif

- Emac opens multi-gigabtye file: http://www.emacswiki.org/emacs/VLF

Note that in the demos you may see me type in the commands. You can think of it like the start menu in Windows, but actually those commands can be executed quickly with a shortcut. I type in the commands for demonstration purpose to Emacs users.

Those demos are just tip of the iceberg.


First off, thanks for your awesome tutorials!

I actually switched to Spacemacs, for largely the reasons you mentioned (everything is there, but easier to extend and largely better).

I was merely pointing out that vim with some plugins is good enough to get serious work done in Clojure, even though getting access to real refactoring libraries, a debugger, etc in my editor would be welcome.

The one problem I have with Emacs is that vim-sexp is and was much much much much better than paredit. Treating forms as text objects and letting you use regular vim motions to select text objects before slurping/barfing/etc is a move forward. It wasn't exactly obvious to me how to duplicate this with Spacemacs/VIM, but I also had work to do so I just went with the Spacemacs paredit bindings.


Great that you are a Spacemacs user now and glad that you like my tutorials.

So, could you be more specific about how vim-sexp works? If you want to visual select sexp from symbol and expanding outward, uses expand-region: https://github.com/magnars/expand-region.el. Same for string. Then you can use smartparens: https://github.com/Fuco1/smartparens to wrap around by simply pressing "(". It is all in Spacemacs now, and you can explore further with evil-lisp-state commands, bound to ", k".


evil-surround is the more idiomatic way to do smartparens stuff.

https://github.com/guns/vim-sexp

This is actually an open problem in evil/emacs at the moment.

Would be nice to sort out.


I'm pretty sure you can do the same thing with expand-region and smartparens combined and is more general than manipulating sexp.


There's also evil-lisp-state (which is essentially a modal interface to smartparens), https://github.com/syl20bnr/evil-lisp-state, and evil-smartparens (https://github.com/expez/evil-smartparens) which makes the default motion operators work better with sexps.


I'm using it with pretty good results so far. I had to stop using Emacs for a long time because I was developing a case of Emacs pinky, but I can appreciate that it does a lot more out of the box. After switching to Vim, I really came to appreciate its idioms too. Spacemacs lets me get the best of both worlds.


Just to provide a counter example... I've been a long-time (13 years or so) Emacs user, and some 3 or 4 years ago, I switched to modal editing using Evil. I find it simply simpler and more efficient than traditional Emacs bindings. I actually started using vim more often after that, too.


Org-mode is god mode. I'm an Emacs with Evil user myself.


That's a bit of an overgeneralization. I'm a vim user, but am always willing to learn something that works better for me.


Just tried it and despite some people here claiming vim-style support is really full I found it pretty unusable for me, the vim user. Which is a pity, as I find vim lacking many features emacs has (or allows to implement easily), but am struggling to switch.

My workflow starts from command-mode and is heavily dependent on it. It's far more crucial than any hjkl stuff and whatever. The first thing I tried was :tabnew. "Uknown command: `tabnew`." Then I tried to use :cd and while it has such a command it works in some weird way which I couldn't figure out how to use on the first attempt. I guess it actually has everything I need, but I probably entered something wrong and suddenly ended up using scp, lol.

While editing some text file without any real purpose I surprisingly didn't find anything that would be working in an unexpected way yet. Maybe it's worth trying it out.


":" runs Emacs functions. Some commands from Vim have been added, but not all of them. If a function with the same name as a Vim command already exists in Emacs, it's not replaced. I'd imagine replacing the default Emacs functions could break things in weird ways.

:cd runs the Emacs cd function which behaves differently than Vim's :cd.

To get the equivalent of :tabnew, you'd have to use :buffer [name] and give the new buffer (Emacs's equivalent of tabs) a name.


Oh, I see, thank you. As I understand buffer name isn't the same thing as file path/name. So I can't really open file by pasting (Ctrl-r +) it path anyway, can I? Also, I only understood how to switch between buffers using that separate screen, not like "next/previous tab", and there isn't any panel that would show which tabs are opened now. But I think that's solvable, at least.


You'd have to either use :find-file or :e (Ctrl-r +).

You can switch between buffers with :switch-to-buffer, :ido-switch-buffer, :b, :bn, and :bp. It's not the same as tabs though.


To get :cd to behave more like vim, you could add https://github.com/gbarta/evil-noautochdir which in addition to behaving like :set noautochdir, also allows :cd to take an argument the vim way.


Maybe you should learn the Spacemacs way (which is the combination of Vim and Emacs) rather than expecting it the Vim way. To create new buffer, `SPC b s` and enter new buffer name. To change directory and get into it, use `SPC f f` or `SPC f h` depends on your preference.


Yeah, I'm skimming through docs right now. Yet what I find so far feels pretty unintuitive, because, as I said, vim was more about command mode to me, rather than default key bindings. That space key thing is quite unfortunate to me as well, because I'm used to binding spacebar to @q (works really well!).

However, `SPC b s` also doesn't what I was looking for. It opens a buffer, not a tab (which I'm not sure are supported in Spacemacs at all, which would be a critical hit). And it doesn't even look for them in the cwd, but does I-haven't-figured-out-what-yet instead.

If you are wondering why that SPC stuff isn't the equivalent to command-mode with ":" bound to SPC: commands are easy to define even in vim, they can have descriptive names due to their nature and I don't have to remember them, as I can use auto-complete! For example, I have :Rename and :Remove. Actually, I don't even remember if it's :Remove or :Delete, I just use autocompletion every time I need it and find out.


> However, `SPC b s` also doesn't what I was looking for. It opens a buffer, not a tab

If you are looking for workspaces i.e. organizing buffers into logical group, use Perspective: https://github.com/syl20bnr/spacemacs/tree/master/contrib/pe....

> And it doesn't even look for them in the cwd, but does I-haven't-figured-out-what-yet instead.

As another commenter suggested, you can use :cd. However, you can use a better interactive interface and use "SPC f f" or "SPC f h". Spacemacs is, after all, Vim + Emacs.

Emacs has that kind of visual tabs but Spacemacs does not integrate it since it gets in the way more than being useful.

> If you are wondering why that SPC stuff isn't the equivalent to command-mode with ":" bound to SPC: commands are easy to define even in vim, they can have descriptive names due to their nature and I don't have to remember them, as I can use auto-complete! For example, I have :Rename and :Remove. Actually, I don't even remember if it's :Remove or :Delete, I just use autocompletion every time I need it and find out.

That kind of auto-complete is really bare. If you want something like that, try pressing "SPC :" or "Alt-x" in Spacemacs. You can search in any order you like, not prefix, i.e. if you look for command "list-package", either "list pa" or "pa list" gives you the command.

I mean, in Vim, to get help for a key binding, I have to type something like "Ctrl+W". Really? In Emacs, you get it by pressing "C-h k" then press the key binding you don't know which command is bound to it. You even get a cheatsheet like style in Emacs. For example, if you don't know what the commands in "SPC f" does, simply press "SPC f ?" and you get an interactive cheatsheet that you can easily narrow donw. Press "C-z" to open its description.


> it gets in the way more than being useful

Well, I didn't find how to make do without it yet, so I would rather stick with the word "critical" for now.

> "SPC :" or "Alt-x"

Oh, that's pretty neat. Actually, still not the same thing as command mode, because it seems there's some convention to chose the command first, and after pressing Enter passing any arguments interactively. Not that it's bad, but a bit different from how it's generally done in shells.

> I have to type something like "Ctrl+W". Really?

Really? Uhm, no, not really. Actually you have to type :map (as in "key map"), and if you don't know what to type you type in :h whatever.


> Well, I didn't find how to make do without it yet, so I would rather stick with the word "critical" for now.

What is "make do"? Do you mean running make? Btw, Spacemacs can do the same with the feature I listed above. The different is just it doesn't display the tab by default and only show you when you need it. That said, if you want to try, open .spacemacs file, search "dotspacemacs-configuration-layers" and add "perspectives" (without double quotes) below any layer there. Then, use "SPC L s" to switch between "tabs" (the default one is "@spacemacs". Enter a non-existent name and you have a new "tab". The "tabs" are collections of related buffers. If you create any new buffer, it is local in an active "tab" only.

"SPC L n" to go to next "tab". "SPC L p" to go to previous "tab". "SPC L k" to close current "tab". "SPC L a" to add a buffer to current "tab".

> Oh, that's pretty neat. Actually, still not the same thing as command mode, because it seems there's some convention to chose the command first, and after pressing Enter passing any arguments interactively. Not that it's bad, but a bit different from how it's generally done in shells.

Well you need to forgo Vim for awhile and concentrating on Spacemacs way. Then going back and compare.

> Really? Uhm, no, not really. Actually you have to type :map (as in "key map"), and if you don't know what to type you type in :h whatever.

That's not the same thing. Try pressing "Control-h k", then press "SPC b s" you will get a command that is bound to the key binding. If you want similar thing to ":map", then press "C-h b" to show the interactive cheatsheet. If you are in a major mode, it shows all the key bindings belong to that major mode first and foremost, than maps of other modes (such as minor modes) below.



I've tried to switch my workflow from vim + tmux + tmuxinator to spacemacs a few months ago, and I must say that it easily could replace my Vim environment, there was evil-surround, evil-nerd-commenter, etc. even neotree, and plus I got org-mode, other really great packages and the power of emacs, however I didn't find a replacement for the tmuxinator part, I need it since I usually have projects with several shells in different windows and panes aside from vim, so in the end that detained me from doing the switch and continued with vim.


Try emacs shell-mode. It's a bit weird but you might like having your shells in your editor.


I'm using this for a week now. Switched to it from Emacs Prelude (another config kit), and before that Vim itself.

I use Vim a lot less now: still have a simple .vimrc laying around for just-in-case.


I get my hopes up when I see another vim emulation project, but after using it for just a few minutes, I already found a few missing vim features I use every day:

* Toggling if search results should be highlighted (:set hls, :set nohls)

* Opening the filename under the cursor in a new window (^W f)

Completely emulating an entirely different editor is very, very difficult :-(

I applaud everyone contributing to these projects, and hope they continue to improve! They've already come a very long way from evil, and viper-mode.


> * Toggling if search results should be highlighted (:set hls, :set nohls)

After you search, you get persistent highlighting. To turn it off, "SPC s c". All the toggling features are in "SPC t" group.

> * Opening the filename under the cursor in a new window (^W f)

`SPC f h` then press `C-c o`. The key bindings are consistent in other Helm commands as well. It opens a window side by side. Nothing is misisng, sorry. Spacemacs can even do things like [these](http://tuhdo.github.io/helm-projectile.html).

If you have any question, ask it on Spacemacs chatroom: https://gitter.im/syl20bnr/spacemacs


You're right, "missing" was a poor choice of words. I meant, "vim keybindings for these commands isn't supported".

They are keybindings my fingers reach for everyday without thinking about it, similar to how I use j, k, h, l without thinking about it.


There's a reason it's called Spacemacs, not NeoVim and major features are centered around the SPC leader key. There are certain things you must learn from Emacs if you want to get the benefit of it, such as Emacs packages. To make it easier to learn, there's a popup with keys and commands there. If you press ?, it brings a cheatsheet like interactive window and you can narrow it down by start typing and press `C-z` to open each command description. For example, if you want to know what each command in `SPC f` does, pres `SPC f ?` then press `C-z` on a command and you get a description on upper window.


A friend showed spacemacs to me a while ago but, as a vim user who knows nothing about emacs, I got lost very quickly. I never knew if a problem I was having was due to not knowing how to use emacs or to not knowing how to use spacemacs.

Does anyone know any tips or references for total emacs newbies trying to jump into spacemacs head first?


Here is your tutorial, from a Vimmer: http://ian.mccowan.space/2015/04/07/Spacemacs/


So I installed it. I know nothing about emacs, have followed setup etc. It appears I definitely dont have Vi keybindings upon re-opening it after initial install. Anyone care to help me out a bit? Really am intrigued but not sure how to get started with that as a blocker.


You should do. I've been using it for a while and am a big fan of it so far. If you've got any questions about how exactly to do something there's a quite active gitter room[0].

There could be a problem with a new feature (from maybe yesterday?, the day before?) that allows users to pick between emacs and vim keybindings.

[0] https://gitter.im/syl20bnr/spacemacs


Also, if you have problems, ask the community: https://gitter.im/syl20bnr/spacemacs


I just followed the installation description and during the first start of emacs (after the 'git clone' of spacemacs) several things get downloaded and installed, and then I got asked if I would like to have vim or emacs like keybindings.


Any reason why the documentation is in md and not in info for easy navigation from inside emacs?


So you can put it on the web for complete Emacs newbies to read rather than forcing them to learn Info reading. However, Spacemacs does integrate info+ that makes Info reading much more pleasant, along with helm-info command that I can say Emacs becomes the best info reader every.


Info can be easily exported to HTML just like Markdown can.


I tried this a few days ago, it seems like a cool concept, but I found the whole thing a bit bewildering. Is there a tutorial for it like emacs's C-h t?


As a Vim user I really want to give Emacs a try and this seems to be a great starting point, but:

Does this support configs in my .vimrc?

Can I use Vim plugins in it?


> Does this support configs in my .vimrc?

Nope.

> Can I use Vim plugins in it?

Nope.

Evil Mode exposes Emacs using a Vim interface. It's doubtful that it will ever run Vim plugins or read your .vimrc (particularly because it will not support things like autocmd or VimL). There are many ports of Vim plugins to Emacs for use with Evil. For example, evil-leader[1] brings support for leaders (Spacemacs makes heavy use of this with <Space> as the leader, hence the name). There are also many things in the Emacs world that Vim doesn't really have, like flycheck[2] or a decent hex editor (I've used vim + xxd, but Emacs' hex editor is nicer).

[1] https://github.com/cofi/evil-leader

[2] https://github.com/flycheck/flycheck

EDIT: It's not a drop-in Vim replacement in the way that NeoVim is. It just brings modal editing and your Vim muscle memory to working in Emacs.


No, this is emacs with vim keybinds (and other goodies like leader key) implemented via evil-mode. It's one of the best if not the best vim emulation you can find. But other than modal editing everything else is emacs. Configs, plugins, elisp etc.


No to both. Despite using Vim-like modal bindings it is implemented in Elisp and uses Emacs packages.


I've tried a number of Vim replacements in the past that always omit really key features like macros, searching, correct escape configuration (Ctrl-[ god damnit!), g/s/v commands and any other number of things.

Is this one really, ACTUALLY a good vim substitute? Or do I have to relearn a ton of stuff just to get to the same level of knowledge and comfort I have with Vim?


It's so good that some people call it a Vim re-implementation, not an emulator.


It's not perfect, there's still some learning to do around the fringes where it interacts with emacs, but it is by far the BEST vik - like - but - not - vim experience I've seen so far. Much better than Sublime's vintage or any of the IDEs that provide Vim keybindings.




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

Search: