Evil CS

Combos or Idioms

  1. g; -> last change, in edit mode
  2. g, -> opposite of g;
  3. gx -> text exchange gX -> cancel exchange
  4. gi -> insert resume where ever edit was happening.
  5. gJ -> join white spaces
  6. cstt -> change sorrounding tag wo changing the attributes
  7. o, ctrl-o, p -> paste on new line
  8. ddp -> move line down
  9. ddkp -> move up line
  10. xp -> swap two characters
  11. ggg?G -> ROT-13 to hide what you are working on
  12. yygccp -> duplicate line mark orginal as comment copy -> comment -> paste
  13. V$% -> select from function name to }, e.g. javascript function.
    1. V: highlight current line in visual line mode
    2. $: end of line
    3. %: jump to next end of ( or {
  14. vaBV -> from within “{}” selection function
    1. highlight around B ({})
    2. V: highlight top most line
  15. yiW -> word with “” w: single word W: word excluding space or including “

Insert mode

  1. ctrl-i: indent
  2. ctrl-j: new-line or enter or indent
  3. ctrl-t: de-dent(tab)
  4. ctrl-k: kill line
  5. ctrl-p: auto complete from previous symbols in buffer
  6. ctrl-n: auto complete from next symbols in buffer
  7. ctrl-u: universal argument current config says not defined
  8. ctrl-r: register
  9. ctrl-l: recenter-top-bottom
  10. ctrl-o, ctrl-g: normal-mode

Operators

  1. y: copy
  2. d: delete
  3. c: change
  4. >: indent
  5. <: de-indent
  6. g: go jump
  7. z: fold/unfold
  8. gc: comment
  9. s: surround
  10. ~: capitalize character
  11. g~: operator toggle capitalization
  12. gu: operator lower case
  13. gU: operator upper case

Motions

b, B, p, s can be used as text objects: with “i” and “a”.

  1. ( or b: block
  2. { or B:
  3. p: paragraph(/n)
  4. 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

  1. ‘’, “”, [], ``,
  2. t, tag
  3. w, words
  4. (), b
  5. {}, B
  6. l
  7. s, sentence
  8. p, paragraph
  9. i, I
  10. J

Native

  1. i': ‘this inner’
  2. i": “this inner”
  3. a": “this inner, including quotes”

“evil-textobj-line”

  1. iI or al: line object with

evil-indent-plus

  1. ii or ai: inner indentation or higher
  2. iI: same as above, including live above
  3. aI: with white spaces
  4. iJ: including line above and below
  5. aJ: same as above plus white spaces

Org mode

  1. C - j,k: navigate at node levels
  2. M - j,k: drag node
  3. M - h,l: move whole tree right/left

Things to remember

  1. 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”.
  2. 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 <2022-07-21 Thu>

  1. :ex -> file explorer in current dir
  2. :Sex or :Vex -> split horizontally or vertically in current directory

Evil Agenda

ref

  1. I -> clock in
  2. O -> clock out
  3. t -> cycle through todo
  4. a -> add notes
  5. gr, gR -> refresh agenda and all agendas
  6. da, dA -> archive
  7. dd -> delete item
  8. cT -> set timer
  9. ct -> set tag
  10. cg -> jump to currently clocked in task
  11. sc, sr, se, st, s^: search/filter
  12. C -> capture k -> when on tags
  13. q -> quit
  14. A -> append to agenda
  15. J,K -> up down priority
  16. s r -> regex search of TODO tasks s r to reset the search

Custom

  1. C-c C-j -> previous buffer C-c j -> previous buffer
  2. C-c C-k -> next C-c k -> next

Tabs

workspaces

  1. C-SPC t t -> select tab(emacs workspace)
  2. C-SPC t j,k -> previous or next tab

Folding

  1. z c: close fold
  2. z m: close all folds z B: outline-hide-body hide all leaving headings visible
  3. z o: open fold
  4. z r: open all folds
  5. z =: spell check
  6. z p: hide others
  7. z e: show entry

outline functions

Dired

  1. I: insert sub dir if any dired-maybe-insert-subdir
  2. a: kill and open dired in a directory dired-find-alternate-file
  3. Enter (don’t use this!): opens new dired buffer which might cause: “dired buffer in use issue”
  4. g h: up in subtree