您的位置:首页 > 其它

Sublime 快捷键

2016-12-12 17:59 417 查看

语法快捷键:

后代:>

缩写:nav>ul>li

<nav>
<ul>
<li></li>
</ul>
</nav>

兄弟:+

缩写:div+p+bq

<div></div>
<p></p>
<blockquote></blockquote>

上级:^

缩写:div+div>p>span+em^bq

<div></div>
<div>
<p><span></span><em></em></p>
<blockquote></blockquote>
</div>

缩写:div+div>p>span+em^^bq

<div></div>
<div>
<p><span></span><em></em></p>
</div>
<blockquote></blockquote>

分组:()

缩写:div>(header>ul>li*2>a)+footer>p

<div>
<header>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</header>
<footer>
<p></p>
</footer>
</div>

缩写:(div>dl>(dt+dd)*3)+footer>p

<div>
<dl>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
</dl>
</div>
<footer>
<p></p>
</footer>

乘法:*

缩写:ul>li*5

<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>

自增符号:$

缩写:ul>li.item$*5

<ul>
<li class="item1"></li>
<li class="item2"></li>
<li class="item3"></li>
<li class="item4"></li>
<li class="item5"></li>
</ul>

缩写:h$[title=item$]{Header $}*3

<h1 title="item1">Header 1</h1>
<h2 title="item2">Header 2</h2>
<h3 title="item3">Header 3</h3>

缩写:ul>li.item$$$*5

<ul>
<li class="item001"></li>
<li class="item002"></li>
<li class="item003"></li>
<li class="item004"></li>
<li class="item005"></li>
</ul>

缩写:ul>li.item$@-*5

<ul>
<li class="item5"></li>
<li class="item4"></li>
<li class="item3"></li>
<li class="item2"></li>
<li class="item1"></li>
</ul>

缩写:ul>li.item$@3*5

<ul>
<li class="item3"></li>
<li class="item4"></li>
<li class="item5"></li>
<li class="item6"></li>
<li class="item7"></li>
</ul>

ID和类属性

缩写:#header

<div id="header"></div>

缩写:.title

<div class="title"></div>

缩写:form#search.wide

<form id="search" class="wide"></form>

缩写:p.class1.class2.class3

<p class="class1 class2 class3"></p>

自定义属性

缩写:p[title="Hello world"]

<p title="Hello world"></p>

缩写:td[rowspan=2 colspan=3 title]

<td rowspan="2" colspan="3" title=""></td>

缩写:[a='value1' b="value2"]

<div a="value1" b="value2"></div>

文本:{}

缩写:a{Click me}

<a href="">Click me</a>

缩写:p>{Click }+a{here}+{ to continue}

<p>Click <a href="">here</a> to continue</p>

隐式标签

缩写:.class

<div class="class"></div>

缩写:em>.class

<em><span class="class"></span></em>

缩写:ul>.class

<ul>
<li class="class"></li>
</ul>

缩写:table>.row>.col

<table>
<tr class="row">
<td class="col"></td>
</tr>
</table>

HTML

所有未知的缩写都会转换成标签,例如,foo → <foo></foo>

缩写:!

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>

</body>
</html>

缩写:a

<a href=""></a>

缩写:a:link

<a href="http://"></a>

缩写:a:mail

<a href="mailto:"></a>

缩写:abbr

<abbr title=""></abbr>

缩写:acronym

<acronym title=""></acronym>

缩写:base

<base href="" />

缩写:basefont

<basefont />

缩写:br

<br />

缩写:frame

<frame />

缩写:hr

<hr />

缩写:bdo

<bdo dir=""></bdo>

缩写:bdo:r

<bdo dir="rtl"></bdo>

缩写:bdo:l

<bdo dir="ltr"></bdo>

缩写:col

<col />

缩写:link

<link rel="stylesheet" href="" />

缩写:link:css

<link rel="stylesheet" href="style.css" />

缩写:link:print

<link rel="stylesheet" href="print.css" media="print" />

缩写:link:favicon

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />

缩写:link:touch

<link rel="apple-touch-icon" href="favicon.png" />

缩写:link:rss

<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml" />

缩写:link:atom

<link rel="alternate" type="application/atom+xml" title="Atom" href="atom.xml" />

缩写:meta

<meta />

缩写:meta:utf

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

缩写:meta:win

<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />

缩写:meta:vp

<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />

缩写:meta:compat

<meta http-equiv="X-UA-Compatible" content="IE=7" />

缩写:style

<style></style>

缩写:script

<script></script>

缩写:script:src

<script src=""></script>

缩写:img

<img src="" alt="" />

缩写:iframe

<iframe src="" frameborder="0"></iframe>

缩写:embed

<embed src="" type="" />

缩写:object

<object data="" type=""></object>

缩写:param

<param name="" value="" />

缩写:map

<map name=""></map>

缩写:area

<area shape="" coords="" href="" alt="" />

缩写:area:d

<area shape="default" href="" alt="" />

缩写:area:c

<area shape="circle" coords="" href="" alt="" />

缩写:area:r

<area shape="rect" coords="" href="" alt="" />

缩写:area:p

<area shape="poly" coords="" href="" alt="" />

缩写:form

<form action=""></form>

缩写:form:get

<form action="" method="get"></form>

缩写:form:post

<form action="" method="post"></form>

缩写:label

<label for=""></label>

缩写:input

<input type="text" />

缩写:inp

<input type="text" name="" id="" />

缩写:input:hidden

别名:input[type=hidden name]

<input type="hidden" name="" />

缩写:input:h

别名:input:hidden

<input type="hidden" name="" />

缩写:input:text, input:t

别名:inp

<input type="text" name="" id="" />

缩写:input:search

别名:inp[type=search]

<input type="search" name="" id="" />

缩写:input:email

别名:inp[type=email]

<input type="email" name="" id="" />

缩写:input:url

别名:inp[type=url]

<input type="url" name="" id="" />

缩写:input:password

别名:inp[type=password]

<input type="password" name="" id="" />

缩写:input:p

别名:input:password

<input type="password" name="" id="" />

缩写:input:datetime

别名:inp[type=datetime]

<input type="datetime" name="" id="" />

缩写:input:date

别名:inp[type=date]

<input type="date" name="" id="" />

缩写:input:datetime-local

别名:inp[type=datetime-local]

<input type="datetime-local" name="" id="" />

缩写:input:month

别名:inp[type=month]

<input type="month" name="" id="" />

缩写:input:week

别名:inp[type=week]

<input type="week" name="" id="" />

缩写:input:time

别名:inp[type=time]

<input type="time" name="" id="" />

缩写:input:number

别名:inp[type=number]

<input type="number" name="" id="" />

缩写:input:color

别名:inp[type=color]

<input type="color" name="" id="" />

缩写:input:checkbox

别名:inp[type=checkbox]

<input type="checkbox" name="" id="" />

缩写:input:c

别名:input:checkbox

<input type="checkbox" name="" id="" />

缩写:input:radio

别名:inp[type=radio]

<input type="radio" name="" id="" />

缩写:input:r

别名:input:radio

<input type="radio" name="" id="" />

缩写:input:range

别名:inp[type=range]

<input type="range" name="" id="" />

缩写:input:file

别名:inp[type=file]

<input type="file" name="" id="" />

缩写:input:f

别名:input:file

<input type="file" name="" id="" />

缩写:input:submit

<input type="submit" value="" />

缩写:input:s

别名:input:submit

<input type="submit" value="" />

缩写:input:image

<input type="image" src="" alt="" />

缩写:input:i

别名:input:image

<input type="image" src="" alt="" />

缩写:input:button

<input type="button" value="" />

缩写:input:b

别名:input:button

<input type="button" value="" />

缩写:isindex

<isindex />

缩写:input:reset

别名:input:button[type=reset]

<input type="reset" value="" />

缩写:select

<select name="" id=""></select>

缩写:option

<option value=""></option>

缩写:textarea

<textarea name="" id="" cols="30" rows="10"></textarea>

缩写:menu:context

别名:menu[type=context]>

<menu type="context"></menu>

缩写:menu:c

别名:menu:context

<menu type="context"></menu>

缩写:menu:toolbar

别名:menu[type=toolbar]>

<menu type="toolbar"></menu>

缩写:menu:t

别名:menu:toolbar

<menu type="toolbar"></menu>

缩写:video

<video src=""></video>

缩写:audio

<audio src=""></audio>

缩写:html:xml

<html xmlns="http://www.w3.org/1999/xhtml"></html>

缩写:keygen

<keygen />

缩写:command

<command />

缩写:bq

别名:blockquote

<blockquote></blockquote>

缩写:acr

别名:acronym

<acronym title=""></acronym>

缩写:fig

别名:figure

<figure></figure>

缩写:figc

别名:figcaption

<figcaption></figcaption>

缩写:ifr

别名:iframe

<iframe src="" frameborder="0"></iframe>

缩写:emb

别名:embed

<embed src="" type="" />

缩写:obj

别名:object

<object data="" type=""></object>

缩写:src

别名:source

<source></source>

缩写:cap

别名:caption

<caption></caption>

缩写:colg

别名:colgroup

<colgroup></colgroup>

缩写:fst, fset

别名:fieldset

<fieldset></fieldset>

缩写:btn

别名:button

<button></button>

缩写:btn:b

