aboutsummaryrefslogtreecommitdiffstats
path: root/.w3m
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
committerterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
commit6e528248414e330c9e25e81596ab47b8b8a5b701 (patch)
treee1aa41a7f3198eeac187e6177ec7d4a33db229d3 /.w3m
downloadscripts-6e528248414e330c9e25e81596ab47b8b8a5b701.tar.gz
scripts-6e528248414e330c9e25e81596ab47b8b8a5b701.zip
first commitmaster
Diffstat (limited to '.w3m')
-rw-r--r--.w3m/build.sh5
-rwxr-xr-x.w3m/cgi-bin/fzf_surfraw.cgi6
-rwxr-xr-x.w3m/cgi-bin/fzf_surfraw_tmux.cgi41
-rwxr-xr-x.w3m/cgi-bin/goto_clipboard.cgi25
-rwxr-xr-x.w3m/cgi-bin/goto_clipboard_primary.cgi28
-rwxr-xr-x.w3m/cgi-bin/goto_tmux_clipboard.cgi28
-rwxr-xr-x.w3m/cgi-bin/restore_session.cgi49
-rwxr-xr-x.w3m/cgi-bin/restore_tab.cgi10
-rw-r--r--.w3m/config155
-rw-r--r--.w3m/keymap132
10 files changed, 479 insertions, 0 deletions
diff --git a/.w3m/build.sh b/.w3m/build.sh
new file mode 100644
index 0000000..5b68f06
--- /dev/null
+++ b/.w3m/build.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -x
+set -e
+
+cd ~ && git clone https://github.com/tats/w3m && cd w3m && ./configure --with-ssl && sudo make install -j4
diff --git a/.w3m/cgi-bin/fzf_surfraw.cgi b/.w3m/cgi-bin/fzf_surfraw.cgi
new file mode 100755
index 0000000..de297c1
--- /dev/null
+++ b/.w3m/cgi-bin/fzf_surfraw.cgi
@@ -0,0 +1,6 @@
+#!/usr/bin/env sh
+
+PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOVAL'| fzf --algo=v2 -e | awk '{print $1}')
+if [ "$PREFIX" = "" ]; then exit;fi
+read -r -e -p " $PREFIX >>> Enter The Search Keyword: " INPUT
+surfraw -p "$PREFIX" "$INPUT" | xsel -p
diff --git a/.w3m/cgi-bin/fzf_surfraw_tmux.cgi b/.w3m/cgi-bin/fzf_surfraw_tmux.cgi
new file mode 100755
index 0000000..11516fd
--- /dev/null
+++ b/.w3m/cgi-bin/fzf_surfraw_tmux.cgi
@@ -0,0 +1,41 @@
+#!/usr/bin/env sh
+### _ _ _ _
+### __ _ ___ | |_| |__ | | ___| |_ _ _
+### / _` |/ _ \| __| '_ \| |/ _ \ __| | | |
+###| (_| | (_) | |_| |_) | | __/ |_| |_| |
+### \__, |\___/ \__|_.__/|_|\___|\__|\__,_|
+### |___/
+### https://www.youtube.com/user/gotbletu
+### https://lbry.tv/@gotbletu
+### https://twitter.com/gotbletu
+### https://github.com/gotbletu
+### gotbletu@gmail.com
+###
+### Author : gotbletu
+### Name : fzf_surfraw_tmux.cgi
+### Version : 0.2
+### Date : 2020-04-27
+### Description : interactive surfraw smart prefix search engine (mainly use within w3m web browser)
+### Depends On : surfraw fzf tmux gawk coreutils grep procps-ng
+### Video Demo : https://youtu.be/p5NZb8f8AHA
+### References : https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
+
+### Setup
+# vim ~/.w3m/keymap
+# keymap xs COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw_tmux.cgi ; GOTO /usr/lib/w3m/cgi-bin/goto_tmux_clipboard.cgi"
+# keymap XS COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw_tmux.cgi ; TAB_GOTO /usr/lib/w3m/cgi-bin/goto_tmux_clipboard.cgi"
+
+clear
+
+# select your elvi
+PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOBAL'| fzf -e | awk '{print $1}')
+
+# exit script if no elvi is selected (e.g hit ESC)
+if [ "$PREFIX" = "" ]; then exit; fi
+
+# get user input
+read -r -e -p " $PREFIX >> Enter Your Search Keyword: " INPUT
+
+# print proper url and copy to primary clipboard (aka highlighted clipboard) and tmux clipboard
+# surfraw -p "$PREFIX" "$INPUT" | xsel -p
+pidof tmux >/dev/null && tmux set-buffer "$(surfraw -p "$PREFIX" "$INPUT")"
diff --git a/.w3m/cgi-bin/goto_clipboard.cgi b/.w3m/cgi-bin/goto_clipboard.cgi
new file mode 100755
index 0000000..34eaa63
--- /dev/null
+++ b/.w3m/cgi-bin/goto_clipboard.cgi
@@ -0,0 +1,25 @@
+#!/usr/bin/env sh
+### __ _ _
+### / _| ___| (_)_ __ ___ ___ __ _ __ _
+###| |_ / _ \ | | '_ \ / _ \/ __|/ _` |/ _` |
+###| _| __/ | | |_) | __/\__ \ (_| | (_| |
+###|_| \___|_|_| .__/ \___||___/\__,_|\__,_|
+### |_|
+### https://github.com/felipesaa
+###
+### Author : felipesaa
+### Name : goto_clipboard.cgi
+### Version : 0.1
+### Date : 2018-09-30
+### Description : paste and go feature for w3m web browser using system clipboard (aka ctrl+v)
+### Depends On : w3m xsel
+### Video Demo : https://youtu.be/p5NZb8f8AHA
+### Source : https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
+### Install : put this script in /usr/lib/w3m/cgi-bin/
+
+#GOTO url in clipboard in current page. If the clipboard has a
+#"non url string/nothing" an blank page is shown.
+printf "%s\r\n" "W3m-control: GOTO $(xsel -ob)";
+#delete the buffer (element in history) created between the current page and
+#the searched page by calling this script.
+printf "W3m-control: DELETE_PREVBUF\r\n"
diff --git a/.w3m/cgi-bin/goto_clipboard_primary.cgi b/.w3m/cgi-bin/goto_clipboard_primary.cgi
new file mode 100755
index 0000000..a9b208e
--- /dev/null
+++ b/.w3m/cgi-bin/goto_clipboard_primary.cgi
@@ -0,0 +1,28 @@
+#!/usr/bin/env sh
+### _ _ _ _
+### __ _ ___ | |_| |__ | | ___| |_ _ _
+### / _` |/ _ \| __| '_ \| |/ _ \ __| | | |
+###| (_| | (_) | |_| |_) | | __/ |_| |_| |
+### \__, |\___/ \__|_.__/|_|\___|\__|\__,_|
+### |___/
+### https://www.youtube.com/user/gotbletu
+### https://twitter.com/gotbletu
+### https://github.com/gotbletu
+### gotbletu@gmail.com
+###
+### Author : gotbletu
+### Name : goto_clipboard_primary.cgi
+### Version : 0.1
+### Date : 2020-04-26
+### Description : paste and go feature for w3m web browser using system clipboard (primary aka shift+insert)
+### Depends On : w3m xsel
+### Video Demo : https://youtu.be/p5NZb8f8AHA
+### References : https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
+### Install : put this script in /usr/lib/w3m/cgi-bin/
+
+#GOTO url in clipboard in current page. If the clipboard has a
+#"non url string/nothing" an blank page is shown.
+printf "%s\r\n" "W3m-control: GOTO $(xsel -op)";
+#delete the buffer (element in history) created between the current page and
+#the searched page by calling this script.
+printf "W3m-control: DELETE_PREVBUF\r\n"
diff --git a/.w3m/cgi-bin/goto_tmux_clipboard.cgi b/.w3m/cgi-bin/goto_tmux_clipboard.cgi
new file mode 100755
index 0000000..fe91b57
--- /dev/null
+++ b/.w3m/cgi-bin/goto_tmux_clipboard.cgi
@@ -0,0 +1,28 @@
+#!/usr/bin/env sh
+### _ _ _ _
+### __ _ ___ | |_| |__ | | ___| |_ _ _
+### / _` |/ _ \| __| '_ \| |/ _ \ __| | | |
+###| (_| | (_) | |_| |_) | | __/ |_| |_| |
+### \__, |\___/ \__|_.__/|_|\___|\__|\__,_|
+### |___/
+### https://www.youtube.com/user/gotbletu
+### https://twitter.com/gotbletu
+### https://github.com/gotbletu
+### gotbletu@gmail.com
+###
+### Author : gotbletu
+### Name : goto_tmux_clipboard.cgi
+### Version : 0.1
+### Date : 2020-04-26
+### Description : paste and go feature for w3m web browser using tmux clipboard
+### Depends On : w3m tmux
+### Video Demo : https://youtu.be/p5NZb8f8AHA
+### References : https://github.com/felipesaa/A-vim-like-firefox-like-configuration-for-w3m
+### Install : put this script in /usr/lib/w3m/cgi-bin/
+
+#GOTO url in clipboard in current page. If the clipboard has a
+#"non url string/nothing" an blank page is shown.
+printf "%s\r\n" "W3m-control: GOTO $(tmux paste-buffer)";
+#delete the buffer (element in history) created between the current page and
+#the searched page by calling this script.
+printf "W3m-control: DELETE_PREVBUF\r\n"
diff --git a/.w3m/cgi-bin/restore_session.cgi b/.w3m/cgi-bin/restore_session.cgi
new file mode 100755
index 0000000..aa0ba41
--- /dev/null
+++ b/.w3m/cgi-bin/restore_session.cgi
@@ -0,0 +1,49 @@
+#!/usr/bin/env sh
+# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry)
+# https://www.youtube.com/user/gotbletu
+# DESC: generate a script for your last w3m session then you can run script to restore all urls in new tabs
+# DEMO: https://youtu.be/qYhNJ3itqWw
+# DEPEND: coreutils gawk
+# CLOG: 2021-04-17 first draft, no option to jump to tab 1 at the moment
+# REQD: 1. Allow executable permissions and put script in ~/.w3m/cgi-bin/restore_session.cgi
+#
+# 2. Add binding to ~/.w3m/keymap
+#
+# ############################ Quit with confirmation request (QUIT)
+# keymap :q QUIT
+# keymap ZZ QUIT
+# ############################ Quit at once (EXIT)
+# keymap ZQ EXIT
+# ############################ Quit at once and save session
+# keymap Q COMMAND "EXTERN 'echo %s > ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; READ_SHELL ~/.w3m/cgi-bin/restore_session.cgi ; EXIT"
+#
+# 3. Add to ~/.bashrc or ~/.zshrc $PATH variable
+# [ -d "$HOME/.w3m/bin" ] && PATH="$HOME/.w3m/bin:$PATH"
+#
+# 4. To load w3m with the last session
+# $ w3mlastsession
+
+## ---------------------------------------------
+mkdir -p "$HOME/.w3m/bin"
+# location of generated script of last session
+RESTORE_SESSSION="$HOME/.w3m/bin/w3mlastsession"
+# add shell header
+echo "#!/usr/bin/env sh" > "$RESTORE_SESSSION"
+echo "torsocks w3m -graph \\" >> "$RESTORE_SESSSION"
+# remove dupes without sorting, add -N flag at beginning and append trailing slash to each url
+awk '!x[$0]++' "$HOME/.w3m/RestoreSession.txt" | while read -r line ; do echo "-N '$line' \\" >> "$RESTORE_SESSSION" ; done
+echo "2>/dev/null" >> "$RESTORE_SESSSION"
+chmod +x "$RESTORE_SESSSION"
+
+## OUTPUT SCRIPT FILE EXAMPLE ~/.w3m/bin/w3mlastsession
+## --------------------------------------------------
+## #!/usr/bin/env sh
+## w3m \
+## -N 'https://www.reddit.com/r/w3m/.mobile' \
+## -N 'https://www.reddit.com/r/commandline/.mobile' \
+## -N 'https://www.reddit.com/r/linux/.mobile' \
+## -N 'http://lite.cnn.com/en' \
+## -N 'https://raw.githubusercontent.com/tats/w3m/master/ChangeLog' \
+## -N 'https://github.com/gotbletu/shownotes' \
+## 2>/dev/null
+## --------------------------------------------------
diff --git a/.w3m/cgi-bin/restore_tab.cgi b/.w3m/cgi-bin/restore_tab.cgi
new file mode 100755
index 0000000..27b3316
--- /dev/null
+++ b/.w3m/cgi-bin/restore_tab.cgi
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+TAB_RESTORE_LIMIT=30
+
+last_tab=$(tail -n 1 ~/.w3m/RestoreTab.txt);
+limit=$(tail -n $TAB_RESTORE_LIMIT ~/.w3m/RestoreTab.txt)
+other_tabs=$(printf "%s" "$limit" | head -n -1);
+printf "%s\r\n" "$other_tabs" > ~/.w3m/RestoreTab.txt;
+printf "%s\r\n" "W3m-control: GOTO $last_tab";
+printf "W3m-control: DELETE PREVBUF\r\n";
diff --git a/.w3m/config b/.w3m/config
new file mode 100644
index 0000000..eb09d3c
--- /dev/null
+++ b/.w3m/config
@@ -0,0 +1,155 @@
+tabstop 8
+indent_incr 4
+pixel_per_char 9
+pixel_per_line 19
+frame 0
+target_self 0
+open_tab_blank 0
+open_tab_dl_list 0
+display_link 1
+display_link_number 1
+decode_url 0
+display_lineinfo 1
+ext_dirlist 1
+dirlist_cmd file:///$LIB/dirlist.cgi
+use_dictcommand 1
+dictcommand file:///$LIB/w3mdict.cgi
+multicol 0
+alt_entity 0
+graphic_char 1
+display_borders 1
+fold_textarea 0
+display_ins_del 1
+ignore_null_img_alt 1
+view_unseenobject 1
+display_image 1
+pseudo_inlines 1
+auto_image 1
+max_load_image 4
+ext_image_viewer 0
+image_scale 100
+imgdisplay /usr/libexec/w3m/w3mimgdisplay
+image_map_list 0
+fold_line 0
+show_lnum 1
+show_srch_str 1
+label_topline 0
+nextpage_topline 0
+color 1
+basic_color terminal
+anchor_color blue
+image_color green
+form_color red
+mark_color cyan
+bg_color terminal
+active_style 1
+active_color cyan
+visited_anchor 1
+visited_color magenta
+pagerline 10000
+use_history 1
+history 100
+save_hist 1
+confirm_qq 1
+close_tab_back 0
+mark 0
+emacs_like_lineedit 0
+space_autocomplete 0
+vi_prec_num 0
+mark_all_pages 0
+wrap_search 0
+ignorecase_search 1
+use_mouse 1
+reverse_mouse 0
+relative_wheel_scroll 0
+relative_wheel_scroll_ratio 30
+fixed_wheel_scroll_count 5
+clear_buffer 1
+decode_cte 0
+auto_uncompress 0
+preserve_timestamp 1
+keymap_file keymap
+document_root
+personal_document_root
+cgi_bin /usr/local/libexec/w3m/cgi-bin
+index_file
+mime_types ~/.w3m/mime.types, /etc/mime.types
+mailcap ~/.w3m/mailcap, /etc/w3m/mailcap, /etc/mailcap
+urimethodmap ~/.w3m/urimethodmap, /etc/w3m/urimethodmap
+editor /bin/vi
+mailto_options 1
+mailer gnome-open mailto:%s
+extbrowser gnome-open
+extbrowser2
+extbrowser3
+extbrowser4
+extbrowser5
+extbrowser6
+extbrowser7
+extbrowser8
+extbrowser9
+bgextviewer 1
+use_lessopen 0
+passwd_file ~/.w3m/passwd
+disable_secret_security_check 0
+ftppasswd
+ftppass_hostnamegen 0
+pre_form_file ~/.w3m/pre_form
+siteconf_file ~/.w3m/siteconf
+user_agent
+no_referer 0
+accept_language en;q=1.0
+accept_encoding gzip, compress, bzip, bzip2, deflate
+accept_media text/html, text/*;q=0.5, image/*, audio/*, application/*
+argv_is_url 1
+retry_http 1
+default_url 1
+follow_redirection 10
+meta_refresh 1
+dns_order 0
+nntpserver
+nntpmode
+max_news 50
+use_proxy 1
+http_proxy
+https_proxy
+ftp_proxy
+no_proxy
+noproxy_netaddr 0
+no_cache 0
+ssl_forbid_method
+ssl_verify_server 1
+ssl_cert_file
+ssl_key_file
+ssl_ca_path /etc/pki/tls/certs/
+ssl_ca_file
+use_cookie 1
+show_cookie 0
+accept_cookie 1
+accept_bad_cookie 0
+cookie_reject_domains
+cookie_accept_domains
+cookie_avoid_wrong_number_of_dots
+display_charset UTF-8
+document_charset UTF-8
+auto_detect 2
+system_charset UTF-8
+follow_locale 1
+ext_halfdump 0
+use_wide 1
+use_combining 1
+east_asian_width 0
+use_language_tag 1
+ucs_conv 1
+pre_conv 0
+search_conv 1
+fix_width_conv 1
+use_gb12345_map 0
+use_jisx0201 0
+use_jisc6226 0
+use_jisx0201k 0
+use_jisx0212 0
+use_jisx0213 0
+strict_iso2022 1
+gb18030_as_ucs 0
+simple_preserve_space 0
diff --git a/.w3m/keymap b/.w3m/keymap
new file mode 100644
index 0000000..c78c782
--- /dev/null
+++ b/.w3m/keymap
@@ -0,0 +1,132 @@
+# A sample of ~/.w3m/keymap (default)
+#
+# Ctrl : C-, ^
+# Escape: ESC-, M-, ^[
+# Space : SPC, ' '
+# Tab : TAB, ^i, ^I
+# Delete: DEL, ^?
+# Up : UP, ^[[A
+# Down : DOWN, ^[[B
+# Right : RIGHT, ^[[C
+# Left : LEFT, ^[[D
+
+# Page/Cursor motion
+keymap C-f NEXT_PAGE
+keymap C-b PREV_PAGE
+keymap l MOVE_RIGHT
+keymap h MOVE_LEFT
+keymap j MOVE_DOWN
+keymap k MOVE_UP
+keymap < SHIFT_LEFT
+keymap > SHIFT_RIGHT
+keymap 0 LINE_BEGIN
+keymap $ LINE_END
+keymap Z CENTER_H
+keymap zz CENTER_V
+keymap gg GOTO_LINE
+keymap gg BEGIN
+keymap G END
+keymap w NEXT_WORD
+keymap b PREV_WORD
+keymap TAB NEXT_LINK
+keymap ESC-TAB PREV_LINK
+keymap u UNDO
+keymap C-r REDO
+keymap :L LIST_MENU
+
+# Hyperlink operation
+keymap M MARK_WORD
+# keymap M MARK_URL
+keymap C-t TAB_LINK
+keymap C-s SAVE_LINK
+keymap V VIEW_IMAGE
+# keymap V PEEK_IMG
+keymap i INFO
+
+keymap ESC-i SAVE_IMAGE
+keymap p PEEK_LINK
+keymap C-g LINE_INFO
+keymap O EXTERN_LINK
+
+# File/Stream operation
+keymap o GOTO
+keymap O TAB_GOTO
+keymap @ READ_SHELL
+keymap # PIPE_SHELL
+keymap | PIPE_BUF
+
+# Buffer operation
+keymap B BACK
+keymap L NEXT
+keymap H PREV
+keymap S SELECT_MENU
+keymap ESC-s SAVE
+keymap v VIEW
+keymap P PRINT
+keymap E EDIT
+keymap ESC-e EDIT_SCREEN
+keymap r RELOAD
+keymap ESC-r RESHAPE
+
+# Tab operation
+keymap C-p PREV_TAB
+keymap C-n NEXT_TAB
+keymap t NEW_TAB
+keymap T TAB_MENU
+keymap d CLOSE_TAB
+
+keymap ESC-b VIEW_BOOKMARK
+keymap ESC-a ADD_BOOKMARK
+
+# Search
+keymap / ISEARCH
+keymap ? ISEARCH_BACK
+keymap n SEARCH_NEXT
+keymap N SEARCH_PREV
+
+# Dictionay look-up
+keymap ESC-w DICT_WORD
+keymap ESC-W DICT_WORD_AT
+
+# Mark operation
+keymap m MARK
+keymap ] NEXT_MARK
+keymap [ PREV_MARK
+keymap \" REG_MARK
+
+# bookmark operation
+keymap ESC-b VIEW_BOOKMARK
+keymap ESC-a ADD_BOOKMARK
+
+# Misc operation
+keymap \\ MENU
+keymap :H HELP
+keymap :O OPTIONS
+keymap ESC-k COOKIE
+keymap ESC-h HISTORY
+keymap ESC-c COMMAND
+keymap ! EXEC_SHELL
+keymap ESC-z INTERRUPT
+keymap C CHARSET
+
+keymap :q EXIT
+keymap Q COMMAND "EXTERN 'echo %s > ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; NEXT_TAB ; EXTERN 'echo %s >> ~/.w3m/RestoreSession.txt' ; READ_SHELL ~/.w3m/cgi-bin/restore_session.cgi ; EXIT"
+
+# external stuff
+keymap SPC-r COMMAND "SHELL 'readable $W3M_URL -p html-title,html-content > /tmp/readable.html'; LOAD /tmp/readable.html"
+keymap xt COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw_tmux.cgi ; GOTO /usr/local/libexec/w3m/cgi-bin/goto_tmux_clipboard.cgi"
+keymap XT COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw_tmux.cgi ; TAB_GOTO /usr/local/libexec/w3m/cgi-bin/goto_tmux_clipboard.cgi"
+# keymap xs COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw.cgi ; GOTO /usr/local/libexec/w3m/cgi-bin/goto_clipboard.cgi"
+keymap xs COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw.cgi ; GOTO /usr/local/libexec/w3m/cgi-bin/goto_clipboard_primary.cgi"
+keymap XS COMMAND "SHELL ~/.w3m/cgi-bin/fzf_surfraw.cgi ; TAB_GOTO /usr/local/libexec/w3m/cgi-bin/goto_clipboard_primary.cgi"
+# keymap XS COMMAND "SHELL /home/bloodstalker/scripts/bin/fzf_surfraw ; TAB_GOTO /home/bloodstalker/scripts/bin/goto_clipboard.cgi"
+# keymap xs COMMAND "SHELL /home/bloodstalker/scripts/bin/fzf_surfraw"
+keymap go COMMAND "SHELL /usr/local/libexec/w3m/cgi-bin/goto_clipboard.cgi"
+# keymap XS COMMAND "SHELL /home/bloodstalker/scripts/bin/fzf_surfraw; TAB_GOTO /home/bloodstalker/scripts/bin/goto_clipboard.cgi"
+#
+keymap d COMMAND "EXTERN 'echo %s >> ~/.w3m/RestoreTab.txt' ; CLOSE_TAB"
+keymap u TAB_GOTO /usr/local/libexec/w3m/cgi-bin/restore_tab.cgi
+
+keymap SPC-m CURSOR_MIDDLE
+keymap SPC-l CURSOR_BOTTOM
+keymap SPC-h CURSOR_TOP