Vim-mode Powerful Shortcuts

I migrated to LogSeq from Checkvist and on the whole found something which is better suited to my needs. Thank you for making this!

The biggest loss, however, has been the keyboard commands. Checkvist had the Vim-like powers Santi suggests! It is world class as far as the keyboard-driven user experinece. In this respect Logseq is not in its league. And to match Santi’s sentiment, if you’re going to make extensive use of a tool, the best user experience is going to come from what the keyboard gives you.

2 Likes

yes, It’s really an important feature.

The lack of vim support is the one thing currently keeping me from adapting logseq. This is the #1 requested feature for a good reason!

It seems like the cleanest approach may be to simply delegate the vim parts to neovim, just as in https://github.com/asvetliakov/vscode-neovim.

  • When the user hits esc to enter normal mode, the current text is copied into a scratch buffer in a headless neovim instance, and all subsequent keystrokes are passed through to neovim (which handles the navigation, replacements, etc.)
  • When the user hits i to go back to insert mode, keystrokes are captured by logseq again to edit the text directly.

Since logseq files are just markdown text under the hood, it seems like a very basic prototype should be relatively easy to build.

13 Likes

Puh-leeease — this would make for some real polish on a splendid apple!

2 Likes

As a temporary sloution there is now a vim mode plugin!

logseq-plugin-vim-shortcuts v0.0.1 was just released! :tada::tada::tada:
I provided 30+ shortcuts which give Logseq a feeling of VIM-like.
No more description, just try it~ :grinning_face_with_smiling_eyes:

It’s available in the marketplace. To enable plugins:

  • Settings ⇾ advanced ⇾ enable developer mode
  • Click on the 3 dots top right
  • you will see now an option for plugins.
10 Likes
4 Likes

Interesting idea for sure! However, not for a beginner. If implemented, please make a toggle to enable and disable this feature.

P.s. is there a downvote feature in discuss.logseq.com?

That goes without saying. Whenever a vi mode is added to any non-vi application, it’s always optional.

2 Likes

There is another vim plugin to edit the contents of a block: GitHub - vipzhicheng/logseq-plugin-vim-editor: Logseq VIM editor

Here is another vim plug-in: GitHub - j-wyatt-a/vim-wyatt-logseq-plugin: The purpose of this plugin is to give logseq a vim-like editing experience

It has handy features like quick-jump (getting us to anywhere on a page in 2-3 keys) and vim word navigation.

Nonetheless, it needs a developer to smooth out the edges. The original developer states that this plug-in’s primary purpose is to inspire a better vim plug-in in Logseq—and I think it does that well.

It would be great if the features of this plug-in could be integrated into the most popular vim plug-in atm: GitHub - vipzhicheng/logseq-plugin-vim-shortcuts: Add part of VIM key bindings experience to Logseq

I use two plugins Vim shortcuts and Vim Editor. My experience is I regularly use the shortuts plugin , but I rarely go into ‘Vim editor’ mode cuz

1 - you have an extra operation to press cmd E - vim is all about efficiency, adding an extra operation is against the basic philosophy :slight_smile:
2 - Handling multiple blocks is kinda hard.
3. The page control doesn’t come back automatically when you :wq the block being edited. You need to click somewhere on the page to get the control back.
4. Can’t create new blocks (I think).
5. Doesn’t catch my vimrc… Without that the features are not exciting enough to go through all the pain.

Thus I am missing vim while writing a long block …

A native vim experience for entire page is absolutely must for native vim users - something like Atom or vsCode.

On the other hand , building a vim experience (the one that a vim user craves) is like boiling the ocean. Because no matter how much you build in logseq, a serious vim user will always default back to command line mode. A much used tool thus be, building a logseq plugin for vim. This will bring the graph benefits of logseq to vim and at the same time introduce logseq to a much bigger vim user base . Basically we need either a logseq-CLI that natively opens vim for every page and tracks the blocks in there, and/or a vim plugin that allows me create blocks and pages and link them in a graph.

In absence of above two - native vim experience in Logseq, or the logseq-CLI, I simply need to split my work - notes and random thoughts in logseq, serious writing in vim.

4 Likes

Is there any plan to implement vim mode in logseq? I tried several plugins, but none of them works as expected. It would be great to use vim-mode in logseq,

4 Likes

I’d like to propose kakoune. It is like vim, but more modern and easier to learn.

One solution for this could be to provide a way to navigate in logseq from terminal. logseq would open .md files in user’s favorite text editor.

2 Likes

+1 for building Vim keybindings into logseq natively. Users should be able to enable/disable these Vim keybinds if they wish to, and they shouldn’t have to rely on a logseq plugin for that feature.

Having working more with Logseq and other tools, it doesn’t make that much sens to add other kind of keybinding. An editor like Vim is usually used with a lot of configuration. When I want to use my own editor, I simply launch it and edit file directly in the logseq folder. You can also create files directly from there, even with hierarchy (by using “___” in the filename). So far for me, the only thing that doesn’t work well is adding images, because I can’t drag and drop. Beside that, I am not sure I would need vim keybinding. Althought I haven’t tried it, I suppose the vim plugin would be sufficient for this need.

My conclusion is that the best way to deal with this would simply to be able to open the current page with custom editors and be able to specify multiple custom editors so I see it like a settings that can add different custom commands with different names that would be avaialble as buttons somewhere in the application. Or even easier, being able to add shortcuts that launch a command that receive the file path as an argument.

I believe having full compatibility with org mode would make more sens. I don’t use nor know much about org mode but one reason I haven’t dived more into it is that Logseq is apparently not fully compatible with it.