欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Sublime Text 2 右键菜单中的实用选项

shiping1 的头像

Sublime Text 2 右键菜单中的实用选项

Sublime Text 2 现在已经成了 Lucifr 最常用的编辑工具了,频繁的更新不停给人带来惊喜,今天无意中发现在右键菜单(Context menu)中有几个很实用的功能。

右键菜单中的实用功能

Context MenuContext Menu

  • Show Unsaved Changes...: 显示当前文件未保存的更改,而且是以 diff 的形式在输出中显示的,一目了然。

    Show Unsaved ChangesShow Unsaved Changes

  • Reveal in Finder: 顾名思义,方便在文件系统中定位。

  • Copy File Path:复制文件的路径,很实用的功能,比如要到终端中对当前文件进行某些操作的情况。

  • Reveal in Side Bar:在侧边栏的目录树中定位当前文件,同样是非常实用的功能,便于了解当前文件在项目中的位置和整体结构的关系。

侧边栏右键功能加强

推荐通过 Package Control 安装 SideBarEnhancements 这个插件,可以大大加强在侧栏目录树中右键的选项:

SideBarEnhancementsSideBarEnhancements

  • 基础的一些如:新建文件/目录,编辑,打开/运行,显示,在选择中/上级目录/项目中查找,剪切,复制,粘贴,重命名,删除,刷新……

  • 很实用的 Open With,可以通过 Edit Applications 来定义程序及对应的后缀类型。可参见我的设置:

Side Bar.sublime-menu
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
81
82
[
{"id": "side-bar-files-open-with",
"children":
[

// Marked
{
"caption": "Marked",
"id": "side-bar-files-open-with-marked",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Marked.app",
"extensions":"markdown|md|mdown|mkd|mkdn|txt" //any file with these extensions
}
},
{"caption":"-"},
//Photoshop
{
"caption": "Photoshop",
"id": "side-bar-files-open-with-photoshop",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Adobe Photoshop CS5.app",
"extensions":"psd|png|jpg|jpeg" //any file with these extensions
}
},
// Preview
{
"caption": "Preview",
"id": "side-bar-files-open-with-preview",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Preview.app",
"extensions":"psd|png|jpg|jpeg|gif" //any file with these extensions
}
},
//separator
{"caption":"-"},
//Browsers
{
"caption": "Chrome",
"id": "side-bar-files-open-with-chrome",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Google Chrome.app",
"extensions":"html|php" //any file with extension
}
},

{
"caption": "Firefox",
"id": "side-bar-files-open-with-firefox",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Firefox.app",
"extensions":"html|php" //any file with these extensions
}
},

{"caption":"-"},
// Textmate
{
"caption": "Textmate",
"id": "side-bar-files-open-with-textmate",
"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "Textmate 2.app",
"extensions":".*" //any file with these extensions
}
}

]
}
]
  • 很牛的 Copy as Text...:包含各种形式的路径、URI(甚至包括 base64 的 data:uri)、转码后的文件名、各种 HTML Tag(a、img、script、style)……

欢迎关注 Sublime Text 这个标签,Lucifr 会继续分享更多相关的技巧和信息。

来自 http://lucifr.com/2012/02/08/useful-entries-in-sublime-text-2-context-menu/

普通分类: