Vim
Vim
In this chapter
In the beginning
vim
vim cont
Starting vim
Cursor
Tildes represent
empty lines
Current
column
Current line
Current buffer
(the file youre editing)
How it works
vim copies the contents of the file you want to edit into
memory
This memory is referred to as the Work Buffer
Changes are made to the buffer, not the file
You must write changes to file when done editing the buffer
Modes
Command Mode
Default mode
Used to enter commands
Text manipulation
Change modes
Save/exit
Most commands are just alpha characters, not control
sequences
Case sensitive!
Insert Mode
i
I
a
A
o
O
r
R
w write file
q quit
w! write read-only file
q! quit without saving changes
e filename opens a file for editing
sh open a shell
!command open a shell, run a command, then exit the shell
.!command open a shell, run a command, exit the shell,
placing the standard output into the work buffer
Can also do !!command from Command Mode
Buffers
Work buffer
General Purpose Buffer kind of like the clipboard in
Windows
Named buffers
Numbered buffers
Named Buffers
Numbered Buffers
Numbered 1-9
Read only
Contain most recently deleted chunks of data greater than
one line long
You can paste (put) from these buffers and use them for
undoing deletes
yank
yank cont
put
vim