parent
00718d7558
commit
b8e889875e
@ -1,2 +1,21 @@ |
|||||||
# clear out the screen |
# to change default editor change order here: |
||||||
clear |
editors=("nano" "pico" "neovim" "vim" "vi" "emacs") |
||||||
|
geditors=("geany" "brackets" "notepadqq" "code" "medit" "gnome-text-editor" "mousepad" "leafpad" "kwrite" "kate" "pluma" "xed" "sublime" "atom" "gvim") |
||||||
|
|
||||||
|
for editor in "${editors[@]}"; do |
||||||
|
full_path=$(command -v "$editor" 2> /dev/null) |
||||||
|
if [ -n "$full_path" ]; then |
||||||
|
export EDITOR="$full_path" |
||||||
|
break |
||||||
|
fi |
||||||
|
done |
||||||
|
for geditor in "${geditors[@]}"; do |
||||||
|
full_path=$(command -v "$geditor" 2> /dev/null) |
||||||
|
if [ -n "$full_path" ]; then |
||||||
|
export VISUAL="$full_path" |
||||||
|
break |
||||||
|
fi |
||||||
|
done |
||||||
|
alias ,='$EDITOR' |
||||||
|
vis() { $VISUAL $@ & } |
||||||
|
alias @='vis' |
||||||
|
|||||||
Loading…
Reference in new issue