Overleaf Editor Custom VIM Keybindings (Code Mirror v6)

Configure a list of shortcuts for Vim-mode + user-defined :commands for toggling panels on Overleaf.

05.03.2023 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Yazar
llinfeng
Değerlendirmeler
0 0 0
Versiyon
0.1.0
Oluşturulma
02.03.2023
Güncellenme
05.03.2023
Boyut
7,49 KB
Lisans
MIT
Geçerli

This is a work-in-progress script that aims at restoring the full functionality of the old Custom Vim Keybindings for Overleaf. Per their recent update, the legacy editor (Ace) is no longer available for some users (myself included), replaced by Code Mirror (v6?). Reassuringly, both Ace and Code Mirror use the same VIM Mode API, documented here.

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>, imap jk <esc> and imap <c-]> <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.
  • With Writefull,
    • Use ]s and [s to jump to the next/previous spell-checking suggestion.
      • Use 1 to accept the current suggestion, and 2 to reject it.
      • Use 9 for "accept all", and 0 for "reject all".
    • While visually selecting a paragraph, press r to trigger the rephrase tool.

And, those that need extra work, include:

  • :vimoff, to turn off the Vim Keybindings. This is useful when one wants to copy texts using Ctrl+C on Windows machines.
  • :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"
  • :history ...
  • Visually, a vertical divider is drawn at the 80th column. All lines with more than 80 cols are wrapped at 80th column.

Known issues

  1. In Vim Mode, Ctrl+C won't work on Windows machines. Command+C works on MacOS. Actually, Overleaf should provide us a solution, as it would be hard to come up with a Userscripts workaround.

Troubleshooting

  1. If the PDF fails to compile, TogglePDF won't work as intended. (This impacts the :pdf command and the <leader>o mapping.)