62 comments

[ 3.6 ms ] story [ 133 ms ] thread
This is so good
isn't it ? made me a happy person :)
Hey, thanks a lot. Didn't know about these at all. Cheers.
BetterZip is really good. Thx.
On a related note, is there any way to get Spotlight to index all text files?
I wouldn't know why you'd want to do so(slowing down the search), but it seems possible (or close enough).

Scroll at the way to "Make Spotlight index source code" here. http://www.macosxtips.co.uk/index_files/terminal-commands-fo...

That assumes you care about the speed more than the results. Quicksilver or Alfred completely replace Spotlight for anything frequent; I'd be happy if it took 5 minutes, if it could always find what I was looking for.
The command line version of it (mdfind) seems to search the entire file system.
(comment deleted)
Nice plugin!

Pro tip: Instead of restarting finder run `qlmanage -r`

(comment deleted)
Is there such thing as plain text?
Would it be possible to make the text inside the Quicklook window selectable? I often just want to quickly copy something from a file, and Quicklook would be the fastest way to do so.
(comment deleted)
Yes there is a way. Open up terminal and type this in:

defaults write com.apple.finder QLEnableTextSelection -bool true

Then restart the Finder by typing in this into the Terminal:

killall Finder

Why isn't this the default...? Many thanks :)
defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder
Now that is just awesome. Thank you!
beware though. might not work after latest XCode installation
I don't have XCode installed as of yet. I'm on Mountain Lion and I'm waiting for both the official release of ML and XCode on the App Store. Will XCode for ML still interfere with this plugin or is there any other plugin with similar functionality?
well, i don't really know.
I'll take the opportunity to ask: Is there a way to make Spotlight index files in the Library folders? There are sometimes some obscure preference or cache-files that I need to find.
You'll definitely find what you're looking for here. http://www.macosxtips.co.uk/index_files/terminal-commands-fo...

To save you some time, add a folder as follows:

mdimport -f /Library

On recent OS X versions (Lion at the very least), the problem isn't that /Library and ~/Library aren't indexed by default; they are. Trouble is that if I search for a file named, say "com.apple.RemoteDesktop.plist", Finder appears to run a query akin to

    kMDItemDisplayName == "com.apple.RemoteDesktop.plist"
    && kMDItemSupportFileType != MDSystemFile
which returns nothing on my system, rather than simply

    kMDItemDisplayName == "com.apple.RemoteDesktop.plist"    
which returns three results, one each in subdirectories of /System/Library, /Library, and ~/Library.

There's an option in the "full" Spotlight search window that lets you control this for any given search, under "Other..." in the drop-down you get when you click "+" to add criteria. It's called, logically enough, "System files".

Incidentally, the mdfind command line tool doesn't have this behavior by default.

If you want a nice GUI, try Tembo (http://www.houdah.com/tembo). Tembo is a Spotlight front-end. Incidentally it searches all indexed locations, including Library folders.
This is 100% off-topic, but since this submission has 100+ upvotes and many might view the comment thread, and you mentioned Library/ folder, I think it's good to point out that you can easily make Library/ folder visible again in Lion.

Just type:

    chflags nohidden ~/Library
in the Terminal.
You can also access hidden directories from Finder with Cmd-Shift-G and manually typing their path.

Personally, I infrequently access my ~/Library and I know it's there and what it contains and I can hop over to it quickly if needed that I prefer it hidden for visual simplicity.

You can also add a QuickLook directory to your own ~/Library if you are into keeping stuff separated.
Somehow off topic but this is a very neat trick: You can preview the selected item directly in the Spotlight menu by pressing the left arrow key.

Source: http://www.macstories.net/mac/all-you-need-to-know-about-qui...

IMO the preview appears automatically after ~2 seconds without having to press any key. Useful feature indeed.
I guess you're right. Though I never recognized this before and since I'm using Alfred, I don't touch Spotlight that often.
On mobile device right now, but earlier today Alfred prompted for a beta update which included some Spotlight features. Not sure about the details or if it's only part of the paid Powerpack
Sadly what it does and does not preview seems to be pretty random. For me with Lion it will preview Rakefiles and .txt files for example, but not .js files.
Thanks so much for this. For the longest time I've found it irritating that I couldn't preview plaintext .nfo files with Quicklook.

I didn't realise Quicklook plugins were a thing...

well, so did i. Irritation is the root of all hacks :)
This is fantastic. Always wondered why quick look wasn't set up to parse plain text files just because they had a different extension. Especially Markdown.
Anyone know how to control what the Open with button offers? E.g. it's offering "Open with Sublime Text 2" and I'd rather have an Open with MacVim.
That's up to the application. You can crack open the app packages for Sublime Text and MacVim and see how their Info.plist files differ. It's also worth looking at the Info.plist for TextEdit, which has a catch-all for all non-executable files.
It's pretty simple and managed by OSX.

- Select a filetype you'd want to change the default application for and open the File Info (Cmd+I) - In the "Open with" section, select the app you want to be the default app for the filetype - To persist the default app along the whole filetype, also click the "Change All" button right below it.

You can also hold down the open button and a list of alternate applications that can be used to open the document drops down. Pretty handy.
Is there something like this for Chrome? Really annoying having code downloaded instead of displayed.
No. It has to be sent as text/plain for Chrome to view the file if it is on a remote server. The MIME types that are opened in the browser instead of downloaded are hardcoded within the Chrome source.

Numerous feature requests have been submitted[1] to update this functionality and to provide a preferences pane for users to decide how they want different file types handled, but they have been ignored as this behavior is a design decision.

[1] http://code.google.com/p/chromium/issues/detail?id=118204...

Is there any way to change the font or its size in Quicklook?
File this under things that should have worked in the first place.
It's possible to get syntax highlighting working with it?