Improve .t script

This commit is contained in:
Tobias Reisinger 2023-12-19 23:59:30 +01:00
parent d173de93ba
commit 717d35f2b0
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 37 additions and 17 deletions

View file

@ -16,17 +16,19 @@ complete -F _dote_completions ".e"
_dott_completions()
{
if [ "${#COMP_WORDS[@]}" == "1" ]; then
return
if [ "${#COMP_WORDS[@]}" == "2" ]; then
COMPREPLY=()
while IFS='' read -r line
do
COMPREPLY+=("$line")
done < <(compgen -W "$(.t -l)" "${COMP_WORDS[1]}")
fi
COMPREPLY=()
while IFS='' read -r line
do
COMPREPLY+=("$line")
done < <(compgen -W "$(.t -l)" "${COMP_WORDS[1]}")
if [ "${#COMP_WORDS[@]}" == "3" ]; then
compgen -f "${COMP_WORDS[2]}"
fi
}
complete -F _dott_completions ".t"
complete -o filenames -F _dott_completions ".t"
_autostart_manage_completions()
{

View file

@ -0,0 +1 @@
use nix

View file

@ -0,0 +1,5 @@
with import <nixpkgs> {};
mkShell {
nativeBuildInputs = [
];
}

3
.config/templates/sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh