editors: vi and emacs
vi
- vi is the built-in editor in UNIX/LINUX.
- It does not need any graphics surface or ability.
- It is therefore highly portable and sometimes the user's last
hope.
- It has lots of options, only the few most basic ones will be
covered in the lecture.
- Most of the options are "clickable", we will learn some of the
keyboard commands.
start vi
|
vi [filename]
|
input/command mode
|
i/Esc
|
save or quit
|
command mode: :w or :q
|
save and quit
|
command mode: :wq
|
undo last
|
command mode: :u
|
delete line or character
|
command mode: d or x
|
emacs
- emacs is another widely used editor in UNIX/LINUX.
- It does need a graphics surface.
- Its appearance and functionality can be manipulated in the .emacs
file.
- It has lots of options, only the few most basic ones will be
covered in the lecture.
- The options are steered partly by the minibuffer on the bottom.
start emacs
|
emacs [filename]
|
save or quit
|
Ctrl-x Ctrl-s or Ctrl-x Ctrl-c
|
write and find [name]
|
Ctrl-x Ctrl-w or Ctrl-x Ctrl-f "name"
|
delete line
|
Ctrl-k
|
set mark / delete from marked
|
Ctrl-space / Ctrl-w
|
recover last deleted
|
Ctrl-y
|
search
|
Ctrl-s
|
replace expressions
|
Esc-x + type query-replace
|
exit the minibuffer
|
Ctrl-g
|
[prev]
[top]
[next]
|