tyru/open-browser.vim

After visual map executes, it doesn't stay in visual mode

grr opened this issue · 5 comments

grr commented

I'm using the default maps as documented. After selecting text in visual mode and using the map, the mode is changed to normal mode. It should stay in visual mode.

Also, can you allow an easier way to silence the plugin messages? Currently the only way to do so is using an obscure syntax:

nnoremap <silent> gx :silent execute "normal \<Plug>(openbrowser-open)"<CR>
vnoremap <silent> gx :<C-u>silent execute "normal \<Plug>(openbrowser-open)"<CR>

If not, can you at least document those mappings. Thanks.

tyru commented

can you allow an easier way to silence the plugin messages?

Try

let g:openbrowser_format_message = ''

See this:

If the value is empty string,
openbrowser does not output any message when opening URL.

It should stay in visual mode.

Hmm, I can't imagine such use case why it should stay in visual mode.
I think it's enough to use gv mapping, isn't it?

vmap gx <Plug>(openbrowser-open)gv
grr commented

let g:openbrowser_format_message = ''

That only silences the Opening url message. But if you get the error message "URL of file path is not found under cursor!", even after successfully opening a url afterwards the error stays. I want to silence those errors also.

tyru commented

Currently there are no ways to silence error messages.
Could you checkout #95 branch and let g:openbrowser_message_verbosity = 0?

grr commented

That new flag is perfect. Tested and no problems.

tyru commented

@grr Thanks for testing! merged the branch.