本文参考

  1. marktext/KEYBINDINGS.md at master · marktext/marktext (github.com)
  2. marktext/KEYBINDINGS_WINDOWS.md at master · marktext/marktext (github.com)
  3. marktext/KEYBINDINGS.md at master · marktext/marktext (github.com)
  4. 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-ZF1-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-fileCtrl+N
New tab新建标签页file.new-tabCtrl+T
Open markdown file打开文件file.open-fileCtrl+O
Open folder打开文件夹file.open-folderCtrl+Shift+O取消
Save保存file.saveCtrl+S
Save as...另存为file.save-asCtrl+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.preferencesCtrl+,取消
Close tab关闭标签页file.close-tabCtrl+W取消
Close window关闭MarkTextfile.close-windowCtrl+Shift+W取消
Quit MarkText关闭MarkTextfile.quitCtrl+Q取消

编辑器快捷键

功能描述(英文)作用Id默认快捷键我的快捷键
Undo last operation撤销edit.undoCtrl+Z
Redo last operation重做edit.redoCtrl+Shift+ZCtrl+Y
Cut selected text剪切内容edit.cutCtrl+X
Copy selected text复制内容edit.copyCtrl+C
Paste text粘贴内容edit.pasteCtrl+V
Copy selected text as markdown复制内容(含markdown格式)edit.copy-as-markdownCtrl+Shift+C
Copy selected text as html复制内容(将markdown格式复制成HTML)edit.copy-as-html-
Copy selected text as plaintext粘贴为纯文本edit.paste-as-plaintextCtrl+Shift+V
Select all text of the document全选当前文件内容edit.select-allCtrl+A
Duplicate the current paragraph复制当前行并粘贴到下一行edit.duplicateCtrl+Alt+PCtrl+Alt+Down
Create a new paragraph after the current one在光标处的下一行插入一行空行edit.create-paragraphCtrl+Shift+N
Delete current paragraph删除光标所在的行edit.delete-paragraphCtrl+Shift+DCtrl+D
Find information in the document搜索edit.findCtrl+F
Continue the search and find the next match搜索时跳到下一个匹配的地方edit.find-nextF3取消
Continue the search and find the previous match搜索时跳到上一个匹配的地方edit.find-previousShift+F3取消
Replace the information with a replacement搜索并替换edit.replaceCtrl+R
Find files contain the keyword in opend folder在所有打开的文件中搜索内容edit.find-in-folderCtrl+Shift+FCtrl+H

段落内容快捷键

功能描述(英文)作用Id默认快捷键我的快捷键
Set line as heading 1转为1号标题paragraph.heading-1Ctrl+Shift+1取消
Set line as heading 2转为2号标题paragraph.heading-2Ctrl+Shift+2取消
Set line as heading 3转为3号标题paragraph.heading-3Ctrl+Shift+3取消
Set line as heading 4转为4号标题paragraph.heading-4Ctrl+Shift+4取消
Set line as heading 5转为5号标题paragraph.heading-5Ctrl+Shift+5取消
Set line as heading 6转为6号标题paragraph.heading-6Ctrl+Shift+6取消
Upgrade a heading将当前内容提高一级,比如当前内容是6号标题就转为5号标题paragraph.upgrade-headingCtrl+Plus
Degrade a heading将当前内容降低一级,比如当前内容是5号标题就转为6号标题paragraph.degrade-headingCtrl+-
Insert a table插入表格paragraph.tableCtrl+Shift+T
Insert a code block插入代码块paragraph.code-fenceCtrl+Shift+K
Insert a quote block插入引用块(相当于输入"> ")paragraph.quote-blockCtrl+Shift+Q
Insert a math block插入数学公式块paragraph.math-formulaCtrl+Alt+N
Insert a HTML block插入HTML块paragraph.html-blockCtrl+Alt+H
Insert a ordered list插入有序列表paragraph.order-listCtrl+G
Insert a unordered list插入无序列表paragraph.bullet-listCtrl+H
Insert a task list插入任务列表(可以勾选)paragraph.task-listCtrl+Alt+X
Convert a list item to a loose list item将列表条目调整为大行距paragraph.loose-list-itemCtrl+Alt+L取消
Convert a heading to a paragraph将标题转为正文paragraph.paragraphCtrl+Shift+0取消
Add a horizontal line添加一条横线(必须是空行才能使用)paragraph.horizontal-lineCtrl+Shift+U
Insert a YAML frontmatter block插入YAML格式的代码块(key: value格式的内容,冒号后面要加一个空格)paragraph.front-matterCtrl+Alt+Y取消

格式样式快捷键

功能描述(英文)作用Id默认快捷键我的快捷键
Set the font of the selected text to bold将选中的内容加粗format.strongCtrl+B
Set the font of the selected text to italic将选中的内容转为斜体format.emphasisCtrl+I
Change the selected text to underline将选中的内容添加下划线format.underlineCtrl+U
Change the selected text to underline将选中的内容添加下划线format.superscript-
Change the selected text to underline将选中的内容添加下划线format.subscript-
Highlight the selected text by tag将选中的内容背景设置为高亮(设为黄色背景)format.highlightCtrl+Shift+H
Change the selected text to inline code将选中的内容转为行内代码格式format.inline-codeCtrl+`
Change the selected text to inline math将选中的内容转为行内数学公式格式format.inline-mathCtrl+Shift+M取消
Strike through the selected text将选中的内容划上横线format.strikeCtrl+D另外设定
Insert a hyperlink插入超链接format.hyperlinkCtrl+L
Insert a image插入图片format.imageCtrl+Shift+I
Clear the formatting of the selected text清除选中的内容的样式format.clear-formatCtrl+Shift+R取消

MarkText窗口相关

功能描述(英文)作用Id默认快捷键我的快捷键
Minimize the window将MarkText窗口最小化window.minimizeCtrl+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-screenF11

视图相关

功能描述(英文)作用Id默认快捷键我的快捷键
Toggle command palette弹出命令搜索框(搜索快捷键命令用的)view.command-paletteCtrl+Shift+P
Switch to source code mode将当前文档切换成源码模式view.source-code-modeCtrl+E
Enable typewriter mode切换为打字机模式,光标所在的行始终会在屏幕正中间view.typewriter-modeCtrl+Shift+G
Enable focus mode切换为专注模式,只有输入的行会高亮,其他行内容都会变灰色view.focus-modeCtrl+Shift+J
Toggle sidebar显示侧边栏view.toggle-sidebarCtrl+J
Toggle tabbar显示标签栏view.toggle-tabbarCtrl+Shift+B
Toggle table of contents显示侧边栏目录view.toggle-toc .Ctrl+K
Reload images重新加载图片view.reload-imagesF5

标签相关

功能描述(英文)作用Id默认快捷键我的快捷键
Cycle through tabs切换标签页tabs.cycle-forwardCtrl+Tab
Cycle backwards through tabs倒序切换标签页tabs.cycle-backwardCtrl+Shift+Tab
Switch tab to the left切换到最左边标签页tabs.switch-to-leftCtrl+PageUp取消
Switch tab to the right切换到最右边标签页tabs.switch-to-rightCtrl+PageDown取消
Switch tab to the 1st切换到第1个标签页tabs.switch-to-firstCtrl+1取消
Switch tab to the 2nd切换到第2个标签页tabs.switch-to-secondCtrl+2取消
Switch tab to the 3rd切换到第3个标签页tabs.switch-to-thirdCtrl+3取消
Switch tab to the 4th切换到第4个标签页tabs.switch-to-fourthCtrl+4取消
Switch tab to the 5th切换到第5个标签页tabs.switch-to-fifthCtrl+5取消
Switch tab to the 6th切换到第6个标签页tabs.switch-to-sixthCtrl+6取消
Switch tab to the 7th切换到第7个标签页tabs.switch-to-seventhCtrl+7取消
Switch tab to the 8th切换到第8个标签页tabs.switch-to-eighthCtrl+8取消
Switch tab to the 9th切换到第9个标签页tabs.switch-to-ninthCtrl+9取消
Switch tab to the 10th切换到第10个标签页tabs.switch-to-tenthCtrl+0取消

Q.E.D.


做一个热爱生活的人