4: Text editors, scripts, IDEs - SIWLab/Lab_Info GitHub Wiki
There are many options for creating and editing text files, scripts, and so on in the server.
Introducing vim
Vim is a handy text editor but has a learning curve. Here is a useful guide. The version on ohta allows navigation using the up/down/left/right keys.
# create a file or edit an existing one
vi filename
Use the "i" key to enter "insert" mode. You can now begin typing. Use the "esc" key to enter Command mode. Command mode is for everything except writing text.
# the following is done in command mode, make sure to esc first.
# to save changes
:w
# to save changes and close the file
:wq
# quit without saving changes
:q!
# undo last change
:u
# navigate to the beginning of a line
^
# navigate to the end of a line
$
# delete a line
dd
Other options
Nano is another popular text editor. Some folks use emacs (Zoë is the lab expert).
You can also write scripts locally using a regular text editor like Notepad, textEdit, BBedit, etc. etc. but this is not always convenient since whatever you write needs to be copied to the server to run.
vscode can do it!
vscode is a free open-source IDE (integrated development environment). Some helpful add-ons make it easy to edit scripts in the server. The remote development extensions need to be installed first.