Sublime实用技巧(Win)
文章目录
Alt + R : 开启正则表达式功能Alt + Enter: 找到匹配目标后全部选择Ctrl + R:前往 method(mac 下 ⌘ + R)Ctrl + M:跳转到对应括号Ctrl + Shift + ↑/↓:与上/下一行交换位置
Ctrl + D:选择单词,重复可增加选择下一个相同的单词Ctrl + L:选择行,重复可依次增加选择下一行
Ctrl + Shift + P:打开命令面板
Ctrl + P:搜索项目中的文件(mac 下 ⌘ + P),在里面输入:admi@auto 可以定位到相应文件夹(admin.html)下的相应方法(auto)。
Ctrl + G:跳转到第几行Ctrl + W:关闭当前打开文件Ctrl + Shift + W:关闭所有打开文件Ctrl + Shift + V:粘贴并格式化Ctrl + Shift + L:选择多行Ctrl + Shift + Enter:在当前行前插入新行Ctrl + X:删除当前行Ctrl + U:软撤销,撤销光标位置Ctrl + Shift + J:选择标签内容Ctrl + F:查找内容Ctrl + Shift + F:查找并替换Ctrl + H:替换Ctrl + N:新建窗口Ctrl + K + B:开关侧栏Ctrl + Shift + M:选中当前括号内容,重复可选择括号本身Ctrl + F2:设置/删除标记Ctrl + /:注释当前行Ctrl + Shift + /:当前位置(对选中内容)插入块注释Ctrl + Alt + /:块注释,并 Focus 到首行,写注释说明用的Ctrl + Shift + A:选择当前标签前后,修改标签用的F11:全屏Shift + F11:全屏免打扰模式,只编辑当前文件Alt + F3:选择所有相同的词Alt + .:闭合标签Alt + Shift + 数字:分屏显示Alt + 数字:切换到第 N 个文件Shift + 右键拖动:上下拖动设置多个光标位并在多行选中相同长度内容,用来更改或插入列内容鼠标的前进后退键:可切换 Tab 文件Ctrl + 左键点击:选择多个位置Ctrl + shift + D: 复制并粘贴光标所在行Ctrl + shift + T: 恢复已经关闭的标签页
Editing
Keypress Command:
Ctrl + X Delete lineCtrl + ↩ Insert line afterCtrl + ⇧ + ↩ Insert line beforeCtrl + ⇧ + ↑ Move line/selection upCtrl + ⇧ + ↓ Move line/selection downCtrl + L Select line - Repeat to select next linesCtrl + D Select word - Repeat select others occurrencesCtrl + M Jump to closing parentheses Repeat to jump to opening parenthesesCtrl + ⇧ + M Select all contents of the current parenthesesCtrl + KK Delete from cursor to end of lineCtrl + K + ⌫ Delete from cursor to start of lineCtrl + ] Indent current line(s)Ctrl + [ Un-indent current line(s)Ctrl + ⇧ + D Duplicate line(s)Ctrl + J Join line below to the end of the current lineCtrl + / Comment/un-comment current lineCtrl + ⇧ + / Block comment current selectionCtrl + Y Redo, or repeat last keyboard shortcut commandCtrl + ⇧ + V Paste and indent correctlyCtrl + Space Select next auto-complete suggestionCtrl + U soft undo; jumps to your last change before undoing change when repeated
WindowsCtrl + Alt + Up Column selection upCtrl + Alt + Down Column selection down
LinuxAlt + ⇧ + Up Column selection upAlt + ⇧ + Down Column selection up
Navigation/Goto Anywhere
Keypress Command:
Ctrl + P Quick-open files by nameCtrl + R Goto symbolCtrl + ; Goto word in current fileCtrl + G Goto line in current file
General
Keypress Command:
Ctrl + ⇧ + P Command promptCtrl + KB Toggle side barCtrl + ⇧ + Alt + P Show scope in status bar
Find/Replace
Keypress Command:
Ctrl + F FindCtrl + H ReplaceCtrl + ⇧ + F Find in files
Tabs
Keypress Command:
Ctrl + ⇧ + t Open last closed tabCtrl + PgUp Cycle up through tabsCtrl + PgDn Cycle down through tabsCtrl + ⇆ Find in filesAlt + [NUM] Switch to tab number [NUM] where [NUM] <= number of tabs
Split window
Keypress Command:
Alt + ⇧ + 2 Split view into two columnsAlt + ⇧ + 1 Revert view to single columnAlt + ⇧ + 5 Set view to grid (4 groups)Ctrl + [NUM] Jump to group where num is 1-4Ctrl + ⇧ + [NUM] Move file to specified group where num is 1-4
Bookmarks
Keypress Command:
Ctrl + F2 Toggle bookmarkF2 Next bookmark⇧ + F2 Previous bookmarkCtrl + ⇧ + F2 Clear bookmarks
Text manipulation
Keypress Command:
Ctrl + KU Transform to UppercaseCtrl + KL Transform to Lowercase