-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support jumping to next section with ]] & [[ #146
Comments
Looks like you are right, this is indeed part of vim-pandoc, found it in their docs here. Although when checking Vim's native As for your use-case, I think for getting around a large document it'd be more effective to use mkkdx's PREFIXI mapping to open the headers in a quickfix window. Pressing enter on any header takes you there. This only advantage mappings such as [[ and ]] have is if you know you need to be in the next section to just jump there immediately. If reading the quickfix list takes too long there's also an alternative method which supports fuzzy finding using the fzf plugin. Granted you can specify a count to these jump mappings, but for large documents I doubt I'd remember how many counts away any specific header is. Not going to close this yet as I'm interested to know if this suits your needs instead of adding additional functionality to mkdx. |
I think your right about using PREFIXI for getting around large documents (I must have missed this, nice!). But it doesn't quiet allow one to brainlessly and quickly move to sections near the cursor (perhaps its onscreen or offscreen). I guess in the end its all about two things (for me) speed and familiarity. One could just hold down j or } (and others) to get where they want but it can be faster/more efficient if you can move by section. I guess its ingrained behavior I expect when using vim, just like when I use ]] to jump from function to function in a Its really nice to have key bindings that work similarly no matter what document/code you edit (same reason I wanted to map to ctrl-] in a previous comment if you recall). Just a suggestion anyway. Its definitely your prerogative on what you want to go into the plugin! |
I see, yes cognitive load will always be a bit higher when having to think about where you're going, I'm a person that usually knows where I want to make my edit so instead of the lighter cognitive load I prefer to get there in a more accurate manner. That aside there is definitely something that can be said about the opposite of that as well. A "section" is quite an abstract concept as well and I agree that currently neither I'm marking it as a feature request, not sure when I'll have the time or energy to implement it yet but I'll try to do this within reasonable time. 👍 |
Hi again @m-fonseca, I've implemented the feature you requested, if you update to the latest version everything should be working. It supports both I'll close this as well, cheers for the feedback 👍 |
Just tried it out, works great! Thanks so much for this addition! |
Hello again!
The operators ]] & [[ are specifically made for jumping to the next and previous "sections". It would be nice to support this since every markdown heading is a distinct section. Right now ]] & [[ go to the bottom and top of the file respectively. I think I originally saw this in the pandoc vim plugin. Useful for getting around quickly through a large doc.
Thanks!
The text was updated successfully, but these errors were encountered: