fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.34k stars 99 forks source link

Replicate default `O` normal mapping to custom normal mapping #670

Closed wizhi closed 3 years ago

wizhi commented 3 years ago

I can't seem to find any documentation on available variables for the :open command.

Basically, I wish to end up with the following normal mappings:

nunmap O
nnoremap O :tabopen<Space>
nnoremap go :open $VIMB_URI
nnoremap gO :tabopen $VIMB_URI

The documentation doesn't mention anything like this, and I can't quite grok the C source code, so maybe this simply isn't possible.

fanglingsu commented 3 years ago

@Wizhi I'm note sure if I got your point. But I assume you want the $VIMB_URI to be expanded to the current URL when you use go or gO. But you could use the register for the current url which ist stored at "% which can be accessed in command mode by CTRL-R %.

:nnoremap go :open <C-R>%
wizhi commented 3 years ago

Sorry I probably didn't explain it very well. :)

That's exactly what I needed though - thanks a bunch. I suppose I need to read the manual again.

Also, thanks a bunch for creating vimb, it's great. :+1: