Going from vim to spacemacs

Posted on Fri 19 February 2016 in spacemacs

Why going from vim to spacemacs?

Because you will have vim + emacs, finally in an almost seamless integration! No more editor wars, peace on earth and endless fun for everyone..

For instance, from a less hyped point of view, in my case I needed to have good support for the Elixir language, That is when the great alchemist package from Samuele Tonini kicks in. However this post is not about alchemist, but it tries to focus on a possible vim spacemacs work-flow.

How am I using spacemacs in this very moment?

This is a list of combos that I would like to share (note that the leader key is the blank space, or ):

  • Project outline/tree -> <spc> p t
    Once you are inside a project you can have the outline/tree of the project.

  • grep project -> <spc> /
    This will enable you to grep the project and jump to the file directly

  • Exceptions in tests
    When you will run tests (for example nosetests in python, you will have the possibility to jump to the test that failed with just an enter)

  • search in a file with dynamic display <spc> s s
    Want to search in the current file with live preview? This is your friend

Magit (git client for spacemacs/emacs)

NOTE that when you are in the magit buffer you do not need to <spc> g s to re-enter the magit buffer

  • magit <spc> g s ?
    get help, it will be useful

  • magit <spc> g s (inside the magit buffer) P p
    Push your current branch to a remote (you will be able to choose the remote in an interactive buffer, (origin, collaborator\_remote, friend_remote) )

  • magit <spc> g s (inside the magit buffer) s to stage/unstage the file under the cursor

  • magit <spc> g s (inside the magit buffer) c c to open the commit editor

  • magit <spc> g s (inside the magit buffer) c c (type commit message) ctrl-c ctrl-c

  • <spc> f r (recent files)

For the rest, vim key-bindings, I use basic vim movements and combos and they fit my work-flow. :new, :vsplit, :sb, <ctrl>-w k, <ctrl-w> l works well for me

Thanks to Marco Baringer (segv) to have mentioned spacemacs and to Kai Strempel (MacBethIII) to have guided me through magit and a little bit of spacemacs. It will be an intereresting journey, I am pretty sure!