nextcloud / files_texteditor

:page_facing_up: Text editor for plaintext files
72 stars 41 forks source link

Enable vi keybindings #172

Open osresearch opened 5 years ago

osresearch commented 5 years ago

The ace editor supports a vi mode, but to enable it requires that I open a console and type:

aceEditor.setKeyboardHandler("ace/keyboard/vim")

every time I edit a document. Ideally this would be available as a user preference, similar to what was implemented in #119 .

Steps to reproduce

  1. Open a text document
  2. Open the console
  3. Paste aceEditor.setKeyboardHandler("ace/keyboard/vim")
  4. Enjoy vi mode while the document is open for editing

Nextcloud Version

yamsu commented 3 years ago

Hi, vim key bindings would be great; however, in version 20.2 the aceEditor.setKeyboardHandler("ace/keyboard/vim") comannd in the console window throws the following error

Refused to load the script 'https://192.168.9.234:9823/apps/files/keybinding-vim.js' because it violates the following Content Security Policy directive: "script-src 'nonceLWlBmTk5MWGtOaHJIOEZMQT06SGtsVHo2cEZlNzAvTlhMeG1EYkNnaFVCVFMvYldKQUNZa=' blob:". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I'm using the stable files_texteditor