Saturday, April 2, 2016

Re: Using gx with text-only browser

On Friday, April 1, 2016 at 8:44:50 PM UTC+13, Peter King wrote:
> I usually use nvim at the console and would like to set gx to open a URL
> under the cursor with /usr/bin/links... All that happens, though, is that
> the console screen blinks while the lookup silently fails.

Netrw is redirecting standard input and output to /dev/null, to avoid browser messages; this directly clobbers links' IO. It's running, you just can't see it or type anything into it.

As a workaround, create a script called, say, vimlinks, in your $PATH with the following:

#!/bin/bash
links </dev/tty >/dev/tty 2>/dev/tty "$@"

chmod +x it:

chmod +x vimlinks

then in vim use

let netrw_browsex_viewer = "vimlinks"

Regards, John Little

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment