62 lines
1.5 KiB
Bash
Executable File
62 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
. ~/.bin/_config
|
|
|
|
if [ ! -z "$1" ]
|
|
then
|
|
QUERY="--query $1"
|
|
fi
|
|
export INITIAL_QUERY="$1"
|
|
|
|
cd /usr
|
|
|
|
( find src \
|
|
ports/{archivers,astro,audio,benchmarks} \
|
|
ports/{biology,books,cad,chinese,comms} \
|
|
ports/{converters,databases,devel,editors} \
|
|
ports/{education,emulators,fonts,games} \
|
|
ports/{geo,graphics,infrastructure} \
|
|
ports/{inputmethods,japanese,java,korean} \
|
|
ports/{lang,mail,math,meta,misc,multimedia} \
|
|
ports/{mystuff,net,news,plan9,print} \
|
|
ports/{productivity,security,shells,sysutils} \
|
|
ports/{telephony,textproc,wayland,www,x11} \
|
|
-not -path "*/CVS/*" \
|
|
-not -path "*/.git/*" \
|
|
-type f \
|
|
\( -name "*.c" \
|
|
-o -name "*.cc" \
|
|
-o -name "*.cpp" \
|
|
-o -name "*.h" \
|
|
-o -name "*.hh" \
|
|
-o -name "*.hpp" \
|
|
-o -name "*.pl" \
|
|
-o -name "*.awk" \
|
|
-o -name "*.sh" \
|
|
-o -name "*.mk" \
|
|
-o -name "*.in" \
|
|
-o -name "*conf" \
|
|
-o -name "*devs" \
|
|
-o -name "patch-*" \
|
|
-o -name "Makefile*" \
|
|
-o -name "PLIST*" \
|
|
-o -name "DESCR*" \
|
|
-o -name ".gitignore" \
|
|
-o -name ".cvsignore" \
|
|
\) > /tmp/dev-src-list.tmp && mv /tmp/dev-src-list.tmp /tmp/dev-src-list ) &
|
|
|
|
|
|
[ ! -f /tmp/dev-src-list ] \
|
|
&& wait
|
|
|
|
|
|
F="$(fzf --exact \
|
|
--no-sort \
|
|
--preview-window=right:65% \
|
|
$QUERY \
|
|
--preview='highlight -O ansi -O xterm256 --force {}' \
|
|
< /tmp/dev-src-list
|
|
)"
|
|
|
|
[ -z "$F" ] || v "$F"
|
|
|