Helix mode for Obsidian (and other things) via CodeMirror #8386
Replies: 6 comments 7 replies
-
Sounds like you're looking for https://github.com/helix-editor/helix/blob/master/helix-term/src/keymap/default.rs |
Beta Was this translation helpful? Give feedback.
-
A lot of the Electron/online editor programs that have a vim mode use CodeMirror in some way. So I believe some plugin for CodeMirror would be the best bet. |
Beta Was this translation helpful? Give feedback.
-
@DumbDurian I use Jetbrains' IDEs at work and, having used Vim for many years, use a plugin called IdeaVim there. Recently I have switched to Helix and have been trying to Helix-ify all the places that I used Vim. In IdeaVim I have a non-complete frankenstein of other people's keymaps as well as my own here. I've just started trying to do the same with the vimrc-support plugin, but a cleaner solution would be to create/use a Helix plugin that works similar to vimrc. My Obsidian notes are private, but a couple of things I've gotten working this morning are nnoremap d x
vnoremap d x
nnoremap x 0v$
vnoremap x j Have you discovered anything else that would help in bringing Helix to Obsidian? |
Beta Was this translation helpful? Give feedback.
-
Do you happen to have any updates on this? |
Beta Was this translation helpful? Give feedback.
-
FYI I've given this a try, and I have a very rough initial version at https://www.npmjs.com/package/codemirror-helix |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for making it easier. I got an error message while installing using BART. I created an issue for it in your repository. There is not problem with manual installation. |
Beta Was this translation helpful? Give feedback.
-
Mainly looking for some thoughts on the feasibility of building something like a 'helix-mode' for (mainly, but not exclusively) Obsidian.
Obsidian uses https://codemirror.net/, more specifically https://github.com/replit/codemirror-vim to offer a vim-mode within Obsidian.
I know neither of the tools' internals very well, so I am looking for the assessment of others! As far as I can tell most of the logic lives in https://github.com/replit/codemirror-vim/blob/master/src/vim.js
I am not sure if this is auto-generated, but either way, one would probably have to translate the helix keymap in the same way I assume. Is there an equivalent keymap file in the helix repository? https://github.com/helix-editor/helix/blob/master/helix-term/src/keymap.rs seems rather small, are there any other files I should have a look at?
I think having a CodeMirror like implementation for helix could go a long way for adoption as other things like for example typst.app are depending on CodeMirror as well.
Please provide some thoughts, feedback or ideas on how to possibly tackle this problem!
Beta Was this translation helpful? Give feedback.
All reactions