Skip to content

Instantly share code, notes, and snippets.

@Softsapiens
Last active May 16, 2017 23:12
Show Gist options
  • Save Softsapiens/d9ad5ddfa03c23ed448a835fba0a1cc8 to your computer and use it in GitHub Desktop.
Save Softsapiens/d9ad5ddfa03c23ed448a835fba0a1cc8 to your computer and use it in GitHub Desktop.
https://www.youtube.com/watch?v=F0sRpgnFyMY
## Evil mode
/ Start search in current buffer
n find next
N find previous
SPC s c clear the searches
:s/text/newtext/gc Search and replace
SPC s h Symbol highlight + options for search, multiple edit,...
* (over the word to search) --^ Idem
C-r Redo
u undo
C-? Redo (from emacs)
## Evil windows
SPC w j Move down evil window
## Haskell
SPC m s b Load file/project in a haskell session. Be careful with :set +code
SPC m h t Info on cursor/selection type
SPC m g g Go to definition
SPC m g i Go to imports definition
## Coding
g c c Comment/uncomment current line
g c 3 j Comment/uncomment from current line 3 lines bottom... <n> k (n lines top)
Enter Visual mode, select text and g c Comment visual selection
SPC y And select position
SPC SPC Avy word mode... select chars to Positioning
## Space Editing utils
SPC a u Undo Tree visualization
## Search
SPC s c clear the searches
SPC b f Permet saltar rápidament a definicions, funcions,... in the current buffer
SPC s p Search in project
SPC s b Search in open buffers
SPC s f Search for a file and suffixes
SPC s g g Do grep search in current file
SPC s g p Do grep search in project
## Files
SPC f t NeoTree file search in current file path
SPC p t NeoTree with the root set to the projectile project root
SPC f f Hem find files (cntrl + h go up) or for creating a new file
## Font size
SPC z x Scale-font menu. - (decrease) = (increase)
## Buffers
SPC b n Next util Buffer
SPC b p Previous util buffer
SPC b d Delete current Buffer
SPC b k Select a buffer to kill
SPC b f Reveal buffer in OX Finder
SPC b h Go to buffer home
## .spacemacs
SPC f e d for edit .spacemacs file
SPC f e R save .spacemacs file and reload config
https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#managing-projects
## project
SPC p ! run shell command in root
SPC p & run async shell command in root
SPC p a toggle between implementation and test
SPC p b switch to project buffer
SPC p c compile project using projectile
SPC p d find directory
SPC p D open project root in dired
SPC p f find file
SPC p G regenerate the project’s etags / gtags
SPC p h find file using helm
SPC p I invalidate the projectile cache
SPC p k kill all project buffers
SPC p o run multi-occur
SPC p p switch/open project
SPC p r open a recent file
SPC p R replace a string
SPC p s see search in project
SPC p t open NeoTree in projectile root
SPC p T find test files
SPC p v open project root in vc-dir or magit
SPC p y find tags
SPC / search in project with the best search tool available
SPC s a p run ag
SPC s g p run grep
SPC s k p run ack
SPC s t p run pt
###### VIM
movement
--------
0 - beginning of line
^ - beginning of non-whitespace
$ - end of line
9j - move down 9 lines
w - move forward by word
b - move backward by word
gg - first line
G - last line
C-u - up half page
C-d - down half page
f/ - move forward to first "/" character
F/ - move backward to first "/" character
t/ = move forward right before the first "/" character
T/ = move backward right before the first "/" character
; - repeat that command again
H - head of the screen
M - middle of the screen
L - last of the screen
} - move forward by paragraph or block
{ - move backwards by paragraph or block
* - search for word under the cursor
n - search again forward
N - search again backwards
# - search backwards for word under cursor
/ - search forward
? - search backward
% - find matching brace, paren, etc
ma - mark a line in a file with marker "a"
`a - after moving around, go back to the exact position of marker "a"
'a - after moving around, go back to line of marker "a"
:marks - view all the marks
'' - go to the last place you were
[{ - jump back to the "{" at the beginning of the current code block
editing
-------
x - delete char under cursor
X - delete char before cursor
A - add to end of line
I - insert at the beginning of the line
dd - delete line
D - delete from cursor to end of line
di' - delete text inside single quotes
yy - copy line
Y - copy from cursor to end of line
cc - change line
C - change from cursor to end of line
cit - change text inside html tag
ci' - change text inside single quotes
ci{ - change text inside curly brackets.
ci... - etc
p - paste after cursor
P = paste before cursor
o - add line below
O - add line above
. = repeat last comment
r - replace character
R - replace. (overwrite) (good for columns of text)
J - join line (cursor can be anywhere on line)
http://vim.wikia.com/wiki/Moving_around
e
Move to the end of a word.
w
Move forward to the beginning of a word.
3w
Move forward three words.
W
Move forward a WORD (any non-whitespace characters).
b
Move backward to the beginning of a word.
3b
Move backward three words.
$
Move to the end of the line.
0
Move to the beginning of the line.
^
Move to the first non-blank character of the line.
)
Jump forward one sentence.
(
Jump backward one sentence.
}
Jump forward one paragraph.
{
Jump backward one paragraph.:
j
Jump forward one line.
k
Jump backward one line.
H
Jump to the top of the screen.
M
Jump to the middle of the screen.
L
Jump to the bottom of the screen.
10<PageUp> or 10<CTRL-B>
Move 10 pages up.
5<PageDown> or 5<CTRL-F>
Move 5 pages down.
G
Jump to end of file.
1G
Jump to beginning of file (same as gg).
50G
Jump to line 50.
mx
Set mark x at the current cursor position.
'x
Jump to the beginning of the line of mark x.
`x
Jump to the cursor position of mark x.
''
Return to the line where the cursor was before the latest jump.
(Two single quotes.)
``
Return to the cursor position before the latest jump (undo the jump).
(Two back ticks. This is above the Tab key on some keyboards.)
'.
Jump to the last-changed line.
%
Jump to corresponding item, e.g. from an open brace to its matching closing brace. See Moving to matching braces for more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment