diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-09-19 10:44:56 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-09-19 10:44:56 +0200 |
| commit | d88a036686497275931ea72626756e3f5414d7de (patch) | |
| tree | 5e93228629dbc6f6da0a2533e4dccba1f1ffec6b | |
| parent | 41a66398b0cfbb5f98e4f2bfc6f481c7853a218d (diff) | |
| download | dotfiles-d88a036686497275931ea72626756e3f5414d7de.tar.gz dotfiles-d88a036686497275931ea72626756e3f5414d7de.zip | |
e: Fix vi call and introduce nano
The vi branch was calling vim anyways, which is not what we want in
restricted environments. Moreover, I have also added nano. It would be
extremely rare for GNU nano to be there and not vi, but let's exhaust
any possibility before bailing out.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
| -rwxr-xr-x | bin/e | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -15,20 +15,23 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # The *default editor*, which is meant to be installed globally. It attempts to -# write an editor with this preference: +# execute an editor with this preference: # 1. GNU Emacs in client mode. # 2. Vim -> Vi. # 3. Standalone GNU Emacs. -# 4. Outta luck: print an error message. +# 4. GNU nano +# 5. Outta luck: print an error message. if [ -x "$(command -v emacsclient)" ]; then exec emacsclient -a "" -nw "$@" -c elif [ -x "$(command -v vim)" ]; then exec vim "$@" elif [ -x "$(command -v vi)" ]; then - exec vim "$@" + exec vi "$@" elif [ -x "$(command -v emacs)" ]; then exec emacs --quick "$@" +elif [ -x "$(command -v nano)" ]; then + exec nano "$@" else echo "No suitable editor found!" exit 1 |
