mihaifm/bufstop

Enhancement: Enable Up/Down arrow keys to open the document without having to hitting enter

Closed this issue · 4 comments

It would be a great UI enhancement for people used to arrow keys to directly open the document without having to press <CR> (perhaps even circle back from one end to another). Ideally usual j, k keys would just move the cursor up/down the list without actually opening the file. This will give users an option to quickly navigate to preview files with just one key stroke per file (all the while holding just one key), instead of pressing 2 key stroke per file j/k followed by <CR> or pressing different keys 1/2/3/4... (which doesn't scale with many buffers open).

Thanks!

That's a great idea! I'll see if it's possible to make it work.

I uploaded a new version with this feature. There is also a zip archive in the Releases now.
The change consists of a new command :BufstopPreview which you can map to your liking. I'm using:

map <leader>w :BufstopPreview<CR>

Thanks for suggesting this, it's brilliant! I've added it my .vimrc and will probably use it in my workflow. It's a powerful feature, not sure why I haven't thought of it before :)

Try it out and let me know if you find any issues.

@mihaifm Thanks, it worked! Btw there is one more good reason to have the exit key mapped to something different than escape (like tab): I have mouse scroll enabled, so I can now use up/down key to preview any buffer, and place the mouse cursor above the buffer I am previewing to browse up and down. It works without having to focus that window, so I can still switch to previewing another file and its always just one click away. This doesn't work with the default Bufstop window exit mapped to escape as mouse scroll generates escaped sequences that then end up putting the existing buffer in insert mode, and polluting its contents. Just FYI

Thanks, that's a nice tip