jasonwryan.com

Miscellaneous ephemera…

Using Vimprobable

image

I posted last year about Vimprobable a webkit browser that uses Vim-like keybinds and can be run completely without the rodent.

Over the last couple of months I have become increasingly comfortable with it, and with the addition of some great recent functionality, it has become my default browser.

The project has good documentation, in the form of two man pages: vimprobable and vimprobablerc, but I thought I’d share some of my customizations and working methods.

Copy & Paste

The only time I have been tempted to take my hand off the keyboard was to insert the cursor at the correct character to begin a selection to copy and paste. This is unnecessary. With the right options in $XDG_CONFIG_HOME/vimprobable/vimprobablerc, you can do it all from the keyboard.

Map the keys you would like to use to enter and exit caret mode. I use Ctrlc to enter and Shiftc to return to normal mode:

1
2
map <C-c>=:set caret=true
map <S-c>=:set caret=false

Then, it is just a matter of identifying the text that you wish to copy (in the photo above I was copying a script to launch tabbed), and highlighting it via search. So the sequence is:

1.  / - to enter search mode
2.  #! Enter - the shebang and then enter to highlight the correct
    sequence
3.  Ctrlc to enter caret mode
4.  and then ShiftUp or ShiftDown to highlight the following or
    preceding lines
5.  yanking the selected text is Shifty, and the text is now stored in
    your clipboard.

Opening new instances in tabbed

I highlighted the section on tabbed from the Vimprobable site for a reason. The second tip is how to set up tabbed to work well with other applications.

By default, any new windows (ie., instances of Vimprobable) opened from within Vimprobable are “caught”—and managed— by tabbed. However, if you open a link from, say newsbeuter or Tyrs, this will open an instance outside tabbed which, if you are using a tiling window manager like dwm, means this window gets pushed to master in your stack. This is not entirely satisfactory.

Thanks to Connor Lane Smith on the suckless ML, I have a solution to have all new instances of Vimprobable sent to tabbed, whether opened in another application, or if I click on a link in my terminal, Urxvtc.

CLS’s solution is elegantly simple. Launch tabbed with an .xid file in /tmp:

1
"$(tabbed -d >/tmp/tabbed.xid); vimprobable2 -e $(</tmp/tabbed.xid)"

Then it is just a matter of setting up other applications to pass links to the tabbed tmp file. For example, in my $XDG_CONFIG_HOME/tyrs/tyrs.cfg, I have:

1
openurl_command = vimprobable2 -e $(</tmp/tabbed.xid) %s

The workaround for Urxvtc was a little trickier. I finally got there with some help from Riccardo Murri on Unix & Linux SE. In my ~/.Xdefaults I have:

1
2
3
4
! -- Clickable urls -- !
URxvt.perl-ext-common: default,matcher
URxvt.urlLauncher: /home/jason/Scripts/vimprobtab.sh
URxvt.matcher.button: 1

…and the wrapper script vimprobtab.sh looks like this:

1
2
3
#!/bin/bash
# Script to open Vimprobable instances in tabbed
exec vimprobable2 -e $(</tmp/tabbed.xid) "$1"

Now whenever I open a link in an application or by clicking a link in the terminal (in irssi, for example) it is passed to Vimprobable in tabbed.

Comments