Last active
December 15, 2015 02:10
-
-
Save ivanoats/10586383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Note: updated 2014-03-28 to handle patterns like foo/bar.txt | |
suffix=$(basename "$@") | |
pattern="${suffix}*" | |
if [ "$@" = "$suffix" ]; then | |
# If there's no folder then it should be a substring | |
pattern="*${suffix}*" | |
fi | |
mdfind -onlyin $HOME "kMDItemFSName = '$pattern'cd" \ | |
| fgrep -i "$@" \ | |
| grep -v "$HOME/Library/" \ | |
| grep -v "$HOME/Pictures/" \ | |
| grep -v "$HOME/Music/" \ | |
| sed -e "s|^$HOME|~|" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'helm-files) | |
(setq helm-idle-delay 0.1) | |
(setq helm-input-idle-delay 0.1) | |
(setq helm-locate-command "locate-with-mdfind %.0s %s") | |
(loop for ext in '("\\.swf$" "\\.elc$" "\\.pyc$") | |
do (add-to-list 'helm-boring-file-regexp-list ext)) | |
(define-key global-map [(alt t)] 'helm-for-files)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment