dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 4b8b7ffe97fd0cb770217247362077ad23508bb3
parent 28bb5224e4c04cbaa7ee7c359026945765fdb9c5
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun,  1 Jul 2018 13:10:34 -0400

Update Zsh and Bash completions

Diffstat:
M.bashrc | 6+++++-
M.zshrc | 21++++++++++++++++++++-
2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -34,7 +34,7 @@ _my() selector="${COMP_WORDS[1]}" opts="term lock wallpaper standby shutdown perms init open sound \ kbopts screen brightness battery status i3status copy paste \ - netrc dotfiles cron login_async login" + netrc dotfiles cron login_async login mailto search" case "$selector" in sound) @@ -80,6 +80,10 @@ _my() return 0 ;; open) + if [ "$prev" = "$selector" ] + then + COMPREPLY=( $(compgen -W -T -- $cur) ) + fi _filedir return 0 ;; diff --git a/.zshrc b/.zshrc @@ -74,6 +74,8 @@ _my() 'cron:run cron jobs' 'login_async:login (blocking)' 'login:login' + 'mailto:send email' + 'search:search DuckDuckGo in the terminal' ) _describe -t subcommands 'my subcommand' subcommands && ret=0 ;; @@ -148,7 +150,12 @@ _my() fi ;; open) - _files + if [ $CURRENT -eq 2 ] + then + _alternative 'arguments:open in terminal:(-T)' 'files:filename:_files' && ret=0 + else + _files + fi ;; init) args=( @@ -172,6 +179,18 @@ _my() _describe -t subcommands 'netrc subcommand' subcommands && ret=0 fi ;; + mailto) + if [ $CURRENT -eq 2 ] + then + _alternative 'address:email address to send:()' && ret=0 + elif [ $CURRENT -eq 3 ] + then + _alternative 'subject:email subject line:()' && ret=0 + fi + ;; + search) + _alternative 'term:search term:()' && ret=0 + ;; esac esac }