commit 85060f3883cf6bf38efbd90e181264f48ea93c23
parent 7791ad412eec592e1be121909f374f4403474e97
Author: Alex Balgavy <alex@balgavy.eu>
Date: Thu, 8 Sep 2022 23:37:06 +0200
w3m: fix opening images
Diffstat:
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/mailcap b/mailcap
@@ -13,6 +13,6 @@ application/pgp-signature; LESS="-Ric" less
application/pdf; setsid -f /Applications/sioyek.app/Contents/MacOS/sioyek %s
# Use the `opener` script for everything else
-image; setsid -f opener %s >/dev/null 2>&1
-video; setsid -f opener %s >/dev/null 2>&1
-application; setsid -f opener %s >/dev/null 2>&1
+image/*; setsid -f opener %s >/dev/null 2>&1
+video/*; setsid -f opener %s >/dev/null 2>&1
+application/*; setsid -f opener %s >/dev/null 2>&1
diff --git a/scripts/linkhandler b/scripts/linkhandler
@@ -1,8 +1,8 @@
#!/usr/bin/env perl
# vim: foldmethod=marker
-use 5.006;
use strict;
use warnings;
+use 5.006; # checked with `perlver`
use constant EXIT_USER_CANCELLED => 130;
diff --git a/scripts/opener b/scripts/opener
@@ -7,7 +7,7 @@ case "$1" in
*)
case $(file --mime-type "$1" -bL) in
text/*|application/json|inode/x-empty) { [ -n "$VIM_TERMINAL" ] && vimsend "$1"; } || ${EDITOR:-vim} "$1";;
- image/*) setsid -f nsxiv -a "$@" 2>&1;;
+ image/*) setsid -f sxiv -a "$@" 2>&1;;
application/epub*) setsid -f ebook-viewer "$1" >/dev/null 2>&1;;
application/pdf*) setsid -f /Applications/sioyek.app/Contents/MacOS/sioyek "$1" >/dev/null 2>&1;;
application/x-sc|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) sc-im "$1";;
diff --git a/w3m/keymap b/w3m/keymap
@@ -13,6 +13,9 @@ keymap w NEXT_WORD
keymap b PREV_WORD
keymap G END
+keymap C-m GOTO_LINK
+keymap M-i VIEW_IMAGE
+
# Scrolling
keymap C-e UP
keymap C-y DOWN
@@ -81,6 +84,10 @@ keymap ft COMMAND 'SET_OPTION display_link_number=0; RESHAPE; TAB_LINK'
keymap fo COMMAND 'SET_OPTION display_link_number=0; RESHAPE; LINK_BEGIN; GOTO_LINK'
keymap fn COMMAND 'SET_OPTION display_link_number=0; RESHAPE; LINK_BEGIN; TAB_LINK'
+keymap m MARK
+keymap } NEXT_MARK
+keymap { PREV_MARK
+keymap \" REG_MARK
# ABORT Quit at once
# ACCESSKEY Pop up accesskey menu
# ALARM Set alarm