Search code examples
sublimetext2

Sublime Text: how to see current working directory, and how to change it


Q1: How do I see what the current working directory is in Sublime Text?

I want to know so I know which directories/subdirectories it's searching when I do a text search.

Q2: Also, is there a way to change the current working directory?

Sublime Text 2, v2.0.1, build 2217; Mac OS X Lion


Solution

  • When you do a "Find in Files", it searches the folders/files listed in the "Where:" field. If nothing is specified, I believe this defaults to all the files/folders in the project. You can change this by specifying different value(s) in the "Where:" field, and add further criteria by clicking on the "..." icon next to the "Where:" value to get options of Clear, Add Folder, Add Include Filter, Add Exclude Filter, Add Open Folders, Add Open Files

    Another option to restrict your search is to do a "File > Open..." and open the folder where you want to search. This opens a new window with a new project.

    I generally open a folder so it brings up a new window, then Project -> Save Project As to save the project. There is also a command in the command palette to do this. You can then quickly switch between projects by using the shortcut cmd+ctrl+p.