obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

Something wrong when use the new editor when use the surround command?

Open woshichuanqilz opened this issue 2 years ago • 0 comments

obsidan version 0.14.6

vim support version 0.6.1.

When use the new version of editor the surround command will locate the wrong position.

As you can see in the gif after I use the command, editor:follow-link, then wiki command locate the wrong place. How to solve it?

In the image:

  1. I use shortcut to wiki text, works fine
  2. I switch to another file by click on the file panel. then jump back to the first file, use the wiki command works fine.
  3. I switch to another file by command editor:follow-link then back, the wiki command locate wrong place

动画

my vimrc file:

" Have j and k navigate visual lines rather than logical ones
exmap lineStart cmcommand goLineLeftSmart
exmap lineEnd cmcommand goLineRight
nmap H ^
nmap L $
vmap gh ^
vmap gl $
nmap gh ^
nmap gl $

" Quickly remove search highlights
nmap <a-n> :nohl

" Yank to system clipboard
set clipboard=unnamed

" Go back and forward with Ctrl+O and Ctrl+I
" (make sure to remove default Obsidian shortcuts for these to work)
exmap back obcommand app:go-back
nmap <A-a> :back
exmap forward obcommand app:go-forward
nmap <A-d> :forward

" Create links"
"exmap insertLink obcommand editor:insert-link
map <A-i> :pasteinto

" Surround text with [[ ]] to make a wikilink
" NOTE: must use 'map' and not 'nmap'
exmap wiki surround [[ ]]
map <A-l> :wiki

exmap openLink obcommand editor:follow-link
map <A-q> :openLink

" Reload Obsidian
exmap reload obcommand app:reload
map <A-r> :reload

exmap commandPalette  obcommand command-palette:open
map <A-f> :commandPalette

woshichuanqilz avatar May 06 '22 15:05 woshichuanqilz