diff options
Diffstat (limited to 'alacritty/.local')
-rwxr-xr-x | alacritty/.local/bin/src | 18 | ||||
-rwxr-xr-x | alacritty/.local/share/zsh/site-functions/_src | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/alacritty/.local/bin/src b/alacritty/.local/bin/src new file mode 100755 index 0000000..79c2333 --- /dev/null +++ b/alacritty/.local/bin/src @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ ! -d "$1" ]; then + project="$( + projectr -mgE ~/.local/src | + fzf --tmux --tac -0 -1 -d/ --with-nth=-1 --preview='lesspipe.sh {}' --query="$1" + )" + if [ -z "$project" ]; then + exit 0 + fi + set -- "$project" +fi + +if [ ! -d "$1" ]; then + exit 1 +fi + +alacritty msg create-window -T"$(basename "$1")" --working-directory="$1" diff --git a/alacritty/.local/share/zsh/site-functions/_src b/alacritty/.local/share/zsh/site-functions/_src new file mode 100755 index 0000000..1fb5c30 --- /dev/null +++ b/alacritty/.local/share/zsh/site-functions/_src @@ -0,0 +1,5 @@ +#compdef _src src + +function _src { + _arguments "*:projects:_files -/ -W ~/.local/src" +} |