Vim and Emacs keybinding

Overleaf provides emulations that support some Vim and Emacs editing features.

The option to turn on the Vim or Emacs emulation modes can be found in the Project menu in the Settings section. This is a user-specific setting. There are three keybinding modes: None (the default), Vim, and Emacs.

Overleaf's Vim and Emacs keybindings are provided by an open-source code editor component. They are emulations, so not all Vim/Emacs bindings are fully supported, especially pre-existing browser shortcuts.

Emacs

Overleaf's Emacs mode is a "loose approximation of actual emacs bindings" based on the one originally provided by the CodeMirror 5 open source project. Please see: https://codemirror.net/5/demo/emacs.html.

Vim

Overleaf's Vim keybindings are provided through a project that is affiliated with CodeMirror, the codemirror-vim project. Please see: https://codemirror.net/5/demo/vim.html.

Troubleshooting

When using Vim I cannot switch back to normal mode from insert mode.

This problem can be caused by interference from the Chrome extension "Vimium." If you're using that extension, you may find that after inserting text you're unable to revert to normal mode—the standard commands ESC or CTRL-[ may not work. Please disable this extension while using the Overleaf Vim emulator.

In Emacs, some commands such as Ctrl-N, Ctrl-T and Ctrl-W do not work.

Browsers often use key combinations that are also used by Emacs for some of their core functions, including Ctrl-N, Ctrl-T and Ctrl-W, to open or close windows or tabs. These events are intercepted before they are sent to Overleaf and unfortunately cannot reach the Emacs emulator.

Last updated

Was this helpful?