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

Move to start and end of visual line

Open apotenza92 opened this issue 1 year ago • 2 comments

Hi, I'm not much of a programmer yet, but I'm trying to get this plugin to work for the visual start and end of lines for 0 and $.

Currently, I have this in my .obsidian.vimrc but it doesn't seem to be working.

" Move to start of visual line
exmap lineStart cmcommand goLineLeftSmart
nmap 0 :lineStart

" Move to end of visual line
exmap lineEnd cmcommand goLineRight
nmap <S-4> lineEnd

Would I iinstead need to make a new function in mdHelpers.js to get this to work instead, like the next headings example you made?

apotenza92 avatar Jul 08 '22 04:07 apotenza92

Never mind, just found you wrote, "This currently only works with the legacy (CM5) editor. Support for the CM6-based editor may be added in the future." here. What's the work that would need to be done to implement this?

apotenza92 avatar Jul 08 '22 04:07 apotenza92

If I remember correctly, I was unable to find a similar mechanism in CM6. It works very differently. But it's surely worth putting more time into it, perhaps I just missed something easy and obvious! Also, there are commands for the Obsidian Editor wrapper and these are extremely easy to implement (maybe they already work as part of obcommand). These include goStart and goEnd, not sure if this refers to the document or the current line.

esm7 avatar Jul 11 '22 03:07 esm7