Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

buffers

minibuffer helm mini (launche buffers open and recentfiles

spc b b

move buffer to window n

spc b [n]

erase buffer

spc b e

kill buffer

spc b d

next buffer

spc b n

prev buffer

spc b p

revert buffer to data on disk

spc b R

comments

comment/uncomment line

spc c l

copy and comment lines

space c y

comment/uncomment paragraphs

spc c P

errors

list flycheck erros

spc e l

go to next flycheck err

spc e n

go to prev flycheck err

spc e p

files

find file

spc f f

find file literally

spc f l

save file

spc f s

insert filer

spc f i

recent files

spc f r

write buffer to new file

spc f c

delete buffer and file

spc f D

save a buffer

spc f s

save all open buffers

spc f S

toggle neotree

spc f t

jumps

jump to char(s)

spc j j

jump to word

spc j w

jump to line

spc j l

jump in buffer

spc j i

jump in all buffers

spc j I

look where referenced

spc j q

unimpaired

Move line up

[e

Move line down.

]e

Insert space above

[SPC

Insert space below.

]SPC

Paste above current line

[p

Paste below current line

]p

Search

recent cmds and cmds search

spc spc

search in file

spc s s

search files in project

spc s p

search in files

spc s f

search in all buffers

spc s b

search in file with default input

spc s S

projectile

toggle projectile neotree

spc p t

open project

spc p p

search project dirs

spc p d

open project terminal

spc p '

project wide search and replace

spc p R

list project buffers

spc p l

open project vc

spc p v

misc

expand region

spc v

Windows

split window horizontally

spc w /

go to window n

spc [n]

grow-shrink window vertically

spc w { or }

grow shrink window horizontallty

spc w [ or ]

swap window buffers

spc w M

rotate windows forward

spc w r

rotate windows backward

spc w R

toggle window layouts

spc w +

split window right

spc w v

haskell layer

peek type errors

spc m G e

jump to definition

spc m g g

jump to definition in other window

spc m g G

hoogle helm lookup

spc m h f

vim - movement

up half a page

ctrl u

down half a page

ctrl d

down a whole page

ctrl f

up a whole pafe

ctrl b

move to end of last word

g e

forward by one word

w

backword by one word

b

forward to end of word

e

go to line number 300

300G

jump to prev code block

shift }

jump to next code block

shift {

forward to next p

fp

backwords to next p

Fp

forward to char before p

tp

search forward

/

search backwords

?

find following occurences of word under cursor

find prior occurences of word under cursor

first line

gg

last line

G

center view on cursor

zz

current cursor to top of screen

zt

scroll view up a line

ctrl y

scroll view down a line

ctrl e

current cursor to bottom of screen

z b

head of screen

H

middle of screen

M

last of screen

L

home

0

end

$

set mark in m register

m m

go to mark in m register

` m

redo

ctrl-r

go to last place you where

''

repeat last command

.

indent right

indent 3 lines right

3>>

indent left

<<

beginning of non-whitespace

^

go to matching paren

%

vim - editing

change two words

c2w

toggle case of current char

~

delete char at cursor

x

delete char before cursor

X

change word

cw

delete/cut

d

delete/cut to the char before the period

dt.

delete/cut including the period char

df.

paste before cursor

P

paste

p

add line above

O

add line below

o

delete char and inser

s

(substitute) delete whole line and replace

S

insert at beginning of line

I

insert at end of line

A

delete char before cursor

shift x

insert line above cursor

shift o

copy line

yy

copy selection

y

copy from cursor to end of line

Y

change line

cc

change inner html tag

cit

change inside parenthesis

ci(

change inner word

ciw

delete line

dd

join line

J

delete around word

daw

delte inside word

diw

delete inside paragraph

dip

delete around paragraph

dap

delete surrounding (char) parens

ds(

change surrounding (char) parens

cs(

delete surrounding (char) parens

ds(

delete paragraph

dip

replace single char

r

replace (overwite)

R

clear line without removing

0D

clear line from first non blank character without removing line

^D

no highlighting

:noh

vim visual mode

select inside paragraph

vip

select around paragraph

vap

Install

install haskell-ide-engine and ghcide

stack install hlint brittanny hoogle

use spacemacs develop branch (checkout ~/.emacs.d to develop)

add to conf

(defun dotspacemacs/layers ()
  (setq-default
   dotspacemacs-configuration-layers
   '(
    ...
    (reasonml :variables reason-auto-refmt t)
    lsp
    (haskell :variables
             haskell-completion-backend 'lsp
             )
    ...)
  )
)

(defun dotspacemacs/user-config ()
  (setq lsp-haskell-process-args-hie '("exec" "ghcide" "--" "--lsp")
        lsp-haskell-process-path-hie "stack"
        lsp-haskell-process-wrapper-function (lambda (argv) (cons (car argv) (cddr argv)))
        )
  (add-hook 'haskell-mode-hook
            #'lsp)
)

for the reasonml layer to work install ocaml compiler version which exactly matches the ocaml version used by bs-platform (bs-platform 7.0.0 uses ocaml 4.06.0)

then install opam then opam install merlin reason

then run opam user-setup install

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