The issue of burdensome and repetitive instructions on a single page regarding the different ways to edit a text file was discussed before. I was recently surprised to find this taking place even on the KVM installation instructions page.
I would like to suggest the following be added to the top of every guide-style page that requires editing text files:
Editing text files
In this guide [/page] we use nano [optional: link to a very quick guide, added below] as a text editor. If you prefer a graphical editor use mousepad (on XFCE) or kwrite (on KDE).
For example, instead of:
nano filename [or always sudo nano?]
kdesudo mousepad filename
Then, all the instructions throughout the page will only use nano instead of the repeated clause "if you are using… then… ".
To make things more friendly I wrote the following “very quick guide” mentioned above (should appear on a dedicated page, containing only that):
Nano is a popular and simple text editor in Linux. Basic usage:
- Open the file for editing by typing in terminal:
- If the file was created by root, we need to use sudo to get proper privileges:
sudo nano filename
- If you try to edit a file that does not exist, nano will create the file.
Essential keyboard shortcuts:
- To save: CTRL-O
- To Exit: CTRL-X
- Moving the cursor is done using the arrow keys or Page Up and Page Down. Mouse click does not move the cursor.
More keyboard shortcuts:
- To delete a full line: move to that line, then press CTRL-K
- To search: press CTRL-W, then type the text you wish to find, then ENTER.
Formatting can be improved of course.
More can be added, but I think it’s unnecessary. Better keep it short. Even the search function is probably not required for the tasks users are expected to follow throughout the guides. We may add:
For the complete features, type