Add urlscan as alternative to urlview

Since urlview is not available with pacman but urlscan is, first check
and integrate urlscan then fallback to urlview.
This commit is contained in:
Kenneth Benzie 2019-09-17 22:13:02 +01:00
parent cabd57ae84
commit 20be7f3bcc
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@
- pacman:
- tmux
- xclip
- urlscan
- symlink:
- {src: tmux.conf, dst: ~/.tmux.conf}
- {src: layouts/session-main, dst: ~/.local/share/tmux/layouts/session-main}

View File

@ -69,8 +69,10 @@ bind -n C-k if $in_vim 'send-keys C-k' 'select-pane -U'
bind -n C-l if $in_vim 'send-keys C-l' 'select-pane -R'
bind -n C-\ if $in_vim 'send-keys C-\\' 'select-pane -l'
# Integrate urlview
bind u capture-pane \; split-window 'tmux show-buffer | urlview -'
# Integrate urlscan or fallback to urlview
if -b 'which urlscan' \
'bind u capture-pane \; split-window "tmux show-buffer | urlscan"' \
'bind u capture-pane \; split-window "tmux show-buffer | urlview -"'
# Unbind copy mode defaults so pane selection works
unbind -T copy-mode-vi C-h