forked from Binocular222/Sublime-Text-3-Full-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project.txt
80 lines (78 loc) · 7.71 KB
/
Project.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
:Project: = A collection of files and folders, which are shown in Sidebar
Benefit:
Quick open file in project: ctrl+p [[Sublime Text.txt#Goto File]]
Search amongst all files in project: [[Sublime Text.txt#Find in Files]]
Goto Symbol and Goto Definition in project [[Sublime Text.txt#Goto Symbol]]
There’s always an active project, whether it’s explicit or implicit
.sublime-project
Indicate: which files and folders are included
Support relative path (i.e: "path": "..\\..\\User")
This file can be stored anywhere
.sublime-workspace files
Workspaces = different views into the same project i.e: Specify which files are opened, which pane is visible
only allow absolute path
This file can be stored anywhere
\Data\Local\Session.sublime_session
Affect Recent Project (menu Project > Open recent and Project > Quick switch project). This is troublesome because:
only allow absolute path => modify path lead to sublime_text.exe will confuse this file:
Symptom: Recent Project are empty, Sidebar goes blank, no tab is open even if "remember_open_files": true
Treatment:
Project > Open recent > Clear items. Then Open .sublime-project individually
In bad case, you may need to delete all .sublime-workspace files
Usage:
To add file/folder to project:
Menu Project > Add folder to project
OR: Drag & drop onto Sidebar (View > Sidebar) [[Sublime Text.txt#Side bar]]
To switch between projects (ctrl+alt+p)
To delete invalid project:
Menu Project → open Recent → Clear recent
OR: Open \Data\Local\Session.sublime_session → Edit section "recent_workspaces"
To edit project file: use this .py plugin: sublime.active_window().open_file('E:\\Utilities\\Sublime Text\\x64\\Data\\Packages\\User\\Project\\Autohotkey.sublime-project')
.sublime-project (JSON format)
"folders":
"path": can be relative to project directory, or an absolute path [Mandatory]
"name": Text to display on the side bar [optional]
Optionally have settings:
file_exclude_patterns
file_include_patterns
folder_exclude_patterns
folder_include_patterns
follow_symlinks
These settings are set for each folder in each project.
To apply global inclue/exclude pattern to all projects:
Preferences > Settings - User
Only 3 options available:
"folder_exclude_patterns":
"file_exclude_patterns":
"binary_file_patterns": //show up in the side bar, but won't be included in Goto Anything or Find in Files
Converted projects from earlier versions may have a mount_points entry under folders. If you wish to use the exclude patterns, you'll need to change to the above format.
"settings": override regular user settings but not syntax specific settings.
"build_systems": Add to regular Tools/Build Systems menu [[Build.txt#.sublime-build]]
Example:
{
"folders":
[
{
"path": "D:\\Doc\\Quick_search\\IT",
"folder_exclude_patterns": ["backup"],
"follow_symlinks": true,
"file_exclude_patterns": ["*.doc", "*.docx"]
},
{
"path": "docs",
"name": "Documentation",
"file_exclude_patterns": ["*.css"]
}
],
"settings":
{
"tab_size": 8
},
"build_systems":
[
{
"name": "List",
"cmd": ["ls"]
}
]
}