Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vi[m] mode #1298

Closed
MostFrabjous opened this issue Mar 5, 2019 · 11 comments · Fixed by #2056
Closed

vi[m] mode #1298

MostFrabjous opened this issue Mar 5, 2019 · 11 comments · Fixed by #2056

Comments

@MostFrabjous
Copy link

Operating system

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Application

  • Desktop

Please add support for a "vim mode" that supports keybindings and operations as they are used in vi[m]. See https://codemirror.net/demo/vim.html for an very extensive example of vi mode in another JS-based editor.

At first there should be support for navigation (h, j, k, l, 0, $, ^, w, W, #w, b, B, #b, G, gg) and simple text editing like inserting text (a, A, i, O, o), manipulating text (x, dw, d0, d$, dgg, dG, dd, #dd) and copying/inserting text (yy, p, P) as well as undo/redo (u, Ctrl-r) and searching (/string, n, N).

@JuneKelly
Copy link
Contributor

Given that the editor is based on Ace, this shouldn't be too hard to do.
I'll look into it over the next week or so.

@flipjs
Copy link

flipjs commented Sep 1, 2019

It would be nice if vim mode could be added to command line version too.

@Double1996
Copy link

@ShaneKilkelly Use vim like leanote

@jorfanakis
Copy link

Given that the editor is based on Ace, this shouldn't be too hard to do.
I'll look into it over the next week or so.

Any status update on this? I think this would be a massive improvement.

@JuneKelly
Copy link
Contributor

I've got a working feature branch, almost ready to go. I'll open a PR some time in the next few days, hopefully :)

Oh, and it also includes an emacs mode, in addition to the default bindings.

@JuneKelly
Copy link
Contributor

PR open: #2056

@jorfanakis
Copy link

jorfanakis commented Nov 5, 2019 via email

laurent22 pushed a commit that referenced this issue Nov 6, 2019
…2056)

* Add keyboard modes to editor (vim, emacs, default)

This adds a new option to settings, and then sets the
appropriate keyboard handler in the ace editor.

The "default" option is equivalent to the old keyboard
behaviour.

* Remove stray console.log

* Move the keyboard-mode setting to the general section

* Change `keyboardMode` setting to `editor.keyboardMode`
scoroi pushed a commit to scoroi/joplin that referenced this issue Nov 10, 2019
…emacs) (laurent22#2056)

* Add keyboard modes to editor (vim, emacs, default)

This adds a new option to settings, and then sets the
appropriate keyboard handler in the ace editor.

The "default" option is equivalent to the old keyboard
behaviour.

* Remove stray console.log

* Move the keyboard-mode setting to the general section

* Change `keyboardMode` setting to `editor.keyboardMode`
@Nebucatnetzer
Copy link

I wanted to try this feature but I can't find the new option for it.
Screenshot from 2019-11-11 10-33-34

@JuneKelly
Copy link
Contributor

The option should be in the "General" section. I think the comment at the top of the pull-request is misleading, as the location changed during review.

@Nebucatnetzer
Copy link

Ah yes found it now, thank you :).

@deoxykev
Copy link

I've got a working feature branch, almost ready to go. I'll open a PR some time in the next few days, hopefully :)

Oh, and it also includes an emacs mode, in addition to the default bindings.

Thank you so much!!!! I think I've finally found my perfect note taking app now. Cheers.

@lock lock bot locked and limited conversation to collaborators Nov 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants