summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2018-06-16 16:17:13 +0200
committerAlan Pearce2018-06-16 16:17:13 +0200
commit92dd640461b7d2cbc5e4e7beacd19783ee43f55c (patch)
tree8fb07b6ef3142b4a6fd7b4648a0f136fc28fe082
parentf2640eb84768f7130c5d78a4070d121da11dd555 (diff)
downloadnixfiles-92dd640461b7d2cbc5e4e7beacd19783ee43f55c.tar.lz
nixfiles-92dd640461b7d2cbc5e4e7beacd19783ee43f55c.tar.zst
nixfiles-92dd640461b7d2cbc5e4e7beacd19783ee43f55c.zip
zsh: customise fzf/anyframe
-rw-r--r--zsh/.config/zsh/.zshrc11
1 files changed, 7 insertions, 4 deletions
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index ac2a0345..c40f73f4 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -213,13 +213,16 @@ fi
 
 if [[ -n $commands[fzf] ]]
 then
-  fp () {
-    ghq look $(ghq list | fzf +m)
-  }
-
   zplugin snippet "https://github.com/junegunn/fzf/raw/master/shell/key-bindings.zsh"
+  export FZF_CTRL_T_COMMAND='
+    (git ls-tree -r --name-only HEAD ||
+	       fd --hidden --follow --exclude ".git" . |
+	             sed s/^..//) 2> /dev/null'
+  export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude ".git" .'
+  export FZF_DEFAULT_COMMAND=$FZF_CTRL_T_COMMAND
 
   bindkey '^t' transpose-chars
+  bindkey '^x^f' fzf-file-widget
 
   zstyle ":anyframe:selector:fzf:" command "fzf --height 40%"