This commit is contained in:
Rikuoh Tsujitani 2023-11-26 15:57:11 +09:00
parent 51d9ab1925
commit f9728d32d7
Signed by: riq0h
GPG key ID: 010F09DEA298C717

6
.zshrc
View file

@ -80,7 +80,7 @@ bindkey -r "^T"
bindkey -r "^R" bindkey -r "^R"
fv() { fv() {
IFS=$'\n' files=($(fzf-tmux -p 50% --preview 'bat --color=always --style=plain {}' --preview-window=border-sharp,right:60% --query="$1" --multi --select-1 --exit-0)) IFS=$'\n' files=($(fzf --height 50% --preview 'bat --color=always --style=plain {}' --preview-window=border-sharp,right:60% --query="$1" --multi --select-1 --exit-0))
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
zsh zsh
} }
@ -90,7 +90,7 @@ fadd() {
while out=$( while out=$(
git status --short | git status --short |
awk '{if (substr($0,2,1) !~ / /) print $2}' | awk '{if (substr($0,2,1) !~ / /) print $2}' |
fzf-tmux -p 30% --multi --exit-0 --expect=ctrl-d); do fzf --height 30% --multi --exit-0 --expect=ctrl-d); do
q=$(head -1 <<< "$out") q=$(head -1 <<< "$out")
n=$[$(wc -l <<< "$out") - 1] n=$[$(wc -l <<< "$out") - 1]
addfiles=(`echo $(tail "-$n" <<< "$out")`) addfiles=(`echo $(tail "-$n" <<< "$out")`)
@ -104,7 +104,7 @@ fadd() {
} }
fman() { fman() {
man -k . | fzf-tmux -p 50% -q "$1" --prompt='man> ' --preview $'echo {} | tr -d \'()\' | awk \'{printf "%s ", $2} {print $1}\' | xargs -r man | col -bx | bat -l man -p --color always' --preview-window=border-sharp,right:60% --bind '?:toggle-preview' | tr -d '()' | awk '{printf "%s ", $2} {print $1}' | xargs -r man man -k . | fzf --height 50% -q "$1" --prompt='man> ' --preview $'echo {} | tr -d \'()\' | awk \'{printf "%s ", $2} {print $1}\' | xargs -r man | col -bx | bat -l man -p --color always' --preview-window=border-sharp,right:60% --bind '?:toggle-preview' | tr -d '()' | awk '{printf "%s ", $2} {print $1}' | xargs -r man
} }
export MANPAGER="sh -c 'col -bx | bat -l man -p --paging always'" export MANPAGER="sh -c 'col -bx | bat -l man -p --paging always'"