Accompanies OnCFD Newsletter #173
A couple of code snippets that use fzf to mine your install & extract the answers to everyday OpenFOAM questions, like...
- How do I use a particular feature?
- What does so-and-so dictionary look like?
- Does this need a semi-colon? π€¦ββοΈ
It looks like this...
Here are the code snippets...
grep \
--line-buffered --line-number --color=never \
--recursive --binary-files=without-match '' $FOAM_TUTORIALS |
fzf \
--delimiter : \
--preview 'less {1}' \
--preview-window 'up,75%,border,+{2}/3'
rg \
--color=always --line-number --no-heading \
--smart-case '' $FOAM_TUTORIALS |
fzf --ansi \
--color 'hl:-1:underline,hl+:-1:underline:reverse' \
--delimiter : \
--preview 'bat -lcpp --color=always {1} --highlight-line {2}' \
--preview-window 'up,75%,border,+{2}+3/3,~3'
That should save you some typing, but make sure you check out the original article for more info π
Hey @robinknowles thanks for this great tool!

I have a question if I may,
I did some aliases (also discovered that if you do aliases instead of funciton as you posted it goes way faster! not sure why), in any case...
sometimes my fuzzy searchs are too much fuzzy any ideas how I would make it less fuzzy?
one example:
here I am looking for the swarmcorrection and it arrives to make the word from the path of the file lol.
the alias I am using is:
alias ftut="rg --color=always --line-number --no-heading --smart-case '' $FOAM_TUTORIALS | fzf --ansi --color 'hl:-1:underline,hl+:-1:underline:reverse' --delimiter : --preview 'batcat -lcpp --color=always {1} --highlight-line {2}' --preview-window 'up,75%,border,+{2}+3/3,~3' | sed 's/:.*//'"