diff options
author | Simon Parri <simonparri@ganzeria.com> | 2025-09-25 11:45:17 -0500 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2025-09-25 11:45:17 -0500 |
commit | 64f157d27db9520013d451f7bf947db00c322cd3 (patch) | |
tree | 1edfc1a8ffca65f8ba29da8d2b9650d05798141e | |
parent | 0d366eb0734f81e02d024f11294799d39e9ff079 (diff) | |
download | dotfiles-64f157d27db9520013d451f7bf947db00c322cd3.tar.gz dotfiles-64f157d27db9520013d451f7bf947db00c322cd3.zip |
VimFX: Add View Source command
-rw-r--r-- | common/.vimfx/config.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/.vimfx/config.js b/common/.vimfx/config.js index 6783857..36983cf 100644 --- a/common/.vimfx/config.js +++ b/common/.vimfx/config.js @@ -135,6 +135,11 @@ function ungroupTabGroup({vim, count}) { return (count ? tabGroups[count-1] : selectedTab.group)?.ungroupTabs() } +function viewSource({vim}) { + let {BrowserCommands, gBrowser} = vim.window + BrowserCommands.viewSourceOfDocument({URL: gBrowser.currentURI.spec}) +} + const sendFn = msg => ({vim}) => vimfx.send(vim, msg, null, m => vim.notify(m)) @@ -155,6 +160,7 @@ let commands = { collapse_tab_group: collapseTabGroup, add_tab_group: addTabGroup, ungroup_tab_group: ungroupTabGroup, + view_source: viewSource, } // ** Apply Object.entries(commands) @@ -177,6 +183,7 @@ mappings = { ["gu <a-g>u", "go_up_path"], ["gU <a-g>U", "go_to_root"], ["gm <a-g>m", "go_home"], + ["gv <a-g>v", "my/view_source"], ["B", "history_back"], ["F", "history_forward"], ["gh <a-g>h", "history_list"], |