别名:button[type=button]

<button type="button"></button>

缩写:btn:r

别名:button[type=reset]

<button type="reset"></button>

缩写:btn:s

别名:button[type=submit]

<button type="submit"></button>


选择类快捷键:

Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本。
Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本进行同时编辑。举个栗子:快速选中并更改所有相同的变量名、函数名等。
Ctrl+L 选中整行,继续操作则继续选择下一行,效果和 Shift+↓ 效果一样。
Ctrl+Shift+L 先选中多行,再按下快捷键,会在每行行尾插入光标,即可同时编辑这些行。
Ctrl+Shift+M 选择括号内的内容(继续选择父括号)。举个栗子:快速选中删除函数中的代码,重写函数体代码或重写括号内里的内容。
Ctrl+M 光标移动至括号内结束或开始的位置。
Ctrl+Enter 在下一行插入新行。举个栗子:即使光标不在行尾,也能快速向下插入一行。
Ctrl+Shift+Enter 在上一行插入新行。举个栗子:即使光标不在行首,也能快速向上插入一行。
Ctrl+Shift+[ 选中代码,按下快捷键,折叠代码。
Ctrl+Shift+] 选中代码,按下快捷键,展开代码。
Ctrl+K+0 展开所有折叠代码。
Ctrl+← 向左单位性地移动光标,快速移动光标。
Ctrl+→ 向右单位性地移动光标,快速移动光标。
shift+↑ 向上选中多行。
shift+↓ 向下选中多行。
Shift+← 向左选中文本。
Shift+→ 向右选中文本。
Ctrl+Shift+← 向左单位性地选中文本。
Ctrl+Shift+→ 向右单位性地选中文本。
Ctrl+Shift+↑ 将光标所在行和上一行代码互换(将光标所在行插入到上一行之前)。
Ctrl+Shift+↓ 将光标所在行和下一行代码互换(将光标所在行插入到下一行之后)。
Ctrl+Alt+↑ 向上添加多行光标,可同时编辑多行。
Ctrl+Alt+↓ 向下添加多行光标,可同时编辑多行。

编辑类快捷键:

Ctrl+J 合并选中的多行代码为一行。举个栗子:将多行格式的CSS属性合并为一行。
Ctrl+Shift+D 复制光标所在整行,插入到下一行。
Tab 向右缩进。
Shift+Tab 向左缩进。
Ctrl+K+K 从光标处开始删除代码至行尾。
Ctrl+Shift+K 删除整行。
Ctrl+/ 注释单行。
Ctrl+Shift+/ 注释多行。
Ctrl+K+U 转换大写。
Ctrl+K+L 转换小写。
Ctrl+Z 撤销。
Ctrl+Y 恢复撤销。
Ctrl+U 软撤销,感觉和 Gtrl+Z 一样。
Ctrl+F2 设置书签
Ctrl+T 左右字母互换。
F6 单词检测拼写

搜索类快捷键:

Ctrl+F 打开底部搜索框,查找关键字。
Ctrl+shift+F 在文件夹内查找,与普通编辑器不同的地方是sublime允许添加多个文件夹进行查找,略高端,未研究。
Ctrl+P 打开搜索框。举个栗子:1、输入当前项目中的文件名,快速搜索文件,2、输入@和关键字,查找文件中函数名,3、输入:和数字,跳转到文件中该行代码,4、输入#和关键字,查找变量名。
Ctrl+G 打开搜索框,自动带:,输入数字跳转到该行代码。举个栗子:在页面代码比较长的文件中快速定位。
Ctrl+R 打开搜索框,自动带@,输入关键字,查找文件中的函数名。举个栗子:在函数较多的页面快速查找某个函数。
Ctrl+: 打开搜索框,自动带#,输入关键字,查找文件中的变量名、属性名等。
Ctrl+Shift+P 打开命令框。场景栗子:打开命名框,输入关键字,调用sublime text或插件的功能,例如使用package安装插件。
Esc 退出光标多行选择,退出搜索框,命令框等。

显示类快捷键:

Ctrl+Tab 按文件浏览过的顺序,切换当前窗口的标签页。
Ctrl+PageDown 向左切换当前窗口的标签页。
Ctrl+PageUp 向右切换当前窗口的标签页。
Alt+Shift+1 窗口分屏,恢复默认1屏(非小键盘的数字)
Alt+Shift+2 左右分屏-2列
Alt+Shift+3 左右分屏-3列
Alt+Shift+4 左右分屏-4列
Alt+Shift+5 等分4屏
Alt+Shift+8 垂直分屏-2屏
Alt+Shift+9 垂直分屏-3屏
Ctrl+K+B 开启/关闭侧边栏。
F11 全屏模式
Shift+F11 免打扰模式
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: