vtsm: add manifest for OpenSUSE

This commit is contained in:
Gabriel Arazas 2024-04-09 14:00:14 +08:00
parent c0c64c9f9d
commit d192e39178
3 changed files with 58 additions and 44 deletions

6
.vtsm/opensuse.json Normal file
View File

@ -0,0 +1,6 @@
{
"bin": "$HOME/.local/bin",
"nvim": "$XDG_CONFIG_HOME/nvim",
"kitty": "$XDG_CONFIG_HOME/kitty",
"wezterm": "$XDG_CONFIG_HOME/wezterm"
}

View File

@ -32,7 +32,10 @@ function module.apply_to_config(config)
return config return config
end end
-- The keymod to be used for the entire configuration. -- The keymod to be used for the entire configuration. The purpose of the
-- keymod is to assign it as a "global modifier" for the Wezterm program since
-- usual modifiers like CTRL and ALT are typically used for programs like Vim
-- and Emacs. It's quite similar to tmux's prefix key for its keybindings.
module.keymod = "CTRL|SHIFT" module.keymod = "CTRL|SHIFT"
module.alt_keymod = "CTRL|SHIFT|ALT" module.alt_keymod = "CTRL|SHIFT|ALT"

View File

@ -34,20 +34,20 @@ function module.apply_to_config(config)
-- It also makes use of key tables which is defined after. -- It also makes use of key tables which is defined after.
config.keys = { config.keys = {
-- Clipboard -- Clipboard
{ key = "c", mods = keymod, action = act.CopyTo("Clipboard") }, { key = "c", mods = keymod, action = act.CopyTo("Clipboard") },
{ key = "v", mods = keymod, action = act.PasteFrom("Clipboard") }, { key = "v", mods = keymod, action = act.PasteFrom("Clipboard") },
-- Font resize. -- Font resize.
{ key = "+", mods = keymod, action = act.IncreaseFontSize }, { key = "+", mods = keymod, action = act.IncreaseFontSize },
{ key = "_", mods = keymod, action = act.DecreaseFontSize }, { key = "_", mods = keymod, action = act.DecreaseFontSize },
{ key = ")", mods = keymod, action = act.ResetFontSize }, { key = ")", mods = keymod, action = act.ResetFontSize },
-- Scrollback -- Scrollback
{ key = "j", mods = keymod, action = act.ScrollByPage(1) }, { key = "j", mods = keymod, action = act.ScrollByPage(1) },
{ key = "k", mods = keymod, action = act.ScrollByPage(-1) }, { key = "k", mods = keymod, action = act.ScrollByPage(-1) },
{ key = "j", mods = "CTRL|ALT", action = act.ScrollToPrompt(1) }, { key = "j", mods = "CTRL|ALT", action = act.ScrollToPrompt(1) },
{ key = "k", mods = "CTRL|ALT", action = act.ScrollToPrompt(-1) }, { key = "k", mods = "CTRL|ALT", action = act.ScrollToPrompt(-1) },
{ key = "G", mods = keymod, action = act.ScrollToBottom }, { key = "G", mods = keymod, action = act.ScrollToBottom },
{ key = "g", mods = "CTRL|ALT", action = act.ScrollToTop }, { key = "g", mods = "CTRL|ALT", action = act.ScrollToTop },
-- Pane navigation. -- Pane navigation.
@ -72,20 +72,20 @@ function module.apply_to_config(config)
}), }),
}, },
{ key = "h", mods = keymod, action = act.ActivatePaneDirection("Left") }, { key = "h", mods = keymod, action = act.ActivatePaneDirection("Left") },
{ key = "l", mods = keymod, action = act.ActivatePaneDirection("Right") }, { key = "l", mods = keymod, action = act.ActivatePaneDirection("Right") },
{ key = "LeftArrow", mods = keymod, action = act.ActivatePaneDirection("Left") }, { key = "LeftArrow", mods = keymod, action = act.ActivatePaneDirection("Left") },
{ key = "DownArrow", mods = keymod, action = act.ActivatePaneDirection("Down") }, { key = "DownArrow", mods = keymod, action = act.ActivatePaneDirection("Down") },
{ key = "UpArrow", mods = keymod, action = act.ActivatePaneDirection("Up") }, { key = "UpArrow", mods = keymod, action = act.ActivatePaneDirection("Up") },
{ key = "RightArrow", mods = keymod, action = act.ActivatePaneDirection("Right") }, { key = "RightArrow", mods = keymod, action = act.ActivatePaneDirection("Right") },
-- More pane-related niceties. -- More pane-related niceties.
{ key = "f", mods = "LEADER", action = act.TogglePaneZoomState }, { key = "f", mods = "LEADER", action = act.TogglePaneZoomState },
{ key = "f", mods = keymod, action = act.TogglePaneZoomState }, { key = "f", mods = keymod, action = act.TogglePaneZoomState },
{ key = "n", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, { key = "n", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "n", mods = keymod, action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, { key = "n", mods = keymod, action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "n", mods = alt_keymod, action = act.SplitVertical({ domain = "CurrentPaneDomain" }) }, { key = "n", mods = alt_keymod, action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
{ key = "d", mods = keymod, action = act.CloseCurrentPane({ confirm = false }) }, { key = "d", mods = keymod, action = act.CloseCurrentPane({ confirm = false }) },
-- Tab navigation -- Tab navigation
{ {
@ -98,12 +98,12 @@ function module.apply_to_config(config)
one_shot = true, one_shot = true,
}), }),
}, },
{ mods = alt_keymod, key = "h", action = act.ActivateTabRelative(-1) }, { mods = alt_keymod, key = "h", action = act.ActivateTabRelative(-1) },
{ mods = alt_keymod, key = "j", action = act.ActivateTab(-1) }, { mods = alt_keymod, key = "j", action = act.ActivateTab(-1) },
{ mods = alt_keymod, key = "k", action = act.ActivateTab(0) }, { mods = alt_keymod, key = "k", action = act.ActivateTab(0) },
{ mods = alt_keymod, key = "l", action = act.ActivateTabRelative(1) }, { mods = alt_keymod, key = "l", action = act.ActivateTabRelative(1) },
{ key = "t", mods = keymod, action = act.ShowTabNavigator }, { key = "t", mods = keymod, action = act.ShowTabNavigator },
{ key = "d", mods = alt_keymod, action = act.CloseCurrentTab({ confirm = false }) }, { key = "d", mods = alt_keymod, action = act.CloseCurrentTab({ confirm = false }) },
-- Hints and quick selections -- Hints and quick selections
{ {
@ -117,26 +117,31 @@ function module.apply_to_config(config)
}), }),
}, },
{ key = "r", mods = keymod, action = act.ReloadConfiguration }, { key = "h", mods = "ALT", action = act.AdjustPaneSize({ "Left", 1 }) },
{ key = "o", mods = keymod, action = act.ShowDebugOverlay }, { key = "j", mods = "ALT", action = act.AdjustPaneSize({ "Down", 1 }) },
{ key = "p", mods = keymod, action = act.ActivateCommandPalette }, { key = "k", mods = "ALT", action = act.AdjustPaneSize({ "Up", 1 }) },
{ key = "e", mods = keymod, action = act.EmitEvent("view-last-output-in-new-pane") }, { key = "l", mods = "ALT", action = act.AdjustPaneSize({ "Right", 1 }) },
{ key = "r", mods = keymod, action = act.ReloadConfiguration },
{ key = "o", mods = keymod, action = act.ShowDebugOverlay },
{ key = "p", mods = keymod, action = act.ActivateCommandPalette },
{ key = "e", mods = keymod, action = act.EmitEvent("view-last-output-in-new-pane") },
-- Selection -- Selection
{ key = "Space", mods = "LEADER", action = act.QuickSelect }, { key = "Space", mods = "LEADER", action = act.QuickSelect },
{ key = "a", mods = keymod, action = act.QuickSelect }, { key = "a", mods = keymod, action = act.QuickSelect },
{ key = "s", mods = keymod, action = act.Search({ CaseSensitiveString = "" }) }, { key = "s", mods = keymod, action = act.Search({ CaseSensitiveString = "" }) },
} }
config.key_tables = { config.key_tables = {
hints = { hints = {
{ key = "g", action = act.Search({ Regex = "[0-9a-f]{6,}" }) }, { key = "g", action = act.Search({ Regex = "[0-9a-f]{6,}" }) },
{ {
key = "h", key = "h",
action = act.QuickSelectArgs({ action = act.QuickSelectArgs({
patterns = { patterns = {
"[0-9a-f]{7,40}", -- SHA1 hashes, usually used for Git. "[0-9a-f]{7,40}", -- SHA1 hashes, usually used for Git.
"[0-9a-f]{7,64}", -- SHA256 hashes, used often for getting hashes for Guix packaging. "[0-9a-f]{7,64}", -- SHA256 hashes, used often for getting hashes for Guix packaging.
"sha256-[[:alpha:][:digit:]-=+/?]{44}", -- SHA256 hashes in Base64, used often in getting hashes for Nix packaging. "sha256-[[:alpha:][:digit:]-=+/?]{44}", -- SHA256 hashes in Base64, used often in getting hashes for Nix packaging.
"[[:alpha:][:digit:]-=+/?]{44,64}", "[[:alpha:][:digit:]-=+/?]{44,64}",
}, },
@ -164,8 +169,8 @@ function module.apply_to_config(config)
}, },
{ key = "Space", action = act.QuickSelect }, { key = "Space", action = act.QuickSelect },
{ key = "s", action = act.QuickSelect }, { key = "s", action = act.QuickSelect },
{ key = "f", action = act.Search({ CaseSensitiveString = "" }) }, { key = "f", action = act.Search({ CaseSensitiveString = "" }) },
}, },
pane_navigation = { pane_navigation = {
@ -187,13 +192,13 @@ function module.apply_to_config(config)
}, },
resize_pane = { resize_pane = {
{ key = "h", action = act.AdjustPaneSize({ "Left", 1 }) }, { key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },
{ key = "j", action = act.AdjustPaneSize({ "Down", 1 }) }, { key = "j", action = act.AdjustPaneSize({ "Down", 1 }) },
{ key = "k", action = act.AdjustPaneSize({ "Up", 1 }) }, { key = "k", action = act.AdjustPaneSize({ "Up", 1 }) },
{ key = "l", action = act.AdjustPaneSize({ "Right", 1 }) }, { key = "l", action = act.AdjustPaneSize({ "Right", 1 }) },
{ key = "q", action = act.PopKeyTable }, { key = "q", action = act.PopKeyTable },
{ key = "Escape", action = act.PopKeyTable }, { key = "Escape", action = act.PopKeyTable },
{ key = "Enter", action = act.PopKeyTable }, { key = "Enter", action = act.PopKeyTable },
}, },
} }
return config return config