notable / notable

The Markdown-based note-taking app that doesn't suck.
https://notable.app
22.61k stars 1.15k forks source link

Vim keybindings #52

Open jletey opened 5 years ago

jletey commented 5 years ago

I'd love it if it was possible to add vim keybindings while your editing! Or, at the very least, there should definitely be a keybindings configuration file that you can edit so that people using the app can tweak the app's default keybindings (kind of like VSCode's keybindings configuration file).

fabiospampinato commented 5 years ago

I'm not very familiar with vim, and I'm not sure if we can satisfy everyone's preferences at a deep enough level, but support for customizing the editor should definitely be added.

tylerdiaz commented 5 years ago

Agreed, Vim key bindings would be interesting and CodeMirror seems to have an unmaintained version of it: https://codemirror.net/demo/vim.html

@johnletey I wonder if the effort required for custom key bindings is a suitable alternative to this feature request. As far as I know Bear and Evernote don't allow key-level configuration. Is there an example key binding that could contextualize the discussion?

jletey commented 5 years ago

Is there an example key binding that could contextualize the discussion?

As of right now, Notable's keybindings aren't the most intuitive (to me ... I'm not quite sure about everybody else) and I would love to change them up a bit so that they're easy to work with ... that's all I was really asking for.

Darksonn commented 5 years ago

One option would be to connect the editor to Neovim. Neovim is a fork of vim that has a msgpack based api, which Notable could use to communicate with Neovim.

This would give Notable a fully working vim environment with the full customizability of vim.

jletey commented 5 years ago

This would give Notable a fully working vim environment with the full customizability of vim.

That sounds awesome! This sounds better than using CodeMirror's unmaintained vim keybindings, as neovim is still maintained.

Neovim is a fork of vim that has a msgpack based api, which Notable could use to communicate with Neovim.

@fabiospampinato Is this possible?

fabiospampinato commented 5 years ago

@fabiospampinato Is this possible?

Maybe, I'm not familiar with either vim, neovim or msgpack.

Let's add a way to customize CodeMirror's settings/shortcuts first.

kolpav commented 5 years ago

I would also love to have vim keybindings and neovim is definitely way to go so you don't have to reimplement all of vim or use unmaintained plugins. For inspiration you can take a look at very popular vim plugin for vscode here which allows neovim integration.

tlc commented 5 years ago

There are vim bindings for monaco here. https://github.com/brijeshb42/monaco-vim

But I don't know how to plug them in.

ryuheechul commented 5 years ago

It will be great to support Vim keybindings as I can't live without it like many.

But we can also take advantage of being able to access all the files written from Notable with other editors in the meantime.

I'm using macOS

For example, I've changed the default application of all *.md files to Visual Studio Code which I already installed Vim extension on it. And you have the Open In Default App button in the right corner of your Notable app for every note. You click it and you can edit your note and when you save it from VSCode then it reflects on Notable right away. Which is helpful especially when you are editing for a longer time.

Maxwin-z commented 5 years ago

There are vim bindings for monaco here. https://github.com/brijeshb42/monaco-vim

But I don't know how to plug them in.

monaco-vim's dependency ("monaco-editor": "0.14.3") is different with notable("monaco-editor": "^0.17.0"), so I integrate it with source code. FYI: https://github.com/Maxwin-z/notable/commit/7f131aabc43289f13170556c5d46954e3d735be2

sorry with the large changes, because I use another prettier configuration..

tonywoode commented 5 years ago

@Maxwin-z will you be PR-ing your changes? @fabiospampinato what do you think of the changes wrt @Maxwin-z's prettier configuration, can you work with it or should it be submitted differently?

vim keybindings can turn into a dealbreaker for some, particularly because many other note-taking electron apps do have vim keybindings (and because vim doesn't have the greatest note taking support ;-) )

fabiospampinato commented 5 years ago

@fabiospampinato what do you think of the changes wrt @Maxwin-z's prettier configuration, can you work with it or should it be submitted differently?

I didn't have the time to look at the changes he made. Right now I'm busy with other features.

many other note-taking electron apps do have vim keybindings

Can you name a few apps?

tonywoode commented 5 years ago

Boostnote, TiddlyDesktop, Jupyter Notebook...

tserafim commented 4 years ago

Can you name a few apps?

Joplin added this feature on v1.0.173

bmorashad commented 4 years ago

Would love to have vim...

kevincfz commented 4 years ago

Definitely worth adding vim bindings!

gcgbarbosa commented 4 years ago

+1 for vim bindings. I can help if needed

fabiospampinato commented 4 years ago

@gcgbarbosa Maybe hop in the chat (https://chat.notable.app), with the latest alphas of v1.9 vim-style keybindings may can be implemented already as custom shortcuts.

Josiah-tan commented 4 years ago

Github needs vim!

fabiosirna commented 4 years ago

One of Notable's strengths is its simplicity.

Adding features found in complex editors like Vim, NeoVim or Emacs would make it complicated to use and overengineered. If I want an editor to write code I use Vim, if I need an editor to write notes I use Notable.

I'll probably say one unpopular thing: it makes no sense to add features to customize Notable and make it a code editor. Might as well use a thousand other editors with the same functionality that already exist.

zebapy commented 4 years ago

I think those who use vim highly wish the keybindings were everywhere they now write text. This is my opinion as well and why I hope to find a note app that supports vim. Using a code editor notes in order to get vim isn't ideal due to non note editing features required.

Yes you could use real vim but a note app on desktop then still being able to access notes on mobile would be ideal.

On Sun, Sep 6, 2020, 4:49 PM Fabio Sirna notifications@github.com wrote:

One of Notable's strengths is its simplicity.

Adding features found in complex editors like Vim, NeoVim or Emacs would make it complicated to use and overengineered. If I want an editor to write code I use Vim, if I need an editor to write notes I use Notable.

I'll probably say one unpopular thing: it makes no sense to add features to customize Notable and make it a code editor. Might as well use a thousand other editors with the same functionality that already exist.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/notable/notable/issues/52#issuecomment-687898062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQZCJJRHXI6JXN45O4GT5LSEPYW5ANCNFSM4GMMITQQ .

tonywoode commented 4 years ago

@fabiosirna I also think that Notable collects together a lot of required features: nested notes, simplicity, simple markdown, external editing and so on, and this is why many devs who found the app would wish to use it for their work notes, because the thousand other editors that do the same thing all manage to get at least one of those things wrong, and so are constantly problematic to workflow. If Notable had vim bindings, it has the potential to be that killer app we need

fabiospampinato commented 4 years ago

One of Notable's strengths is its simplicity.

I think there's a way to make the app more powerful without taking away from its simplicity.

Btw since the alphas of v1.9 it may be possible to implement vim-style keybindings as user provided custom shortcuts. If anybody would like to play with that (I'm not vim expert myself) please join the chat so that we can talk about how to make that perfect.

gcgbarbosa commented 4 years ago

I think I solved the problem. I only use notable in zen mode, or when creating and managing files. Then I vim to edit the files.

PeterlitsZo commented 3 years ago

In my views, although the VS Code can has the vim keybindlings and easy to deal with files editing, but it is hard to edit/view it easily. If Notable has the optional vim keybindlings, it will be better for me! - I do not have mouse and really need vim mode to handle the editing.

CavalloneChen commented 3 years ago

https://github.com/asvetliakov/vscode-neovim, this vscode neovim plugin may be worth checking. @fabiospampinato

fabiospampinato commented 3 years ago

@CavalloneChen That looks really interesting, thanks for sharing!

yixin0829 commented 3 years ago

Thanks so much for developing this! It's a shame that it does not have vim mode. I've become used to edit in vim rather than cursor and this is a major drawback.

mattalxndr commented 2 years ago

I keep adding things like "gg" and "ciw" to the document by accident :-)

hasnolen commented 1 year ago

I think I solved the problem. I only use notable in zen mode, or when creating and managing files. Then I vim to edit the files.

So the issue with this, @gcgbarbosa , is that Notable.app won't re-render the Markdown after changing the underlying file, right?

Edit: nevermind, it will. My lack of updating issue was due to another thing I was doing where I was using a symlink to put wayward .md files into the notes/ directory, meaning the symlink file timestamp itself wouldn't update and wouldn't trigger the refresh. I'll just reverse the symlinks.

fabiospampinato commented 1 year ago

@hasnolen are you on the betas? (https://github.com/notable/notable-insiders/releases/tag/v1.9.0-beta.10) I haven't explicitly tested this, but maybe whichever way you do it works there 🤔 If it doesn't maybe it should be considered a bug.

gcgbarbosa commented 1 year ago

@hasnolen I think you're right. Having the keybindings would be nice, but being able to reload the file as we edit it is for sure enough. That is a cleaner solution to my problem.

hasnolen commented 1 year ago

@gcgbarbosa Yeah, reversing the symlinks worked; Noteable's render now updates within a few seconds of the underlying file. Messes up my grand scheme because the symlinks themselves are in a Cryptomator volume (which for some reason doesn't support relative symlinks), but this is more than good enough for now.

@fabiospampinato thanks much! Yes, I'm for sure on the betas. I don't think it should be considered a bug to be honest; following the symlink to look at the timestamp of the source file is probably more of a feature than a bug, and probably one that, to be fair, Notable shouldn't prioritize supporting because it's basically a workaround for an already planned feature (emulation of vim and/or emacs keybindings and functionality in Notable inbuilt editor).