dotfiles/qutebrowser/config/maps.py

109 lines
4.4 KiB
Python
Raw Normal View History

# Key mappings
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
# 'Leader' key binding -- for general personal maps
leader = "<Space>"
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
# 'LocalLeader' key binding -- intended for 'in-page' personal maps
lleader = ","
## CHANGED DEFAULTS
# rebind moving tabs to free for download
config.bind("gG", "tab-give")
# switch binds for scroll-marks and quick-/book-marks
config.bind("m", "mode-enter set_mark")
config.bind("`", "quickmark-save")
config.bind("~", "bookmark-add")
config.bind("<Ctrl-J>", "command-history-next", mode="command")
config.bind("<Ctrl-K>", "command-history-prev", mode="command")
config.bind("<Ctrl-P>", "completion-item-focus prev", mode="command")
config.bind("<Ctrl-N>", "completion-item-focus next", mode="command")
config.bind("<Alt-Backspace>", "rl-backward-kill-word", mode="command")
config.bind("<Alt-D>", "rl-kill-word", mode="command")
config.bind("<Alt-F>", "rl-forward-word", mode="command")
config.bind("<Ctrl-?>", "rl-delete-char", mode="command")
config.bind("<Ctrl-A>", "rl-beginning-of-line", mode="command")
config.bind("<Ctrl-B>", "rl-backward-char", mode="command")
config.bind("<Ctrl-C>", "completion-item-yank", mode="command")
config.bind("<Ctrl-D>", "completion-item-del", mode="command")
config.bind("<Ctrl-E>", "rl-end-of-line", mode="command")
config.bind("<Ctrl-F>", "rl-forward-char", mode="command")
config.bind("<Ctrl-H>", "rl-backward-delete-char", mode="command")
config.bind("<Ctrl-Shift-Tab>", "completion-item-focus prev-category", mode="command")
config.bind("<Ctrl-Tab>", "completion-item-focus next-category", mode="command")
config.bind("<Ctrl-U>", "rl-unix-line-discard", mode="command")
config.bind("<Ctrl-W>", "rl-unix-word-rubout", mode="command")
config.bind("<Ctrl-Y>", "rl-yank", mode="command")
## ADDED
# toggles ('cycles') between tabs always showing, or only when switching between them
config.bind(
leader + "tt",
"config-cycle -t tabs.show multiple switching ;; config-cycle -t statusbar.show always in-mode",
)
config.bind(leader + "th", "set tabs.position bottom")
config.bind(leader + "tH", "set tabs.position top")
config.bind(leader + "tv", "set tabs.position right")
config.bind(leader + "tV", "set tabs.position left")
# [M]edia shortcuts - watch, queue, download media
# bind mpv to play the current page/links, using a single instance which queues the next link passed
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
config.bind(lleader + "m", "hint links spawn umpv {hint-url}")
config.bind(lleader + "i", "hint links spawn uoeia -v imv {hint-url}")
config.bind(lleader + "I", "hint images spawn uoeia -v imv {hint-url}") # for images directly
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
# [G]emini shortcuts
# the full power of qutebrowser at your fingertips for any gemini page!
config.bind(f"{lleader}g", "hint all userscript qute-gemini")
config.bind(f"{lleader}G", "hint all userscript qute-gemini-tab")
# bind youtube-dl to download the current page/links
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
config.bind(lleader + "dM", "spawn vidl {url}")
config.bind(
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
lleader + "dm",
"hint --rapid links spawn vidl {hint-url}",
)
# Download shortcuts
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
config.bind(lleader + "dd", "download", mode="normal")
config.bind(lleader + "dp", "save-to-pdf", mode="normal")
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
# open last download
config.bind("gD", "recent-downloads", mode="normal")
config.bind('"w', "add-wallabag", mode="normal") # add current page to wallabag
config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallabag
config.bind('"s', "add-shaarli", mode="normal")
config.bind(";s", "hint links userscript shaarli_add.sh")
config.bind('"a', "send-to-archive", mode="normal")
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
config.bind('"t', "translate-page-google", mode="normal")
config.bind('"t', "translate-selection-google", mode="caret")
config.bind('"q', "show-qr")
config.bind('"p', "send-to-scihub", mode="normal") # view current page doi on scihub
config.bind(";p", "hint links run send-to-scihub") # view linked doi on scihub
config.bind(lleader + "r", "readable", mode="normal")
# set stylesheets for the browser to use
config.bind(
leader + "s",
"config-cycle content.user_stylesheets " + 'stylesheets/stylesheet.css ""',
)
config.bind(leader + "a", "set-cmd-text -s :taskadd")
# Enable and disable javascript
config.bind(leader + "js", "config-cycle content.javascript.enabled true false")
# Reload configuration
config.bind(leader + "VV", "config-source")
# Enable code snippet hinting mode
config.bind(";c", "hint code userscript code_select.py")
# first looks if it's a gemini link and then fall back to http
config.bind(";g", "hint links userscript qute-gemini")
config.bind(";G", "hint links userscript qute-gemini-tab")