[Vimprobable-users] suggested changes to implement zoom commands
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
|
From: Marcos C. <vim...@pr...> - 2013-05-02 14:13:54
|
Hi all,
I miss Vimprobable's windows to open with a certain zoom level, because
usually I need a bigger font size. Keymaps let zoom in and out, and it's
possible to choose an alternative CSS too, but I miss a simpler
solution: zoom commands I could add to the config file (and beside, they
would let to config new keymaps for zooming, currently hardcoded).
I've been tinkering with the code in order to understand how it works
and to make the desired changes -- and it worked. My C experience is
basic, so please check if I'm missing or breaking something, though the
changes are very simple:
In vimprobable.h, I increased COMMANDSIZE from 43 to 47:
----8<----------------------------------------------------------
#define COMMANDSIZE 47
----8<----------------------------------------------------------
In config.h, I added four new elements to the command mapping:
----8<----------------------------------------------------------
{ "scrolldown",scroll,{ScrollMove|DirectionBottom|UnitLine}},
{ "zoomin", zoom,{ZoomIn | ZoomText} },
{ "zoomout",zoom,{ZoomOut | ZoomText} },
{ "zi",zoom,{ZoomIn | ZoomText} },
{ "zo",zoom,{ZoomOut | ZoomText} }
----8<----------------------------------------------------------
Finally, I simply added as many commands as needed to my vimprobablerc
file:
----8<----------------------------------------------------------
zoomin
zoomin
zoomin
zoomin
----8<----------------------------------------------------------
I didn't investigated yet how to create a command to set the zoom level
to a certain value, say "zoom 120", but maybe I will.
Do you find these commands useful enough to be included in a future
version?
Marcos
--
http://programandala.net
|