-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the `_colorls` completion file to the `zsh/` folder of the gem and make the `tab_complete.sh` script work for Zsh too.
- Loading branch information
Showing
4 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
function _colorls_complete() { | ||
COMPREPLY=( $( colorls --'*'-completion-bash="$2" ) ) | ||
} | ||
complete -o default -F _colorls_complete colorls | ||
|
||
if [ -z "${ZSH_VERSION+x}" ]; then | ||
function _colorls_complete() { | ||
COMPREPLY=( $( colorls --'*'-completion-bash="$2" ) ) | ||
} | ||
complete -o default -F _colorls_complete colorls | ||
else | ||
fpath=("${0:A:h:h}/zsh" $fpath) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#compdef colorls | ||
|
||
typeset -A opt_args | ||
local context state line | ||
|
||
_arguments -s -S \ | ||
"-a[do not ignore entries starting with .]" \ | ||
"--all[do not ignore entries starting with .]" \ | ||
"-A[do not list . and ..]" \ | ||
"--almost-all[do not list . and ..]" \ | ||
"-l[use a long listing format]" \ | ||
"--long[use a long listing format]" \ | ||
"--tree[shows tree view of the directory]" \ | ||
"--report[show brief report]" \ | ||
"-1[list one file per line]" \ | ||
"-d[show only directories]" \ | ||
"--dirs[show only directories]" \ | ||
"-f[show only files]" \ | ||
"--files[show only files]" \ | ||
"--gs[show git status for each file]" \ | ||
"--git-status[show git status for each file]" \ | ||
"--sd[sort directories first]" \ | ||
"--sort-dirs[sort directories first]" \ | ||
"--group-directories-first[sort directories first]" \ | ||
"--sf[sort files first]" \ | ||
"--sort-files[sort files first]" \ | ||
"-t[sort by modification time, newest first]" \ | ||
"-U[do not sort; list entries in directory order]" \ | ||
"-S[sort by file size, largest first]" \ | ||
"--sort[sort by WORD instead of name: none, size (-S), time (-t)]" \ | ||
"-r[reverse order while sorting]" \ | ||
"--reverse[reverse order while sorting]" \ | ||
"--light[use light color scheme]" \ | ||
"--dark[use dark color scheme]" \ | ||
"-h[prints this help]" \ | ||
"--help[prints this help]" \ | ||
"--version[show version]" \ | ||
'*:file:_files' && return 0 |