This version (2024/10/24 10:28) is a draft.
Approvals: 0/1
Approvals: 0/1
Editors
General
- Many different editors
- Unique (dis-)advantages
- Different look and feel
- Editors should provide us with
- Simple text editing
- Copy and paste
- Search and replace
- Saving changes
- Wide availability
Two editors that satisfy our needs:
- nano
- vim
Common starting point
nano filename
vim filename
Nano
Nano explained
This editor is focused on being easy to use, but still providing every feature a user might need.
Interface
The interface consists of four parts, namely from top to bottom:
- Title bar
- Text area
- Command line
- Key bindings
Usage
Nothing special, key-bindings visible while editing
Feature | Usage |
---|---|
Navigation | Arrow keys |
Actual editing | Typing text, as usual |
Cut/Paste line | <CTRL> +k / <CTRL> +u |
… | explained in key bindings field |
Short
Use this editor if you are new to the command line.
It is straight forward, but can be extended on the way.
- Auto-indentation
- Syntax highlighting
- Multi-buffer
Vi(m)
Vi(m) explained
This editor is focused on productivity and efficiency, providing everything a user might need.
Interface
The simple interface consists of two parts:
- Text area
- Command line
Since this editor is very easy to extend, after setting up a few plug-ins, it will probably look quite different!
Usage
This is a multi-mode editor, you’ll have to switch modes whenever you change what you want to do.
Feature | Usage |
---|---|
Navigation | Arrow keys |
Writing | change to input mode, then write as usual |
Commands | exit current mode, press : |
… | explained on next slide |
Short
Use this editor if you like a challenge.
It is fast and very nice — but you’ll sometimes get hurt on the way.
<HTML> <!– - Auto-indentation, Syntax highlighting, Multi-buffer – just like nano –> </HTML>
- File/Project Management
- Use a plug-in manager
Vi(m) modes and keys
- any mode:
- back to the default mode:
<ESC>
- command mode (followed by
<RETURN>
):- save current file:
w [filename]
- quit the editor
- after saving:
q
- without confirmation:
q!
- help:
h [topic]
, e.g.h tutorial
- search and replace:
%s/old/new/gc
- default mode:
- enter input mode:
i
- enter command mode:
:
(colon) - mark
- character-wise:
v
- line-wise:
<SHIFT>-v
- delete
- character-wise:
x
- line-wise:
dd
- marked content:
d
- search:
/abc