sublime使用笔记

sublime 使用笔记

ctrl+k+b;隐藏左侧导航;

c+s+p -> 打开命令面板 key Bindings 可以查看默认的快捷键的方式;

c+j ->合并两行;

c+[/] -> 左右缩进;

c+Enter ->向下回车

c+s+Enter ->向上回车

Package Control包的安装地址:packagecontrol.io ->拷贝代码复制到 ctrl+`
中回车等待安装;

c+Q退出;重新打开后c+s+p打开面板敲install运行package control包就会链接
到官网,然后在线安装自己想要的包就行了;

若想看一下自己都安装了那些包,在菜单的preferences -> 中的 browse
packages中的installing中查看即可;

主要的安装包有:

AdvanceNewFile(作用:目录的层级比较多,alt+ctrl+n;在指定文件夹下新建文
件);

Emmet(代码补齐功能);Git;Package Control;

RailsCasts Colour Scheme;

Sass;SublimeERB;

SyncedSideBar(每次打开一个文件,侧边栏就会同步显示文件的位置);

ctrl+d选中一个单词,再次点击连续选择同一个单词

ctrl+-号跳回原来的文件

Sublime Text快捷键:
  Ctrl+Shift+P:打开命令面板
  Ctrl+P:搜索项目中的文件
  Ctrl+G:跳转到第几行
  Ctrl+W:关闭当前打开文件
  Ctrl+Shift+W:关闭所有打开文件
  Ctrl+Shift+V:粘贴并格式化
  Ctrl+D:选择单词,重复可增加选择下一个相同的单词
  Ctrl+L:选择行,重复可依次增加选择下一行
  Ctrl+Shift+L:选择多行
  Ctrl+Shift+Enter:在当前行前插入新行
  Ctrl+M:跳转到对应括号
  Ctrl+U:软撤销,撤销光标位置
  Ctrl+J:选择标签内容
  Ctrl+F:查找内容
  Ctrl+Shift+F:查找并替换
  Ctrl+H:替换
  Ctrl+R:前往 method
  Ctrl+N:新建窗口
  Ctrl+K+B:开关侧栏
  Ctrl+Shift+M:选中当前括号内容,重复可选着括号本身
  Ctrl+F2:设置/删除标记
  Ctrl+/:注释当前行
  Ctrl+Shift+/:当前位置插入注释
  Ctrl+Alt+/:块注释,并Focus到首行,写注释说明用的
  F11:全屏
  Shift+F11:全屏免打扰模式,只编辑当前文件
  Alt+F3:选择所有相同的词
  Alt+Shift+数字:分屏显示
  Alt+数字:切换打开第N个文件
  Ctrl+Tab:切换tab
  Ctrl+Shift+上下键,可替换行

参考网址:http://jingyan.baidu.com/article/adc815137f9ae2f723bf73ff.html
http://www.cnblogs.com/jikey/archive/2013/03/12/2955230.html

Sublime Text设置快捷键让html文件在浏览器打开
1、安装View In Browser插件;安装 SideBarEnhancements插件
2、然后通过ctrl + k+b打开侧边栏,在侧边栏的文件中右击,找到 open width -> edit applications
设置firefox打开的方式;application : 路径要修改为自己默认安装的路径。

代码块

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
83
84
85
86
87
88
89
90
91
92
[
{"id": "side-bar-files-open-with",
"children":
[

//application 1
{
"caption": "firefox",
"id": "side-bar-files-open-with-firefox",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Program Files\\Mozilla Firefox\\firefox.exe", // OSX
"extensions":".*", //any file with these extensions
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},

//separator
{"caption":"-"},

//application 2
{
"caption": "chrome",
"id": "side-bar-files-open-with-chrome",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", // WINNT
"extensions":".*", //open all even folders
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},
//application n
{
"caption": "Chrome",
"id": "side-bar-files-open-with-chrome",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Documents and Settings\\tito\\local\\Datos de programa\\Google\\Chrome\\Application\\chrome.exe",
"extensions":".*", //any file with extension
"args":[]
},
"open_automatically" : false // will close the view/tab and launch the application
},

{"caption":"-"}
]
}
]



别人的:
[
{"id": "side-bar-files-open-with",
"children":
[
//application firefox
{
"caption": "firefox",
"id": "side-bar-files-open-with-firefox",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "D:\\Program Files\\Mozilla Firefox\\firefox.exe",(修改路径)
"extensions":".*" //any file with extension
}
},

{"caption":"-"},
{
"caption": "chrome",
"id": "side-bar-files-open-with-chrome",

"command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",(修改路径)
"extensions":".*" //any file with extension
}
}
]
}
]

3、
设置快捷键
菜单栏Preferences->Key Bindings-User),打开Default (Windows).sublime-keymap文件编辑,或者F:\ProgramFiles\Sublime Text 3\Data\Packages\User编辑Default (Windows).sublime-keymap
输入如下内容:

代码块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
{ "keys": ["alt+f12"], "command": "open_in_browser" },
{ "keys": ["f12"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
"extensions":".*" //any file with extension
} },
{ "keys": ["ctrl+f12"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"extensions":".*" //any file with extension
}
}

]

这样就可以用这三个键在浏览中预览页面了:
F12 : Firefox
alt + F12 : IE
ctrl + F12 : chrome
当然,你也可以配置,其它配置器用这样的方式预览。