Skip to content

Latest commit

 

History

History
186 lines (110 loc) · 4.75 KB

eviltutorsheet.md

File metadata and controls

186 lines (110 loc) · 4.75 KB

Movements

Arrow keys

You can use the arrow keys in Evil mode, it's not the best way but it works :

Evil moves

Spacemacs using Evil helps you improve fast movements with these keys :

h j k l

Objects

Refer a word using w

Refer a line using $

Formatting commands

Use a command on multiple objects in one row using : [number] [command] [object] OR [command] [number] [object]

Example : 5 d w deletes five words from cursor

Deletion

Single caracter

x

Single word

d w

Single line

d $ d d

Paste

p puts the deleted/copied/cut text after the cursor

Replace

Character

r replaces the character under the cursor

Word

c replaces the word from the cursor

Replace mode

R to enter replace mode until Esc is pressed

Undos / Redos

Spacemacs remembers your actions to go back in time or move forward again.

u to undo last action (keep pressed for multiple)

Ctrl + R to redo last action (keep pressed for multiple)

Moving

At bottom of buffer

G

At beginning of buffer

g g

At specific line

: +[number] : moves you to line [number]

Inserting text

Characters

i will open edit mode to insert a character before current cursor

a will open edit mode to insert a character after current cursor

Lines

o will open edit mode to insert a new line after current cursor

O will open edit mode to insert a new line before current cursor

Append at line

A to append text to the end of the line

Searching / Replacing

Searching in text

/ followed by a phrase searches FORWARD in text

? followed by a phrase searches BACKWARD in text

Replacing

: s / OLD / NEW To substitute new for the first old on a line type

: s / OLD / NEW / g To substitute new for all 'old's on a line type

: # , # s / OLD / NEW To substitute phrases between two line #'s type

: % s / OLD / NEW / g To substitute all occurrences in the file type

: % s / OLD / NEW / g c To ask for confirmation each time add 'c'

Matching parenthesis

Typing % while the cursor is on a (,),[,],{, or } locates its matching pair.

Saving / Inserting files

Current file

: w to save current buffer to file

Current buffer to specific file

: w FILENAME to save current buffer to specific FILENAME

Specific lines in buffer

: # , # FILENAME to save the lines # through # to specific FILENAME

Inserting file in current position

: r FILENAME retrieves file FILENAME and inserts it into buffer at current position

Exiting

Saving changes

: q a !

Without saving

: w q a