append-editor icon indicating copy to clipboard operation
append-editor copied to clipboard

[Feature Request]: Vim keybindings

Open krillin666 opened this issue 3 years ago • 5 comments

First of all, this editor is my favourite one and has helped me a lot while taking notes. I noticed you integrate Codemirror into this editor and since it is possible to enable Vim bindings in CodeMirror I wonder if this could be done as well for the Append editor ?

Thank you and keep up the good work.

krillin666 avatar Jul 11 '20 16:07 krillin666

bump

krillin666 avatar Oct 01 '20 15:10 krillin666

Hi @krillin666, I am not familiar with Vim bindings in CodeMirror, but this website says they are no longer maintained: https://codemirror.net/demo/vim.html. I am not sure how I feel about enabling them

TheodoreChu avatar Oct 01 '20 18:10 TheodoreChu

Hi @krillin666, I am not familiar with Vim bindings in CodeMirror, but this website says they are no longer maintained: https://codemirror.net/demo/vim.html. I am not sure how I feel about enabling them

Hello, thank you for the response. I hadn't saw it wasn't maintained any more by CodeMirror, therefore I understand your concerns about enabling them. However, would it be possible to compile the editor myself and enable the VIM bindings to test it out ?

krillin666 avatar Oct 01 '20 20:10 krillin666

Yes, there is a way to compile the editor yourself and enable the VIM bindings to test it out.

The instructions for setting up the development environment is available here: https://github.com/TheodoreChu/append-editor#development

The CodeMirror add-ons are imported here: https://github.com/TheodoreChu/append-editor/blob/master/app/components/AppendEditor.js#L9-L29. First add import 'codemirror/keymap/vim'; to a new line.

Then, add keyMap: 'vim', to the CodeMirror configuration (there are two, one for Edit and one for Append):

  • https://github.com/TheodoreChu/append-editor/blob/master/app/components/AppendEditor.js#L313
  • https://github.com/TheodoreChu/append-editor/blob/master/app/components/AppendEditor.js#L353

You can compile it with npm run watch and serve it with npm run serve and visit localhost:8003/dist/index.html in your browser. I think the VIM binding should work as in the demo.

TheodoreChu avatar Oct 01 '20 21:10 TheodoreChu

Hello Theodore @TheodoreChu ,

Excuse me for commenting on this closed issue. However, since SN officially has a VIM editor which uses CodeMirror has a backend (https://standardnotes.org/extensions/vim-editor), could you give it a try to add VIM mode as a setting options in the Append Editor ?

Thank you for your time !

krillin666 avatar Feb 08 '21 16:02 krillin666