aboutsummaryrefslogtreecommitdiff
path: root/bin/e
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-19 10:44:56 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-19 10:44:56 +0200
commitd88a036686497275931ea72626756e3f5414d7de (patch)
tree5e93228629dbc6f6da0a2533e4dccba1f1ffec6b /bin/e
parent41a66398b0cfbb5f98e4f2bfc6f481c7853a218d (diff)
downloaddotfiles-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>
Diffstat (limited to 'bin/e')
-rwxr-xr-xbin/e9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/e b/bin/e
index 32b05a0..db534fc 100755
--- a/bin/e
+++ b/bin/e
@@ -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