2.7 KiB
2.7 KiB
Lesson 03 | text editors (vim)
Links
notes
modes
normal mode
- not editing directly
- default
- get to it via ESC
insert mode
- i
- pushes text aside
replace mode
- R (capital 'r')
- overwrites text
visual mode
-
line visual: Shift+V
- goes by line
-
block visual: Ctrl+V
- allows you to select vertical and horizontal
command line
opening vim
- entered via ':'
buffers vs windows
-
vim maintains a set of open buffers
- any buffer can be open in 0 or more windows at any time
- you can have tabs, and tabs can contain windows
quiting
-
:q only closes the current WINDOW, not buffer
- :q exits when there are no more windows open
- :qa is "quit all" and closes all windows
movement
- hjkl
- w/b forward and backward by one word
- e end of word
- 0/$ beginning and end of line
- ^ first non empty character on a line
scrolling up and down
- C+U move up
- C+D move down
move by buffer
- G moves to end of buffer
- gg move to top of buffer
move by screen
- L moves to lowest line on screen
- M moves to middle line on screen
- H moves to the highest on screen
move by find
- f <letter> will move to the first letter forward
- F <letter> backwards
- t <letter> moves to just before the letter
- T <letter> moves backwards to in front of the letter