Sublime Text navigate to file in sidebar when opened with CTRL+P ("goto anything") - sublimetext

Say I've got opened a project or a directory structure in Sublime Text. When I open a file with CTRL+P, I frequently navigate in the sidebar to the directory that contains it after opening the file, to get my bearings in a large project. It would be nice if this could be automated.
Is there a way to configure this, or a plugin for it? I wasn't able to find anything.

If I understand you correctly, you want to have the sidebar expand to some file that you find with Goto Anything. To do so, you can install the SyncedSideBar package.
SyncedSideBar
Sublime Text 2 plugin to sync project sidebar (folder view) with
currently active file.
Sublime Text 2 highlights only those files that are already expanded.
This plugin highlights all files (eg. opened with cmd+p).

Related

Can I open a file with `cd ~/../..` in Atom?

I opened up a large project in Atom. I'd like to travel to a file that is four folders deep into the project. Normally, I will go into the sidebar and flip open folders. Is there a way to open files programmatically? I'm thinking about the ability to use cd in terminal.
If you're trying to open a deeply nested file, try using the Fuzzy File Finder (Cmd-T on a Mac, Ctrl-T on Windows) to type in the name of the file. If you want to see it in the tree view after opening it, use the Reveal in Tree View feature (right click on the file tab and click Reveal in Tree View, or press Cmd-I with the file open).

How to open containing folder of file in Sublime Text 3 in OSX?

How can I open the containing folder of an open file in Sublime Text 3 in OSX? Prefer an answer that shows me where the menu option is, rather than setting up a command-line.
Some other posts I've searched suggest right-clicking the file and selecting the Open Containing Folder option, but I don't see it on mine...
What you read is correct, but you may be falling afoul of the fact that the context menu that you get when you right click on the file tab is different than the one that you get if you right click in the file itself and, counter-intuitively, the option for opening the containing folder (or copying the path of the file to the clipboard) only appears in the file context menu.
The option you want is Reveal in Finder, which is near the bottom of the menu (note that my menu may be slightly different than yours depending on installed packages):

How do I use Mac OS aliases in Sublime Text 3?

I want to open the tree of folders which contains any code on my Mac in Sublime 3. Something like this:
But I don't have all of it in one folder, and it isn't convenient enough to open many folders in Sublime every time I close the app. So I have created 'aliases' (via Finder) to my folders and put them to one (folder), which i want to open with Sublime.
That didn't work out. Sublime opens these aliases as hex code. While ordinary folders open well.
So the main question: is there a way to make this work as I thought via preferences, or any plugin?
Use symbolic links instead by opening Terminal and using ln -s <SOURCE> <ALIAS>.
You can keep any number of folders you want collected in one place by using projects. Simply drag the folders you want, in the order you want, into the sidebar. Then, select Project -> Save Project As... and save the file anywhere you want with the .sublime-project extension. While you're at it, make sure you have
"hot_exit": true
in your user settings, as this enables you to close windows which have a project assigned to them, and all open files and unsaved changes are automatically preserved. When you next open the project, everything will be the same.

Sublime Text 2 / Sublime Text 3 bring back unsaved files on osx

In sublime I know even if you don't save the changes in a file later one you can start from where you left off. I opened a new tab in sublime and closed the application before I save my file. Does sublime save a temp file somewhere in the computer (I am using MAC OSx)
Sublime Text 2 stores the files in ~/Library/Application Support/Sublime Text 2/Settings, in the .sublime_session files that are located there.
The contents of those files are a large JSON blob that contains the individual tab contents. Search in the file for the file name / tab name / a key word in the document and you should be able to get what you need.
For Sublime Text 3, use the following path:
~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session
Credit to: eebbesen
I know it's a late answer but here's where I found it.
Linux: ~/.config/sublime-text-3/Local/Session.sublime_session
Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session
Hope this helps someone someday.
As far as I know, Sublime Text keeps open files when you quit the application. However, if you close the tabs or project window without saving, the changes are lost.
In the former case, the files are saved in Local/Session.sublime-session (I'm using ST3 though, could be different in ST2!) You can open ST's packages folder from the command palette using "Browse Packages".
For Sublime Text 3,
Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session
For Sublime Text 3 / For Sublime Text 4
If you used portable version(.zip) version then refer to
sublime_installation_folder\Data\Local\Session.sublime_session
PS: Make a backup, before replacing the file, in case, you want to revert
This gives you your unsaved files and opened files as per your recent view.

show hidden files and folders in project drawer in textmate

By default, textmate does not show all files and folders in the project drawer.
how do I make textmate project drawer show hidden files, in particular all files and directories beginning with a dot?
Click Preferences > Advanced > Folder References,
Edit File Pattern (minimal change to original default):
!(/\.(?!\W*)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$
as well as Folder pattern (minimal change to original default):
!.*/(\.(?!\W*)[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
This only applies to new project folders. For an existing one, you need to edit the pattern after right-clicking on folder reference and choose Show Information.
7 years later, TextMate (v2.0.6) , shows these options:
default "Exclude files matching":
  {*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\}arch\},blib,*\~.nib}
default "Include files matching":
  {*,.tm_properties,.htaccess}
Non-text files:
  {*.{ai,bz2,flv,gif,gz,icns,ico,jpg,jpeg,m4v,nib,o,pdf,png,psd,pyc,rtf,scssc,swf,tar,tbz,tgz,tif,tiff,zip},Icon\r}
To show all hidden (MacOS) files+folders in file-browser pane of TextMate, what needs to be changed ?
goto TextMate > Preferences > Projects:
change the "Include..." box regex code into this:
  {*,\.*}
as shown in below:
#Viktor Tron's answer is perfect... Just wanted to add this comment (but had a picture, so I'll add this answer)... Once you DO show "invisible" (.dot) files via his snazzy regex... you may want to weed some otherwise extraneous files that now clutter your projects hierarchy... Just do it via the specific project folder's "Show Information..." contextual menu...
In this example I want to IGNORE (fucking) .DS_Store files.. SO I simply add !\.DS_Store to the "File Pattern" section.

Resources