本文参考
- marktext/KEYBINDINGS.md at master · marktext/marktext (github.com)
- marktext/KEYBINDINGS_WINDOWS.md at master · marktext/marktext (github.com)
- marktext/KEYBINDINGS.md at master · marktext/marktext (github.com)
- marktext/APPLICATION_DATA_DIRECTORY.md at master · marktext/marktext (github.com)
使用MarkText的设置
设置自动保存文件: 左上角→ File → Auto Save (√)
设置快捷键: 左上角→ File → Preferences → Key Binds
或者使用配置文件设置快捷键:
C:\Users(用户)\Administrator\AppData\Roaming\marktext\keybindings.json
MarkText的数据文件夹
MarkText配置数据所在的目录:
- Windows:
C:\Users(用户)\Administrator\AppData\Roaming\marktext
- Linux:
$XDG_CONFIG_HOME/marktext
或~/.config/marktext
- macOS:
~/Library/Application Support/marktext
快捷键的绑定
所有的快捷键可以定义在MarkText的数据文件夹中的keybindings.json
文件,该文件中定义的快捷键会覆盖默认的快捷键,如果和默认快捷键没有冲突,则使用默认快捷。
{
"file.save": "CmdOrCtrl+Shift+S",
"file.save-as": "CmdOrCtrl+S"
}
可用于设置快捷键的键
0-9
、 A-Z
、F1-F24
、 /
、 #
Plus(+键)
、 Space(空格键)、Tab
、 Backspace
、 Delete
、 Insert
、 Return/Enter(回车键)
、 Esc
、 Home
、 End
、PrintScreen
Up(↑键)
、 Down(↓键)
、 Left(←键)
、Right(→键)
PageUp
、PageDown
- 使用空字符串来取消设置快捷键,比如取消另存为的快捷键:
"file.save-as": ""
快捷项说明
菜单选项快捷键
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
New file | 新建文件 | file.new-file | Ctrl+N | |
New tab | 新建标签页 | file.new-tab | Ctrl+T | |
Open markdown file | 打开文件 | file.open-file | Ctrl+O | |
Open folder | 打开文件夹 | file.open-folder | Ctrl+Shift+O | 取消 |
Save | 保存 | file.save | Ctrl+S | |
Save as... | 另存为 | file.save-as | Ctrl+Shift+S | |
Move current file to another location | 移动当前文件到另一个目录 | file.move-file | - | |
Rename current file | 重命名当前文件 | file.rename-file | - | |
Print current tab | | file.print | - | |
Open settings window | 打开设置窗口 | file.preferences | Ctrl+, | 取消 |
Close tab | 关闭标签页 | file.close-tab | Ctrl+W | 取消 |
Close window | 关闭MarkText | file.close-window | Ctrl+Shift+W | 取消 |
Quit MarkText | 关闭MarkText | file.quit | Ctrl+Q | 取消 |
编辑器快捷键
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Undo last operation | 撤销 | edit.undo | Ctrl+Z | |
Redo last operation | 重做 | edit.redo | Ctrl+Shift+Z | Ctrl+Y |
Cut selected text | 剪切内容 | edit.cut | Ctrl+X | |
Copy selected text | 复制内容 | edit.copy | Ctrl+C | |
Paste text | 粘贴内容 | edit.paste | Ctrl+V | |
Copy selected text as markdown | 复制内容(含markdown格式) | edit.copy-as-markdown | Ctrl+Shift+C | |
Copy selected text as html | 复制内容(将markdown格式复制成HTML) | edit.copy-as-html | - | |
Copy selected text as plaintext | 粘贴为纯文本 | edit.paste-as-plaintext | Ctrl+Shift+V | |
Select all text of the document | 全选当前文件内容 | edit.select-all | Ctrl+A | |
Duplicate the current paragraph | 复制当前行并粘贴到下一行 | edit.duplicate | Ctrl+Alt+P | Ctrl+Alt+Down |
Create a new paragraph after the current one | 在光标处的下一行插入一行空行 | edit.create-paragraph | Ctrl+Shift+N | |
Delete current paragraph | 删除光标所在的行 | edit.delete-paragraph | Ctrl+Shift+D | Ctrl+D |
Find information in the document | 搜索 | edit.find | Ctrl+F | |
Continue the search and find the next match | 搜索时跳到下一个匹配的地方 | edit.find-next | F3 | 取消 |
Continue the search and find the previous match | 搜索时跳到上一个匹配的地方 | edit.find-previous | Shift+F3 | 取消 |
Replace the information with a replacement | 搜索并替换 | edit.replace | Ctrl+R | |
Find files contain the keyword in opend folder | 在所有打开的文件中搜索内容 | edit.find-in-folder | Ctrl+Shift+F | Ctrl+H |
段落内容快捷键
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Set line as heading 1 | 转为1号标题 | paragraph.heading-1 | Ctrl+Shift+1 | 取消 |
Set line as heading 2 | 转为2号标题 | paragraph.heading-2 | Ctrl+Shift+2 | 取消 |
Set line as heading 3 | 转为3号标题 | paragraph.heading-3 | Ctrl+Shift+3 | 取消 |
Set line as heading 4 | 转为4号标题 | paragraph.heading-4 | Ctrl+Shift+4 | 取消 |
Set line as heading 5 | 转为5号标题 | paragraph.heading-5 | Ctrl+Shift+5 | 取消 |
Set line as heading 6 | 转为6号标题 | paragraph.heading-6 | Ctrl+Shift+6 | 取消 |
Upgrade a heading | 将当前内容提高一级,比如当前内容是6号标题就转为5号标题 | paragraph.upgrade-heading | Ctrl+Plus | |
Degrade a heading | 将当前内容降低一级,比如当前内容是5号标题就转为6号标题 | paragraph.degrade-heading | Ctrl+- | |
Insert a table | 插入表格 | paragraph.table | Ctrl+Shift+T | |
Insert a code block | 插入代码块 | paragraph.code-fence | Ctrl+Shift+K | |
Insert a quote block | 插入引用块(相当于输入"> ") | paragraph.quote-block | Ctrl+Shift+Q | |
Insert a math block | 插入数学公式块 | paragraph.math-formula | Ctrl+Alt+N | |
Insert a HTML block | 插入HTML块 | paragraph.html-block | Ctrl+Alt+H | |
Insert a ordered list | 插入有序列表 | paragraph.order-list | Ctrl+G | |
Insert a unordered list | 插入无序列表 | paragraph.bullet-list | Ctrl+H | |
Insert a task list | 插入任务列表(可以勾选) | paragraph.task-list | Ctrl+Alt+X | |
Convert a list item to a loose list item | 将列表条目调整为大行距 | paragraph.loose-list-item | Ctrl+Alt+L | 取消 |
Convert a heading to a paragraph | 将标题转为正文 | paragraph.paragraph | Ctrl+Shift+0 | 取消 |
Add a horizontal line | 添加一条横线(必须是空行才能使用) | paragraph.horizontal-line | Ctrl+Shift+U | |
Insert a YAML frontmatter block | 插入YAML格式的代码块(key: value格式的内容,冒号后面要加一个空格) | paragraph.front-matter | Ctrl+Alt+Y | 取消 |
格式样式快捷键
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Set the font of the selected text to bold | 将选中的内容加粗 | format.strong | Ctrl+B | |
Set the font of the selected text to italic | 将选中的内容转为斜体 | format.emphasis | Ctrl+I | |
Change the selected text to underline | 将选中的内容添加下划线 | format.underline | Ctrl+U | |
Change the selected text to underline | 将选中的内容添加下划线 | format.superscript | - | |
Change the selected text to underline | 将选中的内容添加下划线 | format.subscript | - | |
Highlight the selected text by tag | 将选中的内容背景设置为高亮(设为黄色背景) | format.highlight | Ctrl+Shift+H | |
Change the selected text to inline code | 将选中的内容转为行内代码格式 | format.inline-code | Ctrl+` | |
Change the selected text to inline math | 将选中的内容转为行内数学公式格式 | format.inline-math | Ctrl+Shift+M | 取消 |
Strike through the selected text | 将选中的内容划上横线 | format.strike | Ctrl+D | 另外设定 |
Insert a hyperlink | 插入超链接 | format.hyperlink | Ctrl+L | |
Insert a image | 插入图片 | format.image | Ctrl+Shift+I | |
Clear the formatting of the selected text | 清除选中的内容的样式 | format.clear-format | Ctrl+Shift+R | 取消 |
MarkText窗口相关
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Minimize the window | 将MarkText窗口最小化 | window.minimize | Ctrl+M | 取消 |
Toogle always on top mode | 将MarkText窗口固定在屏幕最顶层(不被其他程序遮挡) | window.toggle-always-on-top | - | |
Zoom in | 放大窗口 | window.zoom-in | - | |
Zoom out | 缩小窗口 | window.zoom-out | - | |
Toggle fullscreen mode | 窗口全屏 | window.toggle-full-screen | F11 | |
视图相关
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Toggle command palette | 弹出命令搜索框(搜索快捷键命令用的) | view.command-palette | Ctrl+Shift+P | |
Switch to source code mode | 将当前文档切换成源码模式 | view.source-code-mode | Ctrl+E | |
Enable typewriter mode | 切换为打字机模式,光标所在的行始终会在屏幕正中间 | view.typewriter-mode | Ctrl+Shift+G | |
Enable focus mode | 切换为专注模式,只有输入的行会高亮,其他行内容都会变灰色 | view.focus-mode | Ctrl+Shift+J | |
Toggle sidebar | 显示侧边栏 | view.toggle-sidebar | Ctrl+J | |
Toggle tabbar | 显示标签栏 | view.toggle-tabbar | Ctrl+Shift+B | |
Toggle table of contents | 显示侧边栏目录 | view.toggle-toc . | Ctrl+K | |
Reload images | 重新加载图片 | view.reload-images | F5 | |
标签相关
功能描述(英文) | 作用 | Id | 默认快捷键 | 我的快捷键 |
Cycle through tabs | 切换标签页 | tabs.cycle-forward | Ctrl+Tab | |
Cycle backwards through tabs | 倒序切换标签页 | tabs.cycle-backward | Ctrl+Shift+Tab | |
Switch tab to the left | 切换到最左边标签页 | tabs.switch-to-left | Ctrl+PageUp | 取消 |
Switch tab to the right | 切换到最右边标签页 | tabs.switch-to-right | Ctrl+PageDown | 取消 |
Switch tab to the 1st | 切换到第1个标签页 | tabs.switch-to-first | Ctrl+1 | 取消 |
Switch tab to the 2nd | 切换到第2个标签页 | tabs.switch-to-second | Ctrl+2 | 取消 |
Switch tab to the 3rd | 切换到第3个标签页 | tabs.switch-to-third | Ctrl+3 | 取消 |
Switch tab to the 4th | 切换到第4个标签页 | tabs.switch-to-fourth | Ctrl+4 | 取消 |
Switch tab to the 5th | 切换到第5个标签页 | tabs.switch-to-fifth | Ctrl+5 | 取消 |
Switch tab to the 6th | 切换到第6个标签页 | tabs.switch-to-sixth | Ctrl+6 | 取消 |
Switch tab to the 7th | 切换到第7个标签页 | tabs.switch-to-seventh | Ctrl+7 | 取消 |
Switch tab to the 8th | 切换到第8个标签页 | tabs.switch-to-eighth | Ctrl+8 | 取消 |
Switch tab to the 9th | 切换到第9个标签页 | tabs.switch-to-ninth | Ctrl+9 | 取消 |
Switch tab to the 10th | 切换到第10个标签页 | tabs.switch-to-tenth | Ctrl+0 | 取消 |
Q.E.D.