【工具】Typora 自定义快捷键

在软件中打开官方教程

依次点击:文件 > 偏好设置...
在这里插入图片描述

点击 偏好设置 > 通用 > 自定义快捷键
在这里插入图片描述

会打开官方对于修改快捷键的说明文档:https://support.typora.io/Shortcut-Keys/#change-shortcut-keys

这个链接中包含:

  • 所有默认快捷键的说明
  • 修改快捷键的教程(Mac、Windows、Linux)

按照这个过程看一遍就可以,官方说明是英文的,不想看的我下面会介绍一下Windows中怎么修改的

自定义快捷键

同样在 偏好设置 > 通用 中,点击 打开高级设置
在这里插入图片描述
然后会打开typora的配置文件所在目录:
在这里插入图片描述
其中 conf.default.json 是默认的配置,conf.user.json 是用户自定义的配置,如果没有 conf.user.json 文件的话,直接在该目录下新建一个即可。

打开 conf.user.json 文件,这里除了快捷键的设置,还有typora的其他设置,如:字体、自动保存时间等。

/** For advanced users. */
{
    
    
  "defaultFontFamily": {
    
    
    "standard": null, //String - Defaults to "Times New Roman".
    "serif": null, // String - Defaults to "Times New Roman".
    "sansSerif": null, // String - Defaults to "Arial".
    "monospace": null // String - Defaults to "Courier New".
  },
  "autoHideMenuBar": false, //Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is false.

  // Array - Search Service user can access from context menu after a range of text is selected. Each item is formatted as [caption, url]
  "searchService": [
    ["Search with Google", "https://google.com/search?q=%s"]
  ],

  // Custom key binding, which will override the default ones.
  "keyBinding": {
    
    
    // for example: 
    // "Always on Top": "Ctrl+Shift+P"
    // All other options are the menu items 'text label' displayed from each typora menu
  },

  "monocolorEmoji": false, //default false. Only work for Windows
  "autoSaveTimer" : 3, // Deprecidated, Typora will do auto save automatically. default 3 minutes
  "maxFetchCountOnFileList": 500,
  "flags": [] // default [], append Chrome launch flags, e.g: [["disable-gpu"], ["host-rules", "MAP * 127.0.0.1"]]
}

上面 keyBinding 关键字中的内容,就是功能与快捷键的绑定区域,如上面代码块显示,这段内容如果为空的话,所有的快捷键都使用 https://support.typora.io/Shortcut-Keys/#change-shortcut-keys 这个链接中介绍的默认快捷键。

  • 上面网址国内的镜像:

下面举例说明如何更改快捷键:https://support.typoraio.cn/Shortcut-Keys/#change-shortcut-keys

这里修改三个功能:

  • 创建代码块
  • 创建有序列表
  • 创建无序列表

首先去上面的链接中,找到我们想要修改的功能对应的函数名:
在这里插入图片描述
将这个函数名作为快捷键绑定中的 key,将快捷键组合的字符串作为 value,依次添加至 keyBinding 中:

/** For advanced users. */
{
    
    
  ...... 其余部分省略
  // Custom key binding, which will override the default ones.
  "keyBinding": {
    
    
    // for example: 
    // "Always on Top": "Ctrl+Shift+P"
    // All other options are the menu items 'text label' displayed from each typora menu
	"Code Fences": "Ctrl+Alt+c",
	"Ordered List": "Ctrl+Alt+o",
	"Unordered List": "Ctrl+Alt+u"
  },
  ......其余部分省略
}

然后我们就可以用 Ctrl+Alt+c 来创建一个代码块,c 表示code,比默认的 Ctrl+Alt+K 更好记。

有几点需要注意的是:

  • 在自定义自己的快捷键的时候,不要与其余的默认快捷键或自定义快捷键重复,否则使用时会错误,在设置之前去上面链接中搜索一下有没有被使用即可。
  • 有些快捷键可能并不快捷…

比如上面设置的有序列表,虽然 o 表示 ordered 很好记,但是每次创建一个有序列表用 Ctrl+Alt+o 是很麻烦的,更方便的方式是:
在段落中输入 1. 然后输入一个 空格 就创建了有序列表的第一行

同样的,对于无序列表:
在段落中输入 - 然后输入一个 空格 就创建了无序列表的第一行

在typora中使用 Tab 键 和 Shift + Tab 键,就可以完成有序或无序列表的不同等级列表之间的切换。

所以自定义快捷键的时候,看有没有比快捷键更快捷的方式即可,然后自己选择喜欢的方式。

猜你喜欢

转载自blog.csdn.net/qq_41340996/article/details/125210794