lf: performance and usability improvements in fzf
This commit is contained in:
parent
b16b3b6bbc
commit
c8d8c4674c
|
@ -118,6 +118,7 @@ cmd fzf ${{
|
||||||
|
|
||||||
clear
|
clear
|
||||||
file="$(eval "$input" | fzf \
|
file="$(eval "$input" | fzf \
|
||||||
|
--exact \
|
||||||
--query "$query" \
|
--query "$query" \
|
||||||
--delimiter "$delimiter" \
|
--delimiter "$delimiter" \
|
||||||
--nth="$field" \
|
--nth="$field" \
|
||||||
|
@ -151,15 +152,21 @@ for cmd in bat batcat head; do
|
||||||
done
|
done
|
||||||
res="$(
|
res="$(
|
||||||
FZF_DEFAULT_COMMAND="$RG_PREFIX ." SEDPATTERN='s/\\/\\\\/g;s/"/\\"/g' SHELL="sh" \
|
FZF_DEFAULT_COMMAND="$RG_PREFIX ." SEDPATTERN='s/\\/\\\\/g;s/"/\\"/g' SHELL="sh" \
|
||||||
fzf --bind "change:reload:${RG_PREFIX} {q} || true" \
|
fzf \
|
||||||
--preview-window="right,50%" --preview="
|
--ansi \
|
||||||
|
--exact \
|
||||||
|
--bind "change:reload:${RG_PREFIX} {q} || true" \
|
||||||
|
--preview-window="right,50%" \
|
||||||
|
--preview="
|
||||||
file=\$(realpath \"\$(echo {} | cut -d: -f1 | sed \"\${SEDPATTERN}\")\" 2>/dev/null)
|
file=\$(realpath \"\$(echo {} | cut -d: -f1 | sed \"\${SEDPATTERN}\")\" 2>/dev/null)
|
||||||
case '$cmd' in
|
case '$cmd' in
|
||||||
head) head -n 300 \"\$file\" ;;
|
head) head -n 300 \"\$file\" ;;
|
||||||
bat*) '$cmd' --color=always --italic-text=always --style=plain --pager=never \
|
bat*) '$cmd' --color=always --italic-text=always --style=plain --pager=never \
|
||||||
--tabs=4 --theme=base16 --line-range :300 \"\$file\" ;;
|
--tabs=4 --theme=base16 --line-range :300 \"\$file\" ;;
|
||||||
esac
|
esac
|
||||||
" --ansi --layout=reverse --header 'Searching file contents'
|
" \
|
||||||
|
--layout=reverse \
|
||||||
|
--header 'Searching file contents'
|
||||||
)"
|
)"
|
||||||
file="$(realpath "$(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g')" 2>/dev/null)"
|
file="$(realpath "$(echo "$res" | cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g')" 2>/dev/null)"
|
||||||
row="$(echo "$res" | cut -d':' -f2)"
|
row="$(echo "$res" | cut -d':' -f2)"
|
||||||
|
@ -245,7 +252,7 @@ map <a-enter> shell-wait
|
||||||
map <tab><tab> find_project
|
map <tab><tab> find_project
|
||||||
map <tab>t fzf 'Tags' 'cat $XDG_DATA_HOME/lf/tags 2>/dev/null' ':' '1' '1' '50%'
|
map <tab>t fzf 'Tags' 'cat $XDG_DATA_HOME/lf/tags 2>/dev/null' ':' '1' '1' '50%'
|
||||||
map <tab>m fzf 'Marks' 'cat $XDG_DATA_HOME/lf/marks 2>/dev/null' ':' '1' '2' '85%' '^'
|
map <tab>m fzf 'Marks' 'cat $XDG_DATA_HOME/lf/marks 2>/dev/null' ':' '1' '2' '85%' '^'
|
||||||
map <tab>f fzf 'Files' 'find -L $PWD' ':' '1' '1' '50%'
|
map <tab>f fzf 'Files' 'fd -L --full-path $PWD' ':' '1' '1' '50%'
|
||||||
map <tab>g find_word
|
map <tab>g find_word
|
||||||
map "'" mark-load
|
map "'" mark-load
|
||||||
map '"' mark-remove
|
map '"' mark-remove
|
||||||
|
|
Loading…
Reference in New Issue