Overleaf Editor Custom VIM Keybindings (legacy, for Ace editor only)

Configure a list of shortcuts for Vim-mode + :commands for toggling panes on Overleaf

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
llinfeng
1日のインストール数
0
累計インストール数
264
評価
1 0 0
バージョン
0.3.7
作成日
2020/04/16
更新日
2023/03/01
大きさ
11.8KB
ライセンス
MIT
対象サイト

Notes for those without access to the Source (legacy) editor: In February 2023, Overleaf starts to discontinue the legacy editor. This userscript won't work with the new Code Mirror editor anymore. Use this new script instead: https://greasyfork.org/en/scripts/461062-overleaf-editor-custom-vim-keybindings-code-mirror-v6

Notes on making use of this script: In June 2022, Overleaf started updating its editor interface. This script is compatible with the "Source (legacy)" editing mode for now.

Full Credits to Harutyun Amirjanyan for the jump-to-PDF script, as found on the Ace forum, in this post.

List of mappings defined here:

  • imap jj <esc> and imap jk <esc>
  • nmap j gj and nmap k gk (so far, we cannot mapt g0 in Ace editor.)
  • \lv and ;lv are triggering the following button image
  • ,v to toggle the file-tree on the left.
  • ,o to enter editor-only mode: it hides the file panel and the PDF preview pane. (Caveat: if file-tree is hidden and PDF view is alive, this shortcut will show the file-tree and hide PDF.)
  • :o in Commandline, to hide box below the editor pane, introduced by the "Omega" icon to the right of "Source | Rich Text".
  • :pdf in Commandline, to toggle the PDF pane on the right. Alias include: :PDF, :ShowPDF, :ClosePDF, :OpenPDF.
  • :cc in Commandline, to toggle the Comment panel. Alias include: :CC, :CloseComment.
  • :home in Commandline, to get back to the "All Projects" view.
  • :log in Commandline, to toggle the "CompileLog"
  • With Writefull, use ] and [ to jump to the next/previous spell-checking suggestion.
    • With the suggestion card, use 1, 2, 3 to select over the options offered. It doesn't matter how the suggestion card is brought up. As long as it is visible, one can select over the candidates using 1, 2, 3.

Visually, a vertical divider is drawn at the 80th column. All lines with more than 80 cols are wrapped at 80th column.

Note, this script unmaps ctrl+l, leaving it available for the browser.

It should be plug-and-play, and include settings of the following sort.

  1. nmap and vmap;
  2. unmap certain special keys. (For now, ; and , are specially reserved for unknown purposes.)
  3. command! Short LongCommand, where :Short can be callable. And, in TamperMonkey, the LongCommand needs to be specified through JavaScript.

Troubleshooting

  1. If the PDF fails to compile, TogglePDF won't work as intended. (This impacts the :pdf command and the <leader>o mapping.)
  2. (Added on 2021-07-26) Works well with Vivaldi 4.0.2312.24. Does not work with 4.0.2312.41.