在 MacVim/Neovide 中打开当前文件【Obsidian shell commands】

在 MacVim/Neovide 中打开当前文件,支持定位到光标所在行。

############### 方法已过时,请看一楼末尾的更新 ############### 
# MacVim
/opt/homebrew/bin/mvim +{{caret_position:line}} {{file_path:absolute}}

# Neovide
/opt/homebrew/bin/neovide +{{caret_position:line}} {{file_path:absolute}}
############### 方法已过时,请看一楼末尾的更新 ############### 

问了下 Vim 那边怎么支持定位到单词级别,Vim 创始人回复我说有计划支持。

新进展

2022-10-15 01:13:22 +0800
在 Vim 大佬的帮助下学习了个新方法,可以实现和 VSCode 一样的光标精准定位表现了:


/opt/homebrew/bin/mvim {{file_path:absolute}} -c 'normal {{caret_position:line}}G{{caret_position:column}}|'

/opt/homebrew/bin/neovide {{file_path:absolute}} -c 'normal {{caret_position:line}}G{{caret_position:column}}|'

如果你更喜欢 Emacs: