VI/VIM Key mode, Integration or embedding of vim/neovim as the editor
Thank you for your suggestion. Any volunteers? :)
Trust me If I knew how I'd be all over it. I know there is an API for hooking into neovim. that may be the easiest way to get it in. then the plugins and full function of vim would be added to qownnotes.
And how should that work? Is there even a GUI version of neovim?
This version that runs in atom works but you have to have the nvim socket open..
https://atom.io/packages/neovim-mode
This works much better but is really just an x11 frontend to neovim
https://github.com/rhysd/NyaoVim
I will close this issue until there is / are more information / volunteers.
I would also like QOwnNotes to have a Vim-Mode. Using vim hotkeys everywhere else makes the use of QOwnNotes a bit annoying at times. It's the one thing I'm missing!
Yes please. QOwnNotes would be a great tool to use, but without a real editor, it's not something I could work with efficiently.
It would very nice to have vim mode in qownnotes editor. :)
Since we have a read-only mode now I maybe will implement some basic vim-shortcuts. :)
Any suggestions? Like:
i: insert mode (turns off read-only mode)/: search (opens search bar)Esc: leave edit mode (turns on read-only mode)Those, but also:
o: open new line below;
O: open new line above;
A: Insert mode at the end of the current line;
a: insert mode after the next character;
v: visual mode; (also ctrl+v)
But also stuff like "ciw" for "change inside word" or "ci(" for "change inside parenthesis", etc..
I first need to get a Text Cursor in read only Mode to make most of those Shortcuts useful
there are a lot of useful key bindings in vim :)
It looks like you are developping in C++ ?
Here some addition useful keybinding :
in Normal mode :
maybe it exists some library which does already the job because there are a lot of key bindings :)
There might be https://github.com/hluk/FakeVim if I can get it running.
So far I had no luck with the library, it crashes for me (see https://github.com/hluk/FakeVim/issues/40).
I got it to run now. It seems that if we are using FakeVim then most of the shortcuts of OOwnNotes to work inside notes will not work properly... But there vi shortcuts seem to work. Is that a price we want to pay?
I finally got a basic Vim mode working.
There now is a new release, could you please test it and report if it works for you?
WOW! That's the best thing that happened to QOwnNotes in a loooong time! 馃懐 Thanks, and cheers!
It doesn't seem to build on Windows (AppVeyor) yet... :grimacing: More work to do...
V-Block mode doesn't seem to work (Ctrl+v).
EDIT:
Some things I don't like:
Can you please explain in more detail and step by step what you did, what happened and what you expected.
Sure @pbek:
Let's say you've a document with the following text:
"
aaaabbbbaaaa
aaaabbbbaaaa
aaaabbbbaaaa
"
If you put the cursor on the first "b", then click on "ctrl+v" and go down and right, you should be able to select all the "b"s at once. You can then press "x" to delete them. Well, visual-block mode doesn't seem to work in qownnotes, that is, you can't select columns in visual mode.
Scratch that, V-Block mode seems to work. There's just no visual feedback to it. I can do what I mentioned in the previous post, but the block should be highlighted and it currently is not (I am using the dark theme). (See an example here, in the 2:55 mark)
I didn't even play with dark mode yet...
:w, :q and :wqThere now is a new release, could you please test it and report if it works for you?
Wow !! Thank you @pbek
It works very well on my side with the latest version. Even other command like :%s/search/new/g
I've tested almost all functions mentioned and it all works :) Great work !
Here is some minor feedbacks :
cursor is not always the same, it varies depending the character and if there is no character it is "normal"
I guess that's because the cursor is drawn manually and depends on the size of the character
during search i can loose colorization of the pattern, for example if there are multiple match, type 'n' for the next one and colorization disappear but can reappear later (dark mode)
I'm not sure what can cause this yet...
Thank you for your feedback. Sounds like you want to post some issues / feature requests on https://github.com/hluk/FakeVim/issues. ;)
Sorry @pbek. I thought these were things you could change. It looks great though, thank you for supporting vim-mode.
I thought these were things you could change
technically everyone can, the FakeVim library is FLOSS ;) as well as QOwnNotes is...
It looks great though, thank you for supporting vim-mode.
thank you, I had to spend a lot of time for fixes and integration work :)
about cursor width it can be solved using monospace / fixed-width font in the editor like DejaVu Sans Mono.
@valvin, thank you! It does not completely fix the issue (when there's no character, the cursor is different) but it's much better now!
I've tricked it using the "note editor cursor witdth" but it affects normal and insert mode

Most helpful comment
Yes please. QOwnNotes would be a great tool to use, but without a real editor, it's not something I could work with efficiently.