|| || || ||/||___ || || /` )____________||_/| ||/___ //_/_/_/_/_/_/||/ | ||(___)/_/_/_/_/_/_/_|| | || |_|_|_|_|_|_|_|| /| || | | | | | | | ||/|| ||~~~~~~~~~~~~~~~~~~~|| || || Bash only text editor Line-based/modal visual editor. Navigate with the arrow keys and edit with vim-like bindings. Supports basic file editing and viewing (e.g. scrolling, paging up/down, line editing, deleting, saving/loading). up move up a line down move down a line pgup move up a page (terminal height) pgdown move down a page a append text to the end of the current line b insert blank line after the current line c clear out current line's contents d delete current line e edit current line f set target filename i insert line after the current line and begin editing l load file into the buffer q quit the editing session w write buffer to file
bash only text editor
Line-based/modal visual editor. Navigate with the arrow keys and edit with vim-like bindings.Category: Linux / Shell Script Development |
Watchers: 1 |
Star: 21 |
Fork: 1 |
Last update: Jul 28, 2020 |
Since on QWERTY keyboards 'Q' and 'W' are next to each other and most of text editors have this feature, I thought it would have been nice to add a prompt to ask the user if he wants to save changes (or abort) on quit command.
I've implemented a variable unsaved_changes
which becomes 1 after making any change. If the edit command ('e') is performed, the variable is set to 1, only if the line content has actually changed.
The variable is reset to 0 after performing save command ('w')
On quit the user is prompted, in case the variable has value 1, to save changes before exit or not. The user can also cancel the quit action.
I hope this change looks useful to you.
'C' key is bound to line_clear
which doesn't exist. This should fix it.
Might have to fix the clearing rate or something
Default file bed.txt
is not read into the buffer, so it is read if no arguments exist. also version flag missing so added that.
Solves #11 and implements #3 Cleans code drastically and provides easy customization support Also removes some (IMO) useless commands