I like to have every file I might want one keybinding away. Currently I have a shell script with these three find commands that I pipe into fzf. But for a variety of reasons I need to combine them into one command (not the least because my current approach is ugly and I am sure flawed).
find ~ \! \( -path */.git/* \) -type d
find ~ \( -iname \*.Rmd -o -iname \*.el \) -a \! \( -iname index.txt -o -path */.thunderbird/* -o -path */python3.8/* -o -path */.git/* \) -type f
find ~ -regextype posix-extended \( -not -regex ".*/\.sw(o|p)" -a -not -regex ".*\~$" \) -maxdepth 1 -type f
If anyone would like to critisize my ugly find commands and suggest a more efficient/clean way of whitelisting/blacklisting file extensions -- I would be grateful.
EDIT I have simplified the commands to make it easier to understand their function.
- The first command looks for directories under the home path
~
but excludes.git
directories and their subdirectories. - The second command finds files in the home directory specifying whitelisted file extensions and then blacklisted file extensions and paths.
- The third finds dotfiles in my home directory
~
but excludes certain regexs.