Set some fzf preferences.
dblume

dblume commited on 2025-12-15 12:57:52
Showing 1 changed files, with 5 additions and 1 deletions.

... ...
@@ -173,7 +173,7 @@ case "$-" in
173 173
         file="$(git ls-files | fzf --preview 'cat {}' --preview-window=right:60%)"
174 174
       fi
175 175
       if [ -n "$file" ]; then
176
-        echo ${EDITOR:-vim} "$file"
176
+        echo ${EDITOR:-vim} \""$file"\"
177 177
         # It's more useful to have "vim [file]" in your history than just a "gf".
178 178
         history -s "${EDITOR:-vim} \"$file\""
179 179
         ${EDITOR:-vim} "$file"
... ...
@@ -182,9 +182,13 @@ case "$-" in
182 182
 
183 183
   fi
184 184
 
185
+  export FZF_DEFAULT_OPTS="--reverse --height 50% --info=inline-right"
185 186
   # bat may be installed as "bat" (macOS) or "batcat" (Debian/Ubuntu)
186 187
   if type batcat >/dev/null 2>&1; then
187 188
     alias bat='batcat'
189
+    export FZF_CTRL_T_OPTS="--preview 'batcat --color=always --wrap never --terminal-width $COLUMNS {}' --preview-window=right:60%"
190
+  else
191
+    export FZF_CTRL_T_OPTS="--preview 'cat {}' --preview-window=right:60%"
188 192
   fi
189 193
  ;;
190 194
 esac
191 195