There are many text editors to use in the terminal:
Vim is standard on most machines and most code editors support vim keybindings either directly or with settings or plugins. Vim is not easy to learn, but a working knowlege is not hard, and it is extremely powerful. Using a terminal-based text editor is especially convenient (if not required) when working on remote computers, as is common in high-perforance computing.

vimtutor for a tutorialGoogle: “vim tutorials game”
vim file1i insert before the cursor
I to insert at the start of the linea insert after the cursor
A append at the end of the lineo to start (open) a new line below
O to open a new line above:w<enter> when in normal mode.:q, or ZZ in normal mode:wqh, j, k , l to move left, up, down, rightw to move by “words”
W to move by separated words$ to go to the end of the line0 to go to the start of the lineG to go to the end of the filegg to go to the top of the file:7 to go to line 7, etc.yy to copy (yank) current linep to paste after
P to paste beforedd to delete the current line (and copy it)u to undo
<ctrl>-r (hit control and r) to redoD to delete to the end of the linex to delete under the cursor/searchWord to search file for searchWord
n to jump to the next instanceN to jump to the previous instance