dotfiles/.bin/c
2023-02-16 10:12:03 +01:00

30 lines
939 B
Bash
Executable File

#!/bin/sh
[ ! -z "$@" ] \
&& EXTRA="--query $@"
FZF_DEFAULT_COMMAND='find \
$HOME/.config/* \
$HOME/.* \
-maxdepth 1 \
-type f \
\( -name "*.cfg" \
-o -name "*.conf" \
-o -name "*.lua" \
-o -name "*.sh" \
-o -name "*.toml" \
-o -name "*.xsession*" \
-o -name "*rc" \
-o -name ".Xresources" \
-o -name ".Xdefaults" \
-o -name ".ini" \
-o -name "config" \
\)'
export FZF_DEFAULT_COMMAND
F=$(fzf -1 -e +s $EXTRA --preview='cat {}')
[ -z "$F" ] \
|| vim "$F";