dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit c0da426276032ba22d8cede8c6c787d0b8633711
parent ead30b7841ff10a32442c11737be97bf9304f243
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Sun, 30 May 2021 15:39:16 +0200

w3m: a bunch of settings/mappings

Diffstat:
Mshell/env | 6+++---
Mw3m/config | 22+++++++++++-----------
Mw3m/keymap | 49+++++++++++++++++++++++++++++++++----------------
3 files changed, 47 insertions(+), 30 deletions(-)

diff --git a/shell/env b/shell/env @@ -21,8 +21,8 @@ export LC_MONETARY="en_US.UTF-8" export LC_NUMERIC="en_US.UTF-8" export LC_TIME="en_US.UTF-8" -export TTRV_BROWSER=linkhandler -export WWW_HOME="https://search.alex.balgavy.eu" +export TTRV_BROWSER=~/.scripts/linkhandler +export WWW_HOME="https://tab.alex.balgavy.eu" # Icons for lf {{{1 export LF_ICONS="\ bd=:\ @@ -200,7 +200,7 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" alias irssi='irssi --home=$XDG_CONFIG_HOME/irssi' alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf' -alias w3m='w3m -config $XDG_CONFIG_HOME/w3m/config' +alias w3m='w3m -config $XDG_CONFIG_HOME/w3m/config -bookmark $XDG_CONFIG_HOME/w3m/bookmark.html' export GOPATH="$XDG_DATA_HOME"/go export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" export BUNDLE_USER_HOME="$XDG_CONFIG_HOME/bundle" diff --git a/w3m/config b/w3m/config @@ -4,14 +4,14 @@ pixel_per_char 8 frame 0 target_self 0 open_tab_blank 0 -open_tab_dl_list 0 -display_link 0 -display_link_number 0 -decode_url 0 -display_lineinfo 0 -ext_dirlist 1 +open_tab_dl_list 1 +display_link 1 +display_link_number 1 +decode_url 1 +display_lineinfo 1 +ext_dirlist 0 dirlist_cmd file:///$LIB/dirlist.cgi -use_dictcommand 1 +use_dictcommand 0 dictcommand file:///$LIB/w3mdict.cgi multicol 0 alt_entity 0 @@ -32,12 +32,12 @@ color 1 basic_color terminal anchor_color blue image_color green -form_color red +form_color white mark_color cyan bg_color terminal -active_style 0 +active_style 1 active_color cyan -visited_anchor 0 +visited_anchor 1 visited_color magenta pagerline 10000 use_history 1 @@ -71,7 +71,7 @@ urimethodmap ~/.config/w3m/urimethodmap, /usr/local/Cellar/w3m/0.5.3_6/etc/w3m/u editor /usr/local/bin/vim mailto_options 1 mailer -extbrowser /usr/bin/firefox +extbrowser linkhandler extbrowser2 extbrowser3 extbrowser4 diff --git a/w3m/keymap b/w3m/keymap @@ -1,4 +1,6 @@ # Reference: http://epistulus.com/w3m/MANUAL.html + +# Text navigation keymap 0 LINE_BEGIN keymap $ LINE_END keymap C-g LINE_INFO @@ -6,27 +8,38 @@ keymap h MOVE_LEFT keymap l MOVE_RIGHT keymap j MOVE_DOWN keymap k MOVE_UP -keymap H BACK keymap gg BEGIN keymap w NEXT_WORD keymap b PREV_WORD keymap G END + +# Scrolling keymap C-e UP keymap C-y DOWN keymap C-f NEXT_PAGE keymap C-b PREV_PAGE keymap C-d NEXT_HALF_PAGE keymap C-u PREV_HALF_PAGE -keymap SPCr PIPE_SHELL 'go-readability $W3M_URL | w3m -config ~/.config/w3m/config -T text/html -cols $(($(tput cols)*6/10))' -keymap SPCo SHELL 'open "$W3M_URL"' -keymap SPCt SHELL 'open "$W3M_CURRENT_LINK"' -keymap SPCy EXEC_SHELL 'printf "%s" $W3M_CURRENT_LINK | clc' -keymap SPCc EXEC_SHELL 'printf "%s" $W3M_URL | clc' -keymap SPCs EXEC_SHELL 'pocket save $W3M_URL' -keymap SPCl EXEC_SHELL 'pocket save $W3M_CURRENT_LINK' -keymap SPCv EXEC_SHELL 'linkhandler "$W3M_CURRENT_LINK"' + +# Misc +keymap H BACK +keymap ~ GOTO_HOME # specified in $WWW_HOME +keymap M-f GOTO https://search.alex.balgavy.eu +keymap C-l REDRAW keymap s PRINT keymap S DOWNLOAD +keymap ";" COMMAND +keymap e EXTERN_LINK +keymap ] EXTERN + +# Link info +keymap U LIST +keymap C-g PEEK +keymap I INFO +keymap u PEEK_LINK +keymap i PEEK_IMG + +# Tabs keymap C-w CLOSE_TAB keymap C-t NEW_TAB keymap gt NEXT_TAB @@ -36,12 +49,17 @@ keymap o GOTO keymap O TAB_LINK keymap r RELOAD keymap M-r REINIT -keymap U LIST -keymap C-g PEEK -keymap I INFO -keymap u PEEK_LINK -keymap i PEEK_IMG -keymap ~ GOTO_HOME + +# Macros +keymap SPCr PIPE_SHELL 'go-readability $W3M_URL | w3m -config ~/.config/w3m/config -T text/html -cols $(($(tput cols)*6/10))' +keymap SPCo SHELL 'open "$W3M_URL"' +keymap SPCt SHELL 'open "$W3M_CURRENT_LINK"' +keymap SPCy EXEC_SHELL 'printf "%s" $W3M_CURRENT_LINK | clc' +keymap SPCc EXEC_SHELL 'printf "%s" $W3M_URL | clc' +keymap SPCs EXEC_SHELL 'pocket save $W3M_URL' +keymap SPCl EXEC_SHELL 'pocket save $W3M_CURRENT_LINK' +keymap SPCv EXEC_SHELL 'linkhandler "$W3M_CURRENT_LINK"' + # ABORT Quit at once # ACCESSKEY Pop up accesskey menu # ADD_BOOKMARK Add current page to bookmarks @@ -51,7 +69,6 @@ keymap ~ GOTO_HOME # CENTER_V Center on cursor line # CHARSET Change the character encoding for the current document # CLOSE_TAB_MOUSE Close tab at mouse pointer -# COMMAND Invoke w3m function(s) # COOKIE View cookie list # CURSOR_TOP Move cursor to the top line on the screen # CURSOR_MIDDLE Move cursor to the middle line on the screen