## W3M

# == EXTERNAL PROGRAMS ==
# yank to clipboard
keymap  yx      EXTERN_LINK   '(printf %s "$0" | pbcopy)'
keymap  YX      EXTERN        '(printf %s | pbcopy)'
# yank url to tmux clipboard
keymap  yy      EXTERN_LINK   'tmux set-buffer'
keymap  YY      EXTERN        'tmux set-buffer'

# open in GUI
keymap  xw      EXTERN_LINK   '$BROWSER'
keymap  XW      EXTERN        '$BROWSER'

# download
keymap  xd      EXTERN_LINK   'diana add'
keymap  XD      EXTERN_LINK   'diana --pause add'
keymap  xD      SHELL         'diana-mui'

# add torrent
keymap  xt      EXTERN_LINK   'transmission-remote --add'

# save bookmark
keymap  xa      COMMAND       "SHELL ~/.w3m/cgi-bin/save_bookmark_surfraw.cgi"

# fzf buku
keymap  xu      COMMAND       "SHELL ~/.w3m/cgi-bin/fzf_buku.cgi..."

# == INTERNAL ==
keymap  xe  EDIT_SCREEN

h, j, k, l = Move the screen as a pager.
Arrow keys = Move cursor
w, b = Move the cursor a word each time (forward, backward)
0, C-a = Move the cursor to the fist column
$, C-e = Move the cursor to the last column
t, C-t = Open new foreground tab in duckduckgo.com/lite
yt = Duplicate current tab
d, C-w = Close current tab and save it to restore it
u, C-T = Restore last closed tab
yy = Copy current page url to clipboard
yf = Copy url under cursor to clipboard
p = Paste and search url in clipboard in current page
P = Paste and search url in clipboard in new foreground tab
q = Quit w3m with confirmation
ZZ = Quit w3m without confirmation
o, C-l = Focus on address bar, open in current tab
O = Focus on address bar open in new foreground tab
M-o = Open current link with external browser
M-p = Open link under cursor with external browser
f, enter = Open url under cursor in current tab
F = Open url under cursor in new foreground tab
gg = Move cursor to the first line
G = Move the cursor to the last line
J = Change focus to left tab
gJ = Move tab to the right
K = Change focus to right tab
gK = Move tab to the left
H = Go back in history
L = Go forward in history
{, } = Move between links
/ = Enter find mode (It accepts regexp)
n = Find next
N = Find previous
* = OPTIONS
+ = HELP
M-r = Reload keymap configuration
C-o = Load local file
C-u = See source code of the page