Skip to content

Commit

Permalink
🐛 Fix mdcat
Browse files Browse the repository at this point in the history
Add mdless, texdoc, bundle, rake, ri, npm, neofetch, rlwrap,
git-describe, pod*, luacheck, progress, ar, tar
In git log, add a space to avoid perl error of empty code
Update journalctl
  • Loading branch information
Freed-Wu committed Mar 21, 2023
1 parent cffe29e commit 3e5d74c
Show file tree
Hide file tree
Showing 31 changed files with 90 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ repos:
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
rev: v1.4.2
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.0dev
rev: v0.19.1
hooks:
- id: gitlint
args:
- --msg-filename
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.6.2
rev: 2.7.1
hooks:
- id: editorconfig-checker
- repo: https://github.com/jumanjihouse/pre-commit-hooks
Expand Down
2 changes: 2 additions & 0 deletions sources/ar.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)ar:
ar tv $word
2 changes: 2 additions & 0 deletions sources/bundle.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)bundle:values
bundle help $word | bat --color=always -plhelp
11 changes: 9 additions & 2 deletions sources/gcc.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# :fzf-tab:complete:(\\|*/|):gcc:argument-rest
gcc -o- -S $realpath | bat --color=always -plasm
# :fzf-tab:complete:(\\|*/|)gcc:*
case $group in
'input file')
gcc -o- -S $realpath | bat --color=always -plasm
;;
help)
gcc --help=$word | bat --color=always -plhelp
;;
esac
4 changes: 2 additions & 2 deletions sources/git-checkout.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ case $group in
;;
'recent commit object name')
git log --color=always $word |
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json) |
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)
perl -pe' '$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json)
;;
esac
2 changes: 2 additions & 0 deletions sources/git-describe.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:git-describe:argument-rest
git describe $word
2 changes: 1 addition & 1 deletion sources/git-log.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# :fzf-tab:complete:git-log:argument-1
git log --color=always $word |
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json)
perl -pe' '$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json)
4 changes: 2 additions & 2 deletions sources/git-reflog.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
case $group in
command)
git reflog --color=always show |
perl -pe$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json)
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)
perl -pe' '$(jq -j '.[] | "s=\(.code)=\(.emoji)=g;"' ~/.gitmoji/gitmojis.json)
;;
esac
5 changes: 4 additions & 1 deletion sources/journalctl.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# :fzf-tab:complete:(\\|*/|)journalctl:values
# :fzf-tab:complete:(\\|*/|)journalctl:*
case $group in
'boot '*)
journalctl -b $word | bat --color=always -pllog
Expand All @@ -9,4 +9,7 @@ case $group in
commands)
journalctl $word | bat --color=always -pllog
;;
'possible values')
journalctl -u $word | bat --color=always -pllog
;;
esac
2 changes: 2 additions & 0 deletions sources/luacheck.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)luacheck:
luacheck --codes $word
2 changes: 1 addition & 1 deletion sources/mdcat.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)mdcat:
# :fzf-tab:complete:(\\|*/|)md(cat|less):argument-rest
[[ -f $realpath ]] && mdcat $realpath || less $realpath
2 changes: 2 additions & 0 deletions sources/neofetch.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)neofetch:argument-rest
neofetch $word | bat --color=always -plyaml
2 changes: 2 additions & 0 deletions sources/nix-store.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)nix-build:option-A-1
nix-build --no-out-link '<nixpkgs>' -A $word
2 changes: 1 addition & 1 deletion sources/nm.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)nm:argument-rest
nm $realpath
nm --demangle $realpath
2 changes: 2 additions & 0 deletions sources/npm.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)npm:
npm help -l $word | bat --color=always -plmarkdown
2 changes: 1 addition & 1 deletion sources/objdump.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)objdump:argument-rest
objdump -d $realpath
objdump -dhl --disassembler-color=extended-color --visualize-jumps=extended-color $realpath
4 changes: 4 additions & 0 deletions sources/pod2html.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)pod2html:
[[ -f $realpath ]] &&
pod2html $realpath | bat --color=always -plhtml ||
less $realpath
5 changes: 5 additions & 0 deletions sources/pod2latex.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# :fzf-tab:complete:(\\|*/|)pod2latex:
[[ -f $realpath ]] &&
pod2latex -out /tmp/pod2latex $realpath &&
bat --color=always /tmp/pod2latex.tex ||
less $realpath
4 changes: 4 additions & 0 deletions sources/pod2man.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)pod2man:
[[ -f $realpath ]] &&
pod2man $realpath | bat --color=always -plnroff ||
less $realpath
4 changes: 4 additions & 0 deletions sources/pod2texi.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)pod2texi:
[[ -f $realpath ]] &&
pod2texi $realpath ||
less $realpath
4 changes: 4 additions & 0 deletions sources/pod2text.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)pod2text:
[[ -f $realpath ]] &&
pod2text $realpath | bat --color=always -plman ||
less $realpath
4 changes: 4 additions & 0 deletions sources/pod2usage.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)pod2usage:
[[ -f $realpath ]] &&
pod2usage $realpath | bat --color=always -plhelp ||
less $realpath
4 changes: 4 additions & 0 deletions sources/podchecker.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# :fzf-tab:complete:(\\|*/|)podchecker:
[[ -f $realpath ]] &&
podchecker $realpath ||
less $realpath
9 changes: 9 additions & 0 deletions sources/progress.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# :fzf-tab:complete:(\\|*/|)progress:*
case $group in
'external command')
progress -c $word
;;
'process ID')
progress -p $word
;;
esac
2 changes: 2 additions & 0 deletions sources/rake.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)rake:argument-rest
rake -Bn $word
2 changes: 1 addition & 1 deletion sources/readelf.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)readelf:argument-rest
readelf -a $realpath
readelf --demangle -a $realpath
2 changes: 2 additions & 0 deletions sources/ri.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)(ri|gem-rdoc):argument-rest
ri $word
2 changes: 2 additions & 0 deletions sources/rlwrap.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)rlwrap:argument-1
less =$word
4 changes: 2 additions & 2 deletions sources/size.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)size:argument-rest
size $realpath
# :fzf-tab:complete:(\\|*/|)size:
size -t $realpath
2 changes: 2 additions & 0 deletions sources/tar.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)tar:
tar tvaf $word
2 changes: 2 additions & 0 deletions sources/texdoc.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)texdoc:values
yes | texdoc -l $word 2>/dev/null | head -n-1

0 comments on commit 3e5d74c

Please sign in to comment.