Some cleaning up
This commit is contained in:
parent
3f3cd0c357
commit
3fba3e9f3e
2 changed files with 12 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue