Evil CS
Combos or Idioms
- g; -> last change, in edit mode
- g, -> 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 “”
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”
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”
“evil-textobj-line”
- iI or al: line object with
evil-indent-plus
- 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
Evil Agenda
- I -> clock in
- O -> clock out
- t -> cycle through todo
- a -> add notes
- gr, gR -> refresh agenda and all agendas
- da, dA -> archive
- dd -> delete item
- cT -> set timer
- ct -> set tag
- cg -> jump to currently clocked in task
- sc, sr, se, st, s^: search/filter
- C -> capture k -> when on tags
- q -> quit
- A -> append to agenda
- J,K -> up down priority
- s r -> regex search of TODO tasks s r to reset the search
Custom
- C-c C-j -> previous buffer C-c j -> previous buffer
- C-c C-k -> next C-c k -> next
Tabs
workspaces
- C-SPC t t -> select tab(emacs workspace)
- C-SPC t j,k -> previous or next tab
Folding
- z c: close fold
- z m: close all folds z B: outline-hide-body hide all leaving headings visible
- z o: open fold
- z r: open all folds
- z =: spell check
- z p: hide others
- z e: show entry
outline functions
Dired
- I: insert sub dir if any dired-maybe-insert-subdir
- a: kill and open dired in a directory dired-find-alternate-file
- Enter (don’t use this!): opens new dired buffer which might cause: “dired buffer in use issue”
- g h: up in subtree