-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .editorconfig Update .pre-commit-config.yaml Add install methods and optional dependencies to fix #3 Fix some syntax errors
- Loading branch information
Showing
48 changed files
with
278 additions
and
216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[LICENSE] | ||
indent_size = unset | ||
|
||
[Makefile] | ||
indent_style = tab |
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,13 +1,15 @@ | ||
# define some functions to avoid any error that these programs don't exist | ||
(($+commands[bat])) || bat() {cat} | ||
(($+commands[pygmentize])) || pygmentize() {cat} | ||
(($+commands[delta])) || delta() {cat} | ||
(($+commands[less])) || less() {ls -l} | ||
(($+commands[finger])) || finger() {(($+commands[pinky])) && pinky $@ || whoami} | ||
(($+commands[pandoc])) || pandoc() {cat ${@[-1]}} | ||
(($+commands[grc])) || grc() {eval ${@[2,-1]}} | ||
|
||
# dictionary $ZINIT cannot be passed | ||
PLUGINS_DIR=${ZINIT[PLUGINS_DIR]} | ||
(($+commands[jq])) || jq() {echo ';'} | ||
|
||
mkdir -p ~/.gitmoji | ||
touch ~/.gitmoji/gitmojis.json | ||
|
||
# dictionary $ZINIT cannot be passed | ||
PLUGINS_DIR=${ZINIT[PLUGINS_DIR]} |
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,15 +1,15 @@ | ||
# :fzf-tab:complete:(-command-:|command:option-(v|V)-rest) | ||
case $group in | ||
'external command') | ||
less =$word | ||
;; | ||
'executable file') | ||
less ${realpath#--*=} | ||
;; | ||
'builtin command') | ||
run-help $word | bat --color=always -plman | ||
;; | ||
parameter) | ||
echo ${(P)word} | ||
;; | ||
'external command') | ||
less =$word | ||
;; | ||
'executable file') | ||
less ${realpath#--*=} | ||
;; | ||
'builtin command') | ||
run-help $word | bat --color=always -plman | ||
;; | ||
parameter) | ||
echo ${(P)word} | ||
;; | ||
esac |
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,10 +1,10 @@ | ||
# :fzf-tab:complete:(\\|*/|)adb-(push|pull|shell):argument-rest | ||
case $group in | ||
'file/folder on device') | ||
# https://github.com/Aloxaf/fzf-tab/issues/325 | ||
adb shell 'type=$(file -L '"$ctxt[hpre]$word"' | cut -d: -f2) && test -z "${type/ASCII text/}" && cat '"$ctxt[hpre]$word"' || ls -l --color '$ctxt[hpre]$word | ||
;; | ||
'local file/folder') | ||
less $realpath | ||
;; | ||
'file/folder on device') | ||
# https://github.com/Aloxaf/fzf-tab/issues/325 | ||
adb shell 'type=$(file -L '"$ctxt[hpre]$word"' | cut -d: -f2) && test -z "${type/ASCII text/}" && cat '"$ctxt[hpre]$word"' || ls -l --color '$ctxt[hpre]$word | ||
;; | ||
'local file/folder') | ||
less $realpath | ||
;; | ||
esac |
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,9 +1,9 @@ | ||
# :fzf-tab:complete:(\\|*/|)bat:argument-rest | ||
case $group in | ||
subcommand) | ||
bat cache --help | bat --color=always -plhelp | ||
;; | ||
*) | ||
[[ -f ${realpath#--*=} ]] && bat ${realpath#--*=} || less ${realpath#--*=} | ||
;; | ||
subcommand) | ||
bat cache --help | bat --color=always -plhelp | ||
;; | ||
*) | ||
[[ -f ${realpath#--*=} ]] && bat ${realpath#--*=} || less ${realpath#--*=} | ||
;; | ||
esac |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:(\\|)bindkey:option-M-1 | ||
case $group in | ||
keymap) | ||
bindkey -M$word | bat --color=always -pltsv | ||
;; | ||
keymap) | ||
bindkey -M$word | bat --color=always -pltsv | ||
;; | ||
esac |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:(\\|*/|)cowsay: | ||
case $group in | ||
'cow file') | ||
cowsay -f $word hello | ||
;; | ||
'cow file') | ||
cowsay -f $word hello | ||
;; | ||
esac |
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,9 +1,9 @@ | ||
# :fzf-tab:complete:(\\|*/|)dpkg:argument-rest | ||
case $group in | ||
file) | ||
dpkg -S $word | ||
;; | ||
package) | ||
dpkg -L $word | ||
;; | ||
file) | ||
dpkg -S $word | ||
;; | ||
package) | ||
dpkg -L $word | ||
;; | ||
esac |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:(\\|*/|)flatpak: | ||
case $group in | ||
argument) | ||
flatpak $word --help | bat --color=always -plhelp | ||
;; | ||
argument) | ||
flatpak $word --help | bat --color=always -plhelp | ||
;; | ||
esac |
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,2 +1,2 @@ | ||
# :fzf-tab:complete:(\\|*/|)gdu:argument-rest | ||
[ -d $realpath ] && gdu -n $realpath || grc --colour=on du -sh $realpath | ||
[ -d $realpath ] && gdu -n $realpath || grc --colour=on du -sh $realpath |
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,3 +1,3 @@ | ||
# :fzf-tab:complete:(\\|*/|)gio: | ||
[[ -f $realpath ]] && less $realpath \ | ||
|| gio help $word 2>&1 | bat --color=always -plhelp | ||
[[ -f $realpath ]] && less $realpath || | ||
gio help $word 2>&1 | bat --color=always -plhelp |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:git-blame:argument-2 | ||
case $group in | ||
'cached file') | ||
git blame $word | delta | ||
;; | ||
'cached file') | ||
git blame $word | delta | ||
;; | ||
esac |
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,12 +1,15 @@ | ||
# :fzf-tab:complete:git-checkout:argument-rest | ||
case $group in | ||
'modified file') | ||
git diff $word | delta | ||
;; | ||
'recent commit object name') | ||
git log --color=always $word | perl -pe$(jq -j '.[] as $i | "s=" + $i.code + "=" + $i.emoji + "=g;"' ~/.gitmoji/gitmojis.json) | delta | ||
;; | ||
*) | ||
git log --color=always $word | perl -pe$(jq -j '.[] as $i | "s=" + $i.code + "=" + $i.emoji + "=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
'modified file') | ||
git diff $word | delta | ||
;; | ||
'recent commit object name') | ||
git log --color=always $word | | ||
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) | | ||
delta | ||
;; | ||
*) | ||
git log --color=always $word | | ||
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
esac |
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,9 +1,9 @@ | ||
# :fzf-tab:complete:git-(diff|cherry-pick):argument-rest | ||
case $group in | ||
'tree file') | ||
less ${realpath#--*=} | ||
;; | ||
*) | ||
git diff $word | delta | ||
;; | ||
'tree file') | ||
less ${realpath#--*=} | ||
;; | ||
*) | ||
git diff $word | delta | ||
;; | ||
esac |
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,2 +1,3 @@ | ||
# :fzf-tab:complete:git-log:argument-1 | ||
git log --color=always $word | perl -pe$(jq -j '.[] as $i | "s=" + $i.code + "=" + $i.emoji + "=g;"' ~/.gitmoji/gitmojis.json) | ||
git log --color=always $word | | ||
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) |
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,12 +1,12 @@ | ||
# :fzf-tab:complete:git-((push|pull):argument-1|fetch:argument-rest) | ||
case $group in | ||
'local repository') | ||
less ${realpath#--*=} | ||
;; | ||
remote) | ||
git remote show $word | ||
;; | ||
*host*) | ||
grc --colour=on ping -c1 $word | ||
;; | ||
'local repository') | ||
less ${realpath#--*=} | ||
;; | ||
remote) | ||
git remote show $word | ||
;; | ||
*host*) | ||
grc --colour=on ping -c1 $word | ||
;; | ||
esac |
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,9 +1,11 @@ | ||
# :fzf-tab:complete:git-reflog(|-*):argument-1 | ||
case $group in | ||
command) | ||
git reflog --color=always show | perl -pe$(jq -j '.[] as $i | "s=" + $i.code + "=" + $i.emoji + "=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
reference) | ||
git reflog --color=always $word | perl -pe$(jq -j '.[] as $i | "s=" + $i.code + "=" + $i.emoji + "=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
command) | ||
git reflog --color=always show | | ||
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
reference) | ||
git reflog --color=always $word | | ||
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) | ||
;; | ||
esac |
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,9 +1,9 @@ | ||
# :fzf-tab:complete:git-show:argument-rest | ||
case $group in | ||
'commit tag') | ||
git show --color=always $word | ||
;; | ||
*) | ||
git show --color=always $word | delta | ||
;; | ||
'commit tag') | ||
git show --color=always $word | ||
;; | ||
*) | ||
git show --color=always $word | delta | ||
;; | ||
esac |
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,3 +1,3 @@ | ||
# :fzf-tab:complete:(\\|*/|)groff:argument-1 | ||
[[ -f $realpath ]] && groff $realpath | pygmentize -l postscript \ | ||
|| less $realpath | ||
[[ -f $realpath ]] && groff $realpath | pygmentize -l postscript || | ||
less $realpath |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:(\\|*/|)has:argument-rest | ||
case $group in | ||
'external command') | ||
has $word | ||
;; | ||
'external command') | ||
has $word | ||
;; | ||
esac |
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,4 @@ | ||
# :fzf-tab:complete:(\\|*/|)help2man: | ||
[[ -f $realpath ]] \ | ||
&& help2man $realpath | man --local-file - | bat --color=always -plman \ | ||
|| less $realpath | ||
[[ -f $realpath ]] && | ||
help2man $realpath | man --local-file - | bat --color=always -plman || | ||
less $realpath |
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,6 +1,6 @@ | ||
# :fzf-tab:complete:(\\|*/|)ip: | ||
case $group in | ||
'ip command') | ||
ip $word help 2>&1 | bat --color=always -plhelp | ||
;; | ||
'ip command') | ||
ip $word help 2>&1 | bat --color=always -plhelp | ||
;; | ||
esac |
Oops, something went wrong.