TeXPage 自定义快捷键

TeXPage 的编辑器使用开源的 Ace Editor,有能力的用户可以通过 TamperMonkey 自行编程设置自定义快捷键。

设置自定义快捷键有可能影响编辑器使用,如果遇到问题,发送邮件至 support@texpage.com,我们会帮助您解决。

基础样例代码

// ==UserScript==
// @name         TeXPage Editor Custom Keybindings
// @namespace    http://tampermonkey.net/
// @match        https://www.texpage.com/project/*
// @match        https://texpage.com/project/*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  const getEditorTimer = setInterval(() => {
    // TeXPage editor instance
    const editor = window._texpage_editor
    if (editor === undefined) return;
    clearInterval(getEditorTimer)

    // Your code here...

    console.log("TeXPage Editor Custom Keybindings Started!")
  }, 200)
})();

扩展 VIM 快捷键

// ==UserScript==
// @name         TeXPage Editor Custom Keybindings
// @namespace    http://tampermonkey.net/
// @match        https://www.texpage.com/project/*
// @match        https://texpage.com/project/*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  const getEditorTimer = setInterval(() => {
    // TeXPage editor instance
    const editor = window._texpage_editor
    if (editor === undefined) return;
    clearInterval(getEditorTimer)

    // vim keyboard plugin
    const vimKeyboard = window.ace.require("ace/keyboard/vim")

    // Your code here...
    // For example: vimKeyboard.Vim.map("a", "b", "normal")

    console.log("TeXPage Editor Custom Keybindings Started!")
  }, 200)
})();