summaryrefslogtreecommitdiff
path: root/.w3m/keymap
diff options
context:
space:
mode:
Diffstat (limited to '.w3m/keymap')
-rw-r--r--.w3m/keymap63
1 files changed, 43 insertions, 20 deletions
diff --git a/.w3m/keymap b/.w3m/keymap
index 18cb2c1..225512e 100644
--- a/.w3m/keymap
+++ b/.w3m/keymap
@@ -59,14 +59,6 @@ keymap Q NULL
keymap C-w NULL
keymap C-d NULL
keymap C-u NULL
-keymap RIGHT NULL
-keymap l NULL
-keymap LEFT NULL
-keymap h NULL
-keymap j NULL
-keymap DOWN NULL
-keymap k NULL
-keymap UP NULL
keymap C-e NULL
keymap C-y NULL
keymap 0 NULL
@@ -162,8 +154,8 @@ keymap ef PEEK_LINK #Show link under cursor.
#Open current link with external browser = sensible browser
keymap M-o EXTERN
#copy current url and remove newline at the end.
-keymap yy EXTERN copy_url.sh
-#keymap yy EXTERN "echo -n %s | xclip -i -selection clipboard"
+#keymap yy EXTERN copy_url.sh
+keymap yy EXTERN "echo -n %s | xclip -i -selection clipboard"
#keymap yy EXTERN "echo -n %s | xsel -b"
#open link under cursor with external browser = sensible browser
keymap M-p EXTERN_LINK
@@ -177,28 +169,26 @@ keymap P TAB_GOTO /usr/lib/w3m/cgi-bin/goto_clipboard.cgi
keymap F TAB_LINK #Follow link in a new foreground tab
#follow link under cursor in new background tab
#keymap COMMAND "TAB_LINK ; PREV_TAB"
-keymap f GOTO_LINK #Follow link in current tab
+keymap f GOTO_LINK
+#Follow link in current tab
keymap C-j GOTO_LINK #Follow link (Enter = Ctrl+j)
#scrolling....................................................................
#pager-like scrolling.
-keymap k DOWN
-keymap j UP
-keymap l RIGHT
-keymap h LEFT
keymap gg BEGIN #Go to the top.
#go to line number 5 "5G"
keymap G END #Go to the end.
#keymap C-d NEXT_PAGE
#keymap C-u PREV_PAGE
#Av. Pag = M-[6~ Re. Pag = M-[5~
-keymap M-[6~ NEXT_PAGE
-keymap M-[5~ PREV_PAGE
keymap SPC NEXT_PAGE
#map Shift + space PREV_PAGE note: this is not present in default keymap
#Remap PageUp to Shitf + Space
#URxvt.keysym.Shift-space: \033[5~
keymap zz CENTER_V #center vertical-screen in cursor position
+keymap J PREV_TAB
+keymap K NEXT_TAB
+keymap C-w CLOSE_TAB
#-bookmarks....................................................................
keymap C-d ADD_BOOKMARK #Add current page to bookmarks
@@ -276,10 +266,43 @@ keymap C-x COMMAND "SET_OPTION fold_line=toggle ; RESHAPE"
#
#
# My custom bindings
-keymap C-p COMMAND "SAVE_SCREEN /home/lxf/inbox/output.txt"
-# Open current buffer in an external browser (app)
-keymap pp COMMAND "PRINT /home/lxf/inbox/new.txt && mutt -s 'Article'"
+keymap C-p COMMAND "SAVE_SCREEN /home/lxf/inbox/output.txt && mutt -s 'output test' sng@luxagraf.net < /home/lxf/inbox/output.txt"
+keymap M-p COMMAND "SAVE_SCREEN /home/lxf/inbox/%s.txt"
## fzf search of commands
keymap xx COMMAND "READ_SHELL ~/.w3m/cgi-bin/fnx_fzfmiru.cgi ; BACK ; GOTO file:/cgi-bin/fnx_execute.cgi ; BACK"
keymap sg COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_google.cgi ; DICT_WORD"
keymap sb COMMAND "SET_OPTION dictcommand=file:///cgi-bin/omnibar_brave.cgi ; DICT_WORD"
+
+# Navigate back without deleting current buffer
+keymap B PREV
+keymap < PREV
+keymap LEFT PREV
+
+# Navigate forward without deleting current buffer
+keymap > NEXT
+keymap RIGHT NEXT
+
+# Display current buffer URL
+keymap c PEEK
+
+# Pop-up menu with open buffers
+keymap b SELECT_MENU
+
+#### toggle hinting mode (vimium similar)
+keymap f-SPC COMMAND "SET_OPTION display_link_number=toggle ; RESHAPE"
+#### jump to link number (e.g press 3ff) and hide hinting mode (similar to gg in vim)
+keymap ff COMMAND "SET_OPTION display_link_number=0 ; RESHAPE ; LINK_BEGIN"
+#### open current cursor link in new tab and hide hinting mode
+keymap ft COMMAND "SET_OPTION display_link_number=0 ; RESHAPE ; TAB_LINK"
+#### copy link to clipboard (e.g press f-SPC then 4fy to yank url)
+keymap fy COMMAND "SET_OPTION display_link_number=0 ; RESHAPE ; LINK_BEGIN ; EXTERN_LINK 'url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b 2>/dev/null ; printf "%b" "$url" | tmux load-buffer - ; printf '%s' "$url" | wl-copy 2>/dev/null ; printf '%s' "$url" | clip 2>/dev/null ; printf '%s' "$url" > /dev/clipboard 2>/dev/null ; printf '%s' "$url" | pbcopy 2>/dev/null ; printf '%s' "$url" | termux-clipboard-set 2>/dev/null'"
+#### jump to link number and open it
+keymap fo COMMAND "SET_OPTION display_link_number=0 ; RESHAPE ; LINK_BEGIN ; GOTO_LINK"
+#### jump to link number and open it in new tab
+keymap fn COMMAND "SET_OPTION display_link_number=0 ; RESHAPE ; LINK_BEGIN ; TAB_LINK"
+# yank url to multiple clipboard (under cursor)
+#keymap yy EXTERN_LINK "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b 2>/dev/null ; printf "%b" "$url" | tmux load-buffer - ; printf '%s' "$url" | wl-copy 2>/dev/null ; printf '%s' "$url" | clip 2>/dev/null ; printf '%s' "$url" > /dev/clipboard 2>/dev/null ; printf '%s' "$url" | pbcopy 2>/dev/null ; printf '%s' "$url" | termux-clipboard-set 2>/dev/null"
+# yank url to multiple clipboard (current page)
+#keymap YY EXTERN "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b 2>/dev/null ; printf "%b" "$url" | tmux load-buffer - ; printf '%s' "$url" | wl-copy 2>/dev/null ; printf '%s' "$url" | clip 2>/dev/null ; printf '%s' "$url" > /dev/clipboard 2>/dev/null ; printf '%s' "$url" | pbcopy 2>/dev/null ; printf '%s' "$url" | termux-clipboard-set 2>/dev/null"
+
+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"