commit 32951da5f0d63d8322aff6fded4e88940c1d165f
Author: Simon Watson <spw01@protonmail.com>
Date: Thu Dec 29 16:43:40 2022 -0500
Fixed an oversight that would cause an infinite loop
diff --git a/bashrc/bashrc-all b/bashrc/bashrc-all
index e9390ac..d0bb235 100644
--- a/bashrc/bashrc-all
+++ b/bashrc/bashrc-all
@@ -1,3 +1,5 @@
+# -*- shell-script-mode -*-
+
if [ -f ~/.wal_alias ]; then
. ~/.wal_alias
fi
@@ -12,7 +14,6 @@ if [ -f ~/.cache/wal/sequences ]; then
$CAT_PATH ~/.cache/wal/sequences
fi
-export EDITOR=$(which vim)
BPYTOP_PATH=$(which bpytop)
BTOP_PATH=$(which btop)
@@ -65,16 +66,15 @@ fi
# Stop myself from opening vim when I mean to open emacs on the term
vim()
{
- if command -v emacs;
- then
- if [[ $(ps aux | grep -v grep | grep emacs) ]];
- then
- # using anemic term/color/etc as it's faster in emacs
- TERM=tmux emacsclient -nw $1
-
- else
- vim $1
- fi
+ if [[ $(ps aux | grep -v grep | grep emacs) ]];
+ then
+ # using anemic term/color/etc as it's faster in emacs
+ TERM=tmux emacsclient -nw $1
+ export EDITOR="emacsclient"
+ else
+ VIM_PATH=$(which vim)
+ $VIM_PATH $1
+ export EDITOR=$VIM_PATH
fi
}