Evil Mode
Evil CS #
Combos or Idioms #
g;-> last change, in edit modeg,-> opposite of g;- gx -> text exchange gX -> cancel exchange
gi-> insert resume where ever edit was happening.- gJ -> join white spaces
- cstt -> change sorrounding tag wo changing the attributes
- o, ctrl-o, p -> paste on new line
- ddp -> move line down
- ddkp -> move up line
- xp -> swap two characters
- ggg?G -> ROT-13 to hide what you are working on
yygccp-> duplicate line mark orginal as comment copy -> comment -> paste- V$% -> select from function name to , e.g. javascript function.
- V: highlight current line in visual line mode
- $: end of line
- %: jump to next end of ( or
vaBV-> from within "" selection function- highlight around B ()
- V: highlight top most line
- yiW -> word with “” w: single word W: word excluding space or including “”
- C-i and C-o: jump forward and backward respectively
Insert mode #
- ctrl-i: indent
- ctrl-j: new-line or enter or indent
- ctrl-t: de-dent(tab)
- ctrl-k: kill line
- ctrl-p: auto complete from previous symbols in buffer
- ctrl-n: auto complete from next symbols in buffer
- ctrl-u: universal argument current config says not defined
- ctrl-r: register
- ctrl-l: recenter-top-bottom
- ctrl-o, ctrl-g: normal-mode
Operators #
- y: copy
- d: delete
- c: change
- >: indent
- <: de-indent
- g: go jump
- z: fold/unfold
- gc: comment
- s: surround
- ~: capitalize character
- g~: operator toggle capitalization
- gu: operator lower case
- gU: operator upper case
Motions #
b, B, p, s can be used as text objects: with “i” and “a”.
- ( or b: block
- or B:
- p: paragraph(/n)
- s: sentence(.)
Text objects fc #
| position | ease | box | interval | due |
|---|---|---|---|---|
| front | 2.5 | 0 | 0 | 2022-02-09T11:20:17Z |
They are always used with “i” or “a” i -> inner a -> around
Summary #
- ‘’, “”, [], ``,
- t, tag
- w, words
- (), b
- , B
- l
- s, sentence
- p, paragraph
- i, I
- J
Native #
- i’: ’this inner’
- i": “this inner”
- a": “this inner, including quotes”
- w: word -> this-word-copied
- o: symbol -> this-entire-symbol-will-be-copied
“evil-textobj-line” #
- iI or al: line object with
evil-indent-plus #
i -> inner indentation I -> inner indentation with white spaces j -> inner indentation with line above J -> inner indentation with line above and below
- ii or ai: inner indentation or higher
- iI: same as above, including live above
- aI: with white spaces
- iJ: including line above and below
- aJ: same as above plus white spaces
Org mode #
- C - j,k: navigate at node levels
- M - j,k: drag node
- M - h,l: move whole tree right/left
Things to remember #
- vim records all the keystrokes untill you are out of insert mode to normal mode. Micro macro, “.” operator, will repeat this action: powerful stuff. If edits are composed around this, the actions can be repeat with “.” and undone with “u”.
- Paste happens after the cursor.
Macro #
q<register><commands>q
qao<ESC>q
# then
@a # to run the macro
To apply macro to multiple lines use V(visual mode) to select lines and then @ followed by macro register.
Commands #
did not work
- :ex -> file explorer in current dir
- :Sex or :Vex -> split horizontally or vertically in current directory
Custom #
- C-c C-j -> previous buffer C-c j -> previous buffer
- C-c C-k -> next C-c k -> next
Emacs Tabs CS #
Emacs workspaces
- C-SPC t t -> select tab(emacs workspace)
- C-SPC t j,k -> previous or next tab
Evil Folding and Navigation CS #
- z c
- close fold
- z m
- close all folds
- z B
- outline-hide-body hide all leaving headings visible
- z o
- open fold
- z O
- open all sub folds
- z r
- open all folds
- z =
- spell check
- z p
- hide others open just current tree
- z e
- show entry
- z t
- move current cursor position to top
- z z
- move current cursor position to center
- z b
- move current cursor position to bottom
- z d
- jump to next(below) heading
- [[
- jump to previous heading
- ]]
- jump to next heading
- C-j
- jump to below heading same level
- C-k
- jump to above heading same level
outline functions #
Python #
Yank ATTACH #

Text Object #
- C -> class
- c -> comment
- f -> function/method
- F -> call
- l -> loop
- v -> conditional
Navigate Code Level #
=counsel-imenu (SPC s i) #
- list of functions/methods and jump
jump on symbols or index symbols(functions, classes) #
SPC-c-m-iconsult-outlineSPC-c-m-llsp-ui-imenu-