xolox / vim-notes

Easy note taking in Vim
http://peterodding.com/code/vim/notes/
1.6k stars 110 forks source link

Goto next / prev note in current buffer #57

Closed blueyed closed 10 years ago

blueyed commented 10 years ago

It would be nice, to navigate quickly to the next previous note in the current file.

Is this possible already?

I could imagine something similar to xolox#notes#highlight_names, which would create a search (using :keeppattern). There should me maps for prev/next, and maybe commands.

(Initially I have thought to use the syntax group for this, but that would require a pattern still to do the outer search. Something along:

function AdjustSerial()
    while search( '\D\zs\d', 'W' ) > 0
        if synIDattr( synID( line('.'), col('.'), 1 ), 'name' )
                \ == 'zoneSerial'
                break
        endif
    endwhile
endfunction

)

xolox commented 10 years ago

I don't think I really understand your request. You seem to be asking for mappings to quickly jump to the next/previous note in the current window. But how do you define next/previous note? There is no implied relationship between notes in a directory. And why do you mention using syntax highlighting? I don't understand what the two (syntax highlighting vs. navigating between notes) have to do with each other?

xolox commented 10 years ago

Without further feedback I can't make heads or tails of this request so I'm going to close this issue now. If you feel like elaborating please feel free to reopen this issue or create a new one. Happy Vimming!

blueyed commented 10 years ago

The idea was to jump to the next/prev note mentioned in the current file, like n goes to the next search result.

But how do you define next/previous note?

It would be relative to the current cursor position.

I've mentioned syntax highlighting, because the note's syntax group could be used for this: search for the prev/next instance of it.