vipzhicheng / logseq-plugin-vim-editor

Logseq VIM editor
MIT License
46 stars 2 forks source link

Neovim remote #2

Closed krillin666 closed 2 years ago

krillin666 commented 2 years ago

Hi @vipzhicheng , thank you so much for bringing more VIM functionality to Logseq. Its a Godsend !

How hard do you think it would be that instead of opening up the current editor, we leverage the NeoVim's remote functionality to open up it in a nvim window. This way we could take advantage of the personal configs one has in his nvim. Some examples of top of my head would be:

vipzhicheng commented 2 years ago

I digged into it in hours and the short answer would be NO!

There is a possible plugin in market called open with, it uses system url scheme to trigger opening in external app. but on Mac, iTerm and Terminal are all not registered any schemes.

I tried MacVIM, yes, it registered mvim:// to let chrome open it in browser, but it is a VIM GUI not NeoVIM GUI, I tried a lot of NeoVIM GUIs, none of them works that way.

And I noticed VSCode registered URL scheme: vscode://, so I install a VSCODE NeoVIM plugin, and make all markdown opened with VSCode, Then I partly implemented the workflow.

image image

The solution is not a perfect solution, but just the best answer I can give for now.

vipzhicheng commented 2 years ago

In the latest release, I provide a way, :copy-path, to give the page or journal absolute path, so you can copy and paste to terminal to edit it in Vim.

fakeyanss commented 4 months ago

This can help you.

https://forum.obsidian.md/t/open-note-in-obsidian-from-within-vim-and-vice-versa/6837/5

image image
fakeyanss commented 4 months ago

Well, I found Alacritty is more convenient.

Using Run Shell Script in Automator, and set as:

nohup /Applications/Alacritty.app/Contents/MacOS/alacritty -e vim "$1" > /dev/null 2>&1 &

I can open a page by default app(set to TerminalVim.app before) and edit. And just type :wq in normal mode, the alacritty window will be closed too.

image