feat: yazi plugins [glow, projects, custom_scripts-set_wallpaper]
This commit is contained in:
5
.config/custom_scripts/osx/set_wallpaper.sh
Executable file
5
.config/custom_scripts/osx/set_wallpaper.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eaou pipefail
|
||||
|
||||
osascript -e 'tell application "System Events" to set picture of every desktop to "'"$1"'"'
|
41
.config/wezterm/modules/hyperlinks.lua
Normal file
41
.config/wezterm/modules/hyperlinks.lua
Normal file
@ -0,0 +1,41 @@
|
||||
return {
|
||||
-- Matches: a URL in parens: (URL)
|
||||
{
|
||||
regex = "\\((\\w+://\\S+)\\)",
|
||||
format = "$1",
|
||||
highlight = 1,
|
||||
},
|
||||
-- Matches: a URL in brackets: [URL]
|
||||
{
|
||||
regex = "\\[(\\w+://\\S+)\\]",
|
||||
format = "$1",
|
||||
highlight = 1,
|
||||
},
|
||||
-- Matches: a URL in curly braces: {URL}
|
||||
{
|
||||
regex = "\\{(\\w+://\\S+)\\}",
|
||||
format = "$1",
|
||||
highlight = 1,
|
||||
},
|
||||
-- Matches: a URL in angle brackets: <URL>
|
||||
{
|
||||
regex = "<(\\w+://\\S+)>",
|
||||
format = "$1",
|
||||
highlight = 1,
|
||||
},
|
||||
-- Then handle URLs not wrapped in brackets
|
||||
{
|
||||
-- Before
|
||||
--regex = '\\b\\w+://\\S+[)/a-zA-Z0-9-]+',
|
||||
--format = '$0',
|
||||
-- After
|
||||
regex = "[^(]\\b(\\w+://\\S+[)/a-zA-Z0-9-]+)",
|
||||
format = "$1",
|
||||
highlight = 1,
|
||||
},
|
||||
-- implicit mailto link
|
||||
{
|
||||
regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b",
|
||||
format = "mailto:$0",
|
||||
},
|
||||
}
|
@ -2,7 +2,7 @@ local wezterm = require("wezterm")
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
leader = { key = "a", mods = "CTRL", timeout_milliseconds = 1002 },
|
||||
leader = { key = "z", mods = "CTRL", timeout_milliseconds = 1002 },
|
||||
|
||||
keys = {
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ local config = {
|
||||
font = wezterm.font("JetBrains Mono", { weight = "Medium" }),
|
||||
font_size = 12,
|
||||
line_height = 1.0,
|
||||
window_background_opacity = 0.8,
|
||||
window_background_opacity = 0.97,
|
||||
-- tab bar
|
||||
use_fancy_tab_bar = true,
|
||||
tab_bar_at_bottom = false,
|
||||
@ -38,6 +38,7 @@ local config = {
|
||||
keys = mappings.keys,
|
||||
key_tables = mappings.key_tables,
|
||||
hyperlink_rules = hyperlinks,
|
||||
audible_bell = "Disabled",
|
||||
}
|
||||
|
||||
-- sessions.apply_to_config(config) -- optional, this adds default keybindings
|
||||
|
@ -15,3 +15,26 @@ require("bookmarks"):setup({
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("projects"):setup({
|
||||
save = {
|
||||
method = "yazi", -- yazi | lua
|
||||
lua_save_path = "", -- comment out to get the default value
|
||||
-- windows: "%APPDATA%/yazi/state/projects.json"
|
||||
-- unix: "~/.local/state/yazi/projects.json"
|
||||
},
|
||||
last = {
|
||||
update_after_save = true,
|
||||
update_after_load = true,
|
||||
load_after_start = false,
|
||||
},
|
||||
merge = {
|
||||
quit_after_merge = false,
|
||||
},
|
||||
notify = {
|
||||
enable = true,
|
||||
title = "Projects",
|
||||
timeout = 3,
|
||||
level = "info",
|
||||
},
|
||||
})
|
||||
|
@ -17,3 +17,43 @@ desc = "Delete a bookmark"
|
||||
on = [ "b", "D" ]
|
||||
run = "plugin bookmarks delete_all"
|
||||
desc = "Delete all bookmarks"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "s" ]
|
||||
run = "plugin projects save"
|
||||
desc = "Save current project"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "l" ]
|
||||
run = "plugin projects load"
|
||||
desc = "Load project"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "P" ]
|
||||
run = "plugin projects load_last"
|
||||
desc = "Load last project"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "d" ]
|
||||
run = "plugin projects delete"
|
||||
desc = "Delete project"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "D" ]
|
||||
run = "plugin projects delete_all"
|
||||
desc = "Delete all projects"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "m" ]
|
||||
run = "plugin projects 'merge current'"
|
||||
desc = "Merge current tab to other projects"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = [ "P", "M" ]
|
||||
run = "plugin projects 'merge all'"
|
||||
desc = "Merge current project to other projects"
|
||||
|
||||
[[manager.prepend_keymap]]
|
||||
on = ["C", "w"]
|
||||
run = 'shell -- ${HOME}/.config/custom_scripts/osx/set_wallpaper.sh "$1"'
|
||||
desc = "Set wallpaper"
|
||||
|
@ -3,6 +3,16 @@ use = "dedukun/bookmarks"
|
||||
rev = "95b2c58"
|
||||
hash = "17a094653b7d0db4ac68ed531d2e1412"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "Reledia/glow"
|
||||
rev = "c76bf4f"
|
||||
hash = "a6b78bf9af5390e3a85a6951fbb7b93"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "MasouShizuka/projects"
|
||||
rev = "4f11ecc"
|
||||
hash = "17fa17295d27864f62875f06a77f72e7"
|
||||
|
||||
[[flavor.deps]]
|
||||
use = "BennyOe/tokyo-night"
|
||||
rev = "695dac6"
|
||||
|
@ -10,5 +10,10 @@ show_hidden = true
|
||||
show_symlink = true
|
||||
scrolloff = 5
|
||||
mouse_events = ["click", "scroll"]
|
||||
# title_format = "Yazi: {cwd}"
|
||||
#title_format = "Yazi: {cwd}"
|
||||
|
||||
[plugin]
|
||||
prepend_previewers = [
|
||||
{ name = "*.md", run = "glow" },
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user