feat(wezterm): :retab
and improve URL regex
This commit is contained in:
parent
f2519d6b71
commit
319817b5c0
1 changed files with 67 additions and 61 deletions
|
@ -11,20 +11,20 @@ M.font = wezterm.font("FiraCode Nerd Font Mono")
|
|||
-- Font options --
|
||||
------------------
|
||||
M.harfbuzz_features = {
|
||||
"liga",
|
||||
"cv02",
|
||||
"cv19",
|
||||
"cv25",
|
||||
"cv26",
|
||||
"cv28",
|
||||
"cv30",
|
||||
"cv32",
|
||||
"ss02",
|
||||
"ss03",
|
||||
"ss05",
|
||||
"ss07",
|
||||
"ss09",
|
||||
"zero",
|
||||
"liga",
|
||||
"cv02",
|
||||
"cv19",
|
||||
"cv25",
|
||||
"cv26",
|
||||
"cv28",
|
||||
"cv30",
|
||||
"cv32",
|
||||
"ss02",
|
||||
"ss03",
|
||||
"ss05",
|
||||
"ss07",
|
||||
"ss09",
|
||||
"zero",
|
||||
}
|
||||
|
||||
--------------------
|
||||
|
@ -49,10 +49,10 @@ M.use_resize_increments = false
|
|||
M.enable_scroll_bar = false
|
||||
M.adjust_window_size_when_changing_font_size = false
|
||||
M.window_padding = {
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
}
|
||||
|
||||
-------------
|
||||
|
@ -64,65 +64,71 @@ M.enable_tab_bar = false
|
|||
-- Keybinds --
|
||||
--------------
|
||||
local function keybind(mods, key, action)
|
||||
if type(action) == "table" then
|
||||
action = wezterm.action(action)
|
||||
end
|
||||
if type(action) == "table" then
|
||||
action = wezterm.action(action)
|
||||
end
|
||||
|
||||
return {
|
||||
mods = mods,
|
||||
key = key,
|
||||
action = action,
|
||||
}
|
||||
return {
|
||||
mods = mods,
|
||||
key = key,
|
||||
action = action,
|
||||
}
|
||||
end
|
||||
|
||||
M.disable_default_key_bindings = true
|
||||
M.keys = {
|
||||
---------------
|
||||
-- Clipboard --
|
||||
---------------
|
||||
keybind("ALT", "c", { CopyTo = "Clipboard" }),
|
||||
keybind("ALT", "v", { PasteFrom = "Clipboard" }),
|
||||
---------------
|
||||
-- Clipboard --
|
||||
---------------
|
||||
keybind("ALT", "c", { CopyTo = "Clipboard" }),
|
||||
keybind("ALT", "v", { PasteFrom = "Clipboard" }),
|
||||
|
||||
---------------
|
||||
-- Font size --
|
||||
---------------
|
||||
keybind("ALT|SHIFT", "UpArrow", "IncreaseFontSize"),
|
||||
keybind("ALT|SHIFT", "DownArrow", "DecreaseFontSize"),
|
||||
---------------
|
||||
-- Font size --
|
||||
---------------
|
||||
keybind("ALT|SHIFT", "UpArrow", "IncreaseFontSize"),
|
||||
keybind("ALT|SHIFT", "DownArrow", "DecreaseFontSize"),
|
||||
|
||||
------------
|
||||
-- Scroll --
|
||||
------------
|
||||
keybind("ALT", "u", { ScrollByPage = -1 }),
|
||||
keybind("ALT", "d", { ScrollByPage = 1 }),
|
||||
------------
|
||||
-- Scroll --
|
||||
------------
|
||||
keybind("ALT", "u", { ScrollByPage = -1 }),
|
||||
keybind("ALT", "d", { ScrollByPage = 1 }),
|
||||
|
||||
------------
|
||||
-- Reload --
|
||||
------------
|
||||
keybind("CTRL|SHIFT", "r", "ReloadConfiguration"),
|
||||
------------
|
||||
-- Reload --
|
||||
------------
|
||||
keybind("CTRL|SHIFT", "r", "ReloadConfiguration"),
|
||||
}
|
||||
|
||||
-----------
|
||||
-- Links --
|
||||
-----------
|
||||
M.hyperlink_rules = {
|
||||
-- Linkify things that look like URLs
|
||||
-- This is actually the default if you don't specify any hyperlink_rules
|
||||
{
|
||||
regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
|
||||
format = "$0",
|
||||
},
|
||||
-- -- Linkify things that look like URLs
|
||||
-- -- This is actually the default if you don't specify any hyperlink_rules
|
||||
-- {
|
||||
-- regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
|
||||
-- format = "$0",
|
||||
-- },
|
||||
|
||||
-- linkify email addresses
|
||||
{
|
||||
regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b",
|
||||
format = "mailto:$0",
|
||||
},
|
||||
-- Linkify things that look like URLs
|
||||
{
|
||||
regex = "\\b\\w+://(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&/=]*)",
|
||||
format = "$0",
|
||||
},
|
||||
|
||||
-- file:// URI
|
||||
{
|
||||
regex = "\\bfile://\\S*\\b",
|
||||
format = "$0",
|
||||
},
|
||||
-- linkify email addresses
|
||||
{
|
||||
regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b",
|
||||
format = "mailto:$0",
|
||||
},
|
||||
|
||||
-- file:// URI
|
||||
{
|
||||
regex = "\\bfile://\\S*\\b",
|
||||
format = "$0",
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue