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

View file

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