Some cleaning up

This commit is contained in:
Nox Sluijtman 2023-10-20 14:51:17 +02:00
parent 3f3cd0c357
commit 3fba3e9f3e
2 changed files with 12 additions and 10 deletions

View file

@ -1,11 +1,12 @@
#! /bin/sh #! /bin/sh
usage(){ printf "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim\n"; }
if [ $# -eq 1 ] ; then if [ $# -eq 1 ] ; then
case $1 in case $1 in
--help) echo "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim";; --help) usage ;;
-h) echo "Opens a script in vim either as an argument or from the ~/.local/bin directory using skim";; -h) usage ;;
*) $EDITOR $(which $1);; *) $EDITOR $(which $1);;
esac esac
else else
script=$(find ~/.local/bin -type f | sk --preview 'cat {}') script=$(find ~/.local/bin -type f | sk --preview 'cat {}')
[ "$script" != "" ] && nvim $script || exit 0 [ ! -z "$script" ] && $EDITOR $script || exit 0
fi fi

View file

@ -1,9 +1,10 @@
se(1) irs(1)
# NAME # NAME
*irs* - because -- and I quote: "Random collection of scripts. The IRS collects *irs* - because -- and I quote: "Random collection [of scripts]. The IRS
taxes. You send a wrong amount of taxes, they randomly send you to jail." collects taxes. You send a wrong amount of taxes, they randomly send you to
jail."
# DESCRIPTION # DESCRIPTION
@ -15,12 +16,12 @@ both problems.
# SCRIPTS # SCRIPTS
*se* *se*
short for 'script edit'; when not given any arguments opens '*~/.local/bin*' Abbreviated form of 'script edit'; when not given any arguments opens
in *sk(1)* and allows you to make a seletion of what item in there using '*~/.local/bin*' in *sk(1)* and allows you to make a selection of what item
*$EDITOR* in there using *$EDITOR*. Usage can be printed with '-h'.
*open-bookmark* *open-bookmark*
opens a bookmark in *xdg-open(1)*, see its own manpage for more information Opens a bookmark in *xdg-open(1)*, see its own manpage for more information
# SEE ALSO # SEE ALSO