mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Detect fzf
This commit is contained in:
parent
46ef951beb
commit
4f6363d248
2 changed files with 6 additions and 0 deletions
4
bash/fzf
4
bash/fzf
|
|
@ -1,6 +1,8 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# vim: ft=sh
|
# vim: ft=sh
|
||||||
|
|
||||||
|
if type fzf 1>/dev/null 2>/dev/null; then
|
||||||
|
|
||||||
__fzf_select__() {
|
__fzf_select__() {
|
||||||
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
-o -type f -print \
|
-o -type f -print \
|
||||||
|
|
@ -54,3 +56,5 @@ fi
|
||||||
|
|
||||||
bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\e^\er"'
|
bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\e^\er"'
|
||||||
bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'
|
bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
|
||||||
2
zsh/fzf
2
zsh/fzf
|
|
@ -1,6 +1,7 @@
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
if [[ $- == *i* ]]; then
|
if [[ $- == *i* ]]; then
|
||||||
|
if type fzf 1>/dev/null 2>/dev/null; then
|
||||||
|
|
||||||
# CTRL-T - Paste the selected file path(s) into the command line
|
# CTRL-T - Paste the selected file path(s) into the command line
|
||||||
__fsel() {
|
__fsel() {
|
||||||
|
|
@ -76,3 +77,4 @@ zle -N fzf-history-widget
|
||||||
bindkey '^R' fzf-history-widget
|
bindkey '^R' fzf-history-widget
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue