Skip to content

Instantly share code, notes, and snippets.

@slve
Last active October 20, 2016 07:30
Show Gist options
  • Save slve/72ff8ef0886abdcf150267c8670f3039 to your computer and use it in GitHub Desktop.
Save slve/72ff8ef0886abdcf150267c8670f3039 to your computer and use it in GitHub Desktop.
emacs-cheatesheet / vim-cheatsheet to make the switch easier

VIM and EMACS

VIM                      -> SPACEMACS (vim-mode)
main menu                -> F10
help                     -> SPC h SPC
search in normal buffers -> like in vim /
search in spec buffers   -> C-s
movement in normal buf.  -> like in vim: [hjkl]
movement in spec buffers -> C-[npfb]
center buffer around
 cursor                  -> like in vim: zz
last place you've edited -> like in vim: g;
show previous things
 you've copied           -> SPACE r y
:NERDTree                -> SPC f t (NeoTree with ranger like keybindings!)
                                     movement       -> [hjkl]
                                     one level up   -> K
                                     change root    -> R
:NERDTree                -> SPC f f (helm-find-files ranger like keybindings with C key)
                                     movement             -> C-[hjkl]
                                     open in split window -> C-c o
                                     open bookmarks       -> C-x r m
                                     open bookmarks       -> C-x r b
                                     preview on/off       -> TAB
open file under the curs.-> gf RET
open file under the curs.
 in new window           -> until I find it I just split the current window in advance
character info           -> SPC h d c
font size                -> SPC z x [-=0] (- decr, = incr, 0 reset)
folding                  -> SPC z f
easymotion               -> SPC j j [any character] RET
:BufExplorer             -> SPC b b
                                   delete buffer C-c d
:bd                      -> SPC b d
:Mru                     -> SPC f r
:bnext                   -> SPC b n
:bprev                   -> SPC b p
jump back to previous buf-> SPC TAB (is switching only between the last two)
:GundoShow               -> SPC a u
fuzzyfinder/ctrlp        -> SPC p h
:Ag                      -> SPC s a f (you can enter multiple phrases)
:Ag                      -> SPC s p       (separated by spaces)
:Ag                      -> SPC /
comment out / uncomment  -> g c c (or simply g c for visual block)
delete a word in insert
 mode                    -> C-w

create new window        -> like in vim C-w n
switch between windows   -> like in vim C-w [hjkl]
                            alternative: SPC [1-9]
switch between windows
 special buffers         -> C-x o
move window              -> like in vim C-w [HJKL]
cycle between windows    -> like in vim  C-w C-w
searchfold               -> SPC s s (swoop filter lines)
show / hide whitespaces  -> SPC t w
edit configuration file  -> SPC f e d
show keybindings         -> SPC ?
restart editor           -> SPC q R
exit                     -> SPC q q (will ask whether to save)

EMACS SPECIFIC

command help preview
 in helm while searching
 commands                -> TAB
paste clipboard into
 helm minibuffer         -> C-y
copy current line from
 helm into clipboard     -> C-c C-y
clone current text at
 cursor into helm
 minibuffer              -> C-w (keep pressing if you will)
easymotion in helm
 minibuffer              -> C-q
prev opening parens      -> SPC k k
                             jump between parens  -> [jk]
                             quit parens matching -> C-g

GIT SPECIFIC

jump to next hunk        -> ]h (need to save before moving)
jump to previous hunk    -> [h (need to save before moving)

looking for

autocomplete paths while editing a normal buffer (file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment