feat: yazi, clean wezterm

This commit is contained in:
Aleksander Cynarski 2025-04-12 15:38:25 +02:00
parent ab69b02641
commit 72e7700efb
30 changed files with 4361 additions and 28 deletions

View File

@ -55,11 +55,47 @@ return {
action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }),
}, },
-- session manager -- Rename current workspace
{ key = "s", mods = "LEADER", action = act({ EmitEvent = "save_session" }) }, {
{ key = "l", mods = "LEADER", action = act({ EmitEvent = "load_session" }) }, key = "$",
{ key = "r", mods = "LEADER", action = act({ EmitEvent = "restore_session" }) }, mods = "LEADER|SHIFT",
action = act.PromptInputLine({
description = "Enter new workspace name",
action = wezterm.action_callback(function(window, pane, line)
if line then
wezterm.mux.rename_workspace(wezterm.mux.get_active_workspace(), line)
end
end),
}),
},
-- Prompt for a name to use for a new workspace and switch to it.
{
key = "w",
mods = "LEADER|SHIFT",
action = act.PromptInputLine({
description = wezterm.format({
{ Attribute = { Intensity = "Bold" } },
{ Foreground = { AnsiColor = "Fuchsia" } },
{ Text = "Enter name for new workspace" },
}),
action = wezterm.action_callback(function(window, pane, line)
-- line will be `nil` if they hit escape without entering anything
-- An empty string if they just hit enter
-- Or the actual line of text they wrote
if line then
window:perform_action(
act.SwitchToWorkspace({
name = line,
}),
pane
)
end
end),
}),
},
}, },
key_tables = { key_tables = {
resize_pane = { resize_pane = {
{ key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) }, { key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) },

View File

@ -1,27 +1,8 @@
local wezterm = require("wezterm") local wezterm = require("wezterm")
local mappings = require("modules.mappings") local mappings = require("modules.mappings")
local session_manager = require("wezterm-session-manager/session-manager") local hyperlinks = require("modules.hyperlinks")
-- Show which key table is active in the status area local config = {
wezterm.on("update-right-status", function(window, pane)
local name = window:active_key_table()
if name then
name = "TABLE: " .. name
end
window:set_right_status(name or "")
end)
wezterm.on("save_session", function(window)
session_manager.save_state(window)
end)
wezterm.on("load_session", function(window)
session_manager.load_state(window)
end)
wezterm.on("restore_session", function(window)
session_manager.restore_state(window)
end)
return {
default_cursor_style = "BlinkingBlock", default_cursor_style = "BlinkingBlock",
color_scheme = "Catppuccin Mocha", color_scheme = "Catppuccin Mocha",
colors = { colors = {
@ -31,7 +12,7 @@ return {
}, },
-- font -- font
font = wezterm.font("JetBrains Mono", { weight = "Medium" }), font = wezterm.font("JetBrains Mono", { weight = "Medium" }),
font_size = 10, font_size = 12,
line_height = 1.0, line_height = 1.0,
window_background_opacity = 0.8, window_background_opacity = 0.8,
-- tab bar -- tab bar
@ -46,8 +27,9 @@ return {
bottom = 7, bottom = 7,
}, },
window_decorations = "RESIZE", window_decorations = "RESIZE",
window_close_confirmation = "NeverPrompt",
inactive_pane_hsb = { inactive_pane_hsb = {
brightness = 0.7, brightness = 0.5,
}, },
send_composed_key_when_left_alt_is_pressed = false, send_composed_key_when_left_alt_is_pressed = false,
send_composed_key_when_right_alt_is_pressed = true, send_composed_key_when_right_alt_is_pressed = true,
@ -55,4 +37,18 @@ return {
leader = mappings.leader, leader = mappings.leader,
keys = mappings.keys, keys = mappings.keys,
key_tables = mappings.key_tables, key_tables = mappings.key_tables,
hyperlink_rules = hyperlinks,
} }
-- sessions.apply_to_config(config) -- optional, this adds default keybindings
-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
local name = window:active_key_table()
if name then
name = "TABLE: " .. name
end
window:set_right_status(name or "")
end)
return config

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Steph Ango
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Steph Ango
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,36 @@
<div align="center">
<img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
</div>
<h3 align="center">
Flexoki Dark Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
</h3>
## 👀 Preview
<img src="preview.png" width="600" />
## 🎨 Installation
```sh
ya pack -a gosxrgxx/flexoki-dark
```
## ⚙️ Usage
To set it as your dark flavor, change the content of your `theme.toml` to:
```toml
[flavor]
dark = "flexoki-dark"
```
Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor.
See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details.
## 📜 License
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.

View File

@ -0,0 +1,166 @@
# Сolor palette: https://stephango.com/flexoki
# ---
# black "#100F0F" bg
# base-950 "#1C1B1A" bg-2
# base-900 "#282726" ui
# base-850 "#343331" ui-2
# base-800 "#403E3C" ui-3
# base-700 "#575653" tx-3
# base-500 "#878580" tx-2
# base-200 "#CECDC3" tx
# red-400 "#D14D41" re
# orange-400 "#DA702C" or
# yellow-400 "#D0A215" ye
# yellow-600 "#AD8301" ye-2
# green-400 "#879A39" gr
# cyan-400 "#3AA99F" cy
# cyan-600 "#24837B" cy-2
# cyan-700 "#1C6C66" cy-700
# cyan-900 "#122F2C" cy-900
# blue-400 "#4385BE" bl
# purple-400 "#8B7EC8" pu
# magenta-400 "#CE5D97" ma
[manager]
cwd = { fg = "#CECDC3", bold = true } # tx
# Hovered
hovered = { bg = "#1C1B1A" } # bg-2
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#AD8301", reversed = true } # ye-2
find_position = { fg = "#575653", bold = true, italic = true } # tx-3
# Marker
marker_copied = { fg = "#879A39", bg = "#879A39" } # gr, gr
marker_cut = { fg = "#D14D41", bg = "#D14D41" } # re, re
marker_marked = { fg = "#1C6C66", bg = "#1C6C66" } # cy-700, cy-700
marker_selected = { fg = "#3AA99F", bg = "#3AA99F" } # cy, cy
# Tab
tab_active = { fg = "#CECDC3", bg = "#403E3C", bold = true } # tx, ui-3
tab_inactive = { fg = "#878580", bg = "#282726" } # tx-2, ui
tab_width = 1
# Count
count_copied = { fg = "#879A39", bold = true, reversed = true } # gr
count_cut = { fg = "#D14D41", bold = true, reversed = true } # re
count_selected = { fg = "#3AA99F", bold = true, reversed = true } # cy
# Border
border_symbol = "│"
border_style = { fg = "#282726" } # ui
[mode]
# Normal mode
normal_main = { fg = "#CECDC3", bg = "#403E3C", bold = true } # tx, ui-3
normal_alt = { fg = "#878580", bg = "#282726" } # tx-2, ui
# Select mode
select_main = { fg = "#100F0F", bg = "#3AA99F", bold = true } # bg, cy
select_alt = { fg = "#3AA99F", bg = "#122F2C" } # cy, cy-900
# Unset mode
unset_main = { fg = "#100F0F", bg = "#3AA99F", bold = true } # bg, cy
unset_alt = { fg = "#3AA99F", bg = "#122F2C" } # cy, cy-900
[status]
overall = { fg = "#CECDC3" } # tx
# Permissions
perm_type = { fg = "#4385BE" } # bl
perm_read = { fg = "#D0A215" } # ye
perm_write = { fg = "#D14D41" } # re
perm_exec = { fg = "#879A39" } # gr
perm_sep = { fg = "#878580" } # tx-2
# Progress
progress_label = { fg = "#100F0F" } # bg
progress_normal = { fg = "#3AA99F", bg = "#1C6C66" } # cy, cy-700
progress_error = { bg = "#D14D41" } # re
[which]
cols = 3
mask = { bg = "#1C1B1A" } # bg-2
cand = { fg = "#D0A215", bold = true } # ye
rest = { fg = "#D0A215", italic = true } # ye
desc = { fg = "#575653" } # tx-3
separator = " "
separator_style = { }
[confirm]
border = { fg = "#403E3C" } # ui-3
title = { fg = "#575653", bold = true } # tx-3
content = { fg = "#CECDC3", bold = true } # tx
list = { fg = "#CECDC3" } # tx
btn_yes = { fg = "#CECDC3", bg = "#403E3C", bold = true } # tx, ui-3
btn_no = { fg = "#878580", bg = "#282726" } # tx-2, ui
[spot]
border = { fg = "#403E3C" } # ui-3
title = { fg = "#575653", bold = true } # tx-3
tbl_col = { fg = "#878580" } # tx-2
tbl_cell = { bg = "#1C1B1A" } # bg-2
[notify]
# Notification title
title_info = { fg = "#4385BE" } # bl
title_warn = { fg = "#DA702C" } # or
title_error = { fg = "#D14D41" } # re
[pick]
border = { fg = "#403E3C", bold = true } # ui-3
active = { fg = "#CECDC3" } # tx
inactive = { fg = "#878580" } # tx-2
[input]
border = { fg = "#403E3C" } # ui-3
title = { fg = "#575653", bold = true } # tx-3
value = { fg = "#CECDC3" } # tx
selected = { bg = "#1C1B1A" } # bg-2
[cmp]
border = { fg = "#403E3C", bold = true } # ui-3
active = { fg = "#878580", bg = "#1C1B1A" } # tx-2, bg-2
inactive = { fg = "#878580" } # tx-2
[tasks]
border = { fg = "#403E3C" } # ui-3
title = { fg = "#575653", bold = true } # tx-3
hovered = { bg = "#1C1B1A" } # bg-2
[help]
on = { fg = "#4385BE" } # bl
run = { fg = "#3AA99F" } # cy
desc = { fg = "#575653", italic = true } # tx-3
hovered = { bg = "#1C1B1A" } # bg-2
footer = { fg = "#CECDC3", bg = "#282726", bold = true } # tx, ui
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#8B7EC8" }, # pu
# Media
{ mime = "video/*", fg = "#D0A215" }, # ye
{ mime = "audio/*", fg = "#D0A215" }, # ye
# Broken symbolic link
{ name = "*", is = "orphan", fg = "#575653", crossed = true }, # tx-3
{ name = "*/", is = "orphan", fg = "#575653", crossed = true }, # tx-3
# Symbolic links
{ name = "*", is = "link", fg = "#3AA99F" }, # cy
{ name = "*/", is = "link", fg = "#3AA99F" }, # cy
# Executable
{ name = "*", is = "exec", fg = "#879A39" }, # gr
# Empty files
{ mime = "inode/empty", fg = "#575653" }, # tx-3
# Fallback
{ name = "*", fg = "#878580" }, # tx-2
{ name = "*/", fg = "#CECDC3" } # tx
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Mykola Yavir
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Mykola Yavir
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,34 @@
<div align="center">
<img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
</div>
<h3 align="center">
Sunset Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
</h3>
## 👀 Preview
<img src="preview.png" width="600" />
## 🎨 Installation
```bash
ya pack -a PinThePenguine/sunset
```
## ⚙️ Usage
Add the these lines to your `theme.toml` configuration file to use it:
```toml
[flavor]
use = "sunset"
```
## 📜 License
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.

View File

@ -0,0 +1,159 @@
# : Manager {{{
[manager]
cwd = { fg = "#EBDBB2" }
# Tab
tab_active = { fg = "#12202B", bg = "#E9C46A", bold = true}
tab_inactive = { fg = "#EBDBB2", bg = "#504945"}
tab_width = 1
# Find
find_keyword = { fg = "#2A9D8F", bold = true, italic = true, underline = true }
find_position = { fg = "#2A9D8F", bold = true, italic = true }
# Marker
marker_copied = { fg = "#83A598", bg = "#83A598" }
marker_cut = { fg = "#264653", bg = "#264653" }
marker_marked = { fg = "#2A9D8F", bg = "#2A9D8F" }
marker_selected = { fg = "#E76551", bg = "#e76551" }
# Count
count_copied = { fg = "#12202B", bg = "#83A598" }
count_cut = { fg = "#EBDBB2", bg = "#264653" }
count_selected = { fg = "#12202B", bg = "#E76551" }
# Border
border_symbol = " "
# : }}}
# : Status {{{
[status]
separator_open = "🭁"
separator_close = "🭠"
separator_style = { bg = "#12202B", fg = "#F4A261" }
# Mode
mode_normal = { bg = "#F4A261", fg ="#08070C", bold = true }
mode_select = { bg = "#2A9D8F", fg ="#08070C", bold = true }
mode_unset = { bg = "#E76551", fg ="#08070C" ,bold = true }
# Progress
progress_label = { bold = true }
progress_normal = { fg = "#E9C46A", bg = "#08070C" }
progress_error = { fg = "#E76551", bg = "#08070C" }
# Permissions
permissions_t = { fg = "#E9C48A" }
permissions_w = { fg = "#E76551" }
permissions_x = { fg = "#2A9D8F" }
permissions_r = { fg = "#264653" }
permissions_s = { fg = "#EBDBB2" }
# : }}}
# : Select {{{
[select]
border = { fg = "#E9C46A" }
active = { fg = "#E76551", bold = true }
inactive = {}
# : }}}
# : Input {{{
[input]
border = { fg = "#E9C46A" }
value = { fg = "#EBDBB2"}
# : }}}
# : Completion {{{
[completion]
border = { fg = "#E9C46A", bg = "#12202B" }
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#E9C46A" }
title = {}
hovered = { fg = "#264653", underline = true }
# : }}}
# : Which {{{
[which]
cols = 3
mask = { bg = "#08070C" }
cand = { fg = "#E9C46A" }
rest = { fg = "#12202B" }
desc = { fg = "#EBDBB2" }
separator = " ▶ "
separator_style = { fg = "#EBDBB2" }
# : }}}
# : Help {{{
[help]
on = { fg = "#E9C46A" }
run = { fg = "#83A598" }
footer = { fg = "#08070C", bg = "#EBDBB2" }
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#83A598" }
title_warn = { fg = "#E9c46a" }
title_error = { fg = "#E76551" }
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#F4A261" },
# Media
{ mime = "{audio,video}/*", fg = "#264653" },
# Archives
{ mime = "application/{,g}zip", fg = "#E76551" },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#E76551" },
# Documents
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#83A588" },
# Special files
{ name = "*", is = "orphan", bg = "#504945" },
{ name = "*", is = "exec" , fg = "#2a9d8F" },
# Dummy files
{ name = "*", is = "dummy", bg = "#504945" },
{ name = "*/", is = "dummy", bg = "#504950" },
# Fallback
{ name = "*/", fg = "#e9c461" }
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -0,0 +1,448 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Sunset</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#12202B</string>
<key>caret</key>
<string>#572B9F</string>
<key>foreground</key>
<string>#E9C46A</string>
<key>invisibles</key>
<string>#504945</string>
<key>lineHighlight</key>
<string>#264653</string>
<key>selection</key>
<string>#264653</string>
<key>findHighlight</key>
<string>#264653</string>
<key>selectionBorder</key>
<string>#222218</string>
<key>gutterForeground</key>
<string>#504945</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comment</string>
<key>scope</key>
<string>comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#727169</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#83A598</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Number</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#2A9D8F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Built-in constant</string>
<key>scope</key>
<string>constant.language</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#2A9D8F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>User-defined constant</string>
<key>scope</key>
<string>constant.character, constant.other</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#2A9D8F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variable</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>#F4A261</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Ruby's @variable</string>
<key>scope</key>
<string>variable.other.readwrite.instance</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#F4A261</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String interpolation</string>
<key>scope</key>
<string>constant.character.escaped, constant.character.escape, string source, string source.ruby</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#491B4F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E76551</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#2A9D8F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage type</string>
<key>scope</key>
<string>storage.type</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#2A9D8F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Class name</string>
<key>scope</key>
<string>entity.name.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#264653</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inherited class</string>
<key>scope</key>
<string>entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E76551</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function name</string>
<key>scope</key>
<string>entity.name.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#75649D</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function argument</string>
<key>scope</key>
<string>variable.parameter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#007966</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag name</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#F4A261</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag attribute</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#E76551</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library function</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#264653</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library constant</string>
<key>scope</key>
<string>support.constant</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#7FB4CA</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library class/type</string>
<key>scope</key>
<string>support.type, support.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#7AA89F</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library variable</string>
<key>scope</key>
<string>support.other.variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#EDCFB9</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid</string>
<key>scope</key>
<string>invalid</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string/>
<key>foreground</key>
<string>#EDCFB9</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#717C7C</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON String</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#5F3A63</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.header</string>
<key>scope</key>
<string>meta.diff, meta.diff.header</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E87E44</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#E87E44</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#504945</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>diff.changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#504830</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>constant.numeric.line-number.find-in-files - match</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#50546D</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>entity.name.filename</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#019879</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>message.error</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#F01501</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Punctuation</string>
<key>scope</key>
<string>punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#264653</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Structure</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#4A1B42</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON String</string>
<key>scope</key>
<string>meta.structure.dictionary.value.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#ffffff</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Escape Characters</string>
<key>scope</key>
<string>constant.character.escape</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E76551</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Regular Expressions</string>
<key>scope</key>
<string>string.regexp</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#DE51AD</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>260540bf-9550-48ff-9b7c-dbf17b5ecd02</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>semanticClass</key>
<string>theme.dark.sunset</string>
</dict>
</plist>

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 - sxyazi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Himanshu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,47 @@
<div align="center">
<img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
</div>
<h3 align="center">
Tokyo Night Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
</h3>
## 👀 Preview
<img src="preview.png" width="600" />
## 🎨 Installation
### Using package manager
```bash
ya pack -a BennyOe/tokyo-night
```
### Manual install
```bash
# Linux/macOS
git clone https://github.com/BennyOe/tokyo-night.yazi.git ~/.config/yazi/flavors/tokyo-night.yazi
# Windows
git clone https://github.com/BennyOe/tokyo-night.yazi.git %AppData%\yazi\config\flavors\tokyo-night.yazi
```
## ⚙️ Usage
Add the these lines to your `theme.toml` configuration file to use it:
```toml
[flavor]
use = "tokyo-night"
# For Yazi 0.4 and above
dark = "tokyo-night"
```
## 📜 License
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.

View File

@ -0,0 +1,185 @@
# vim:fileencoding=utf-8:foldmethod=marker
# : Manager {{{
[manager]
cwd = { fg = "#7aa2f7" } # Blue
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#f7768e", bold = true, italic = true, underline = true } # Red
find_position = { fg = "#bb9af7", bg = "reset", bold = true, italic = true } # Magenta
# Marker
marker_copied = { fg = "#9ece6a", bg = "#9ece6a" } # Green
marker_cut = { fg = "#e0af68", bg = "#f7768e" } # Red
marker_marked = { fg = "#7aa2f7", bg = "#7dcfff" } # Cyan
marker_selected = { fg = "#e0af68", bg = "#e0af68" } # Yellow
# Tab
tab_active = { bg = "#282C34", fg = "#7aa2f7" } # Darkened background, Blue text
tab_inactive = {}
tab_width = 1
# Count
count_copied = { fg = "#414868", bg = "#9ece6a" } # Darkened black on Green
count_cut = { fg = "#414868", bg = "#e0af68" } # Darkened black on Yellow
count_selected = { fg = "#414868", bg = "#7aa2f7" } # Darkened black on Blue
# Border
border_symbol = "│"
border_style = { fg = "#414868" } # Darkened black
# : }}}
# : Mode {{{
[mode]
normal_main = { fg = "#414868", bg = "#7aa2f7", bold = true } # Darkened black on Blue
normal_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# Select mode
select_main = { fg = "#414868", bg = "#9ece6a", bold = true } # Darkened black on Green
select_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# Unset mode
unset_main = { fg = "#414868", bg = "#bb9af7", bold = true } # Darkened black on Magenta
unset_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# : }}}
# : Status bar {{{
[status]
sep_left = { open = "", close = "" }
sep_right = { open = "", close = "" }
separator_style = { fg = "#414868", bg = "#414868" } # Blue on Darkened black
# Progress
progress_label = { fg = "#a9b1d6", bold = true } # White
progress_normal = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
progress_error = { fg = "#f7768e", bg = "#414868" } # Red on Darkened black
# Permissions
perm_sep = { fg = "#7aa2f7" } # Blue
perm_type = { fg = "#9ece6a" } # Green
perm_read = { fg = "#e0af68" } # Yellow
perm_write = { fg = "#f7768e" } # Red
perm_exec = { fg = "#bb9af7" } # Magenta
# : }}}
# : Pick {{{
[pick]
border = { fg = "#7aa2f7" } # Blue
active = { fg = "#bb9af7", bold = true } # Magenta
inactive = {}
# : }}}
# : Input {{{
[input]
border = { fg = "#7aa2f7" } # Blue
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Completion {{{
[cmp]
border = { fg = "#7aa2f7" } # Blue
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#7aa2f7" } # Blue
title = {}
hovered = { fg = "#bb9af7", underline = true } # Magenta
# : }}}
# : Which {{{
[which]
mask = { bg = "#414868" } # Darkened black
cand = { fg = "#9ece6a" } # Green
rest = { fg = "#a9b1d6" } # White
desc = { fg = "#bb9af7" } # Magenta
separator = "  "
separator_style = { fg = "#626880" } # Darkened gray
# : }}}
# : Help {{{
[help]
on = { fg = "#9ece6a" } # Green
run = { fg = "#bb9af7" } # Magenta
hovered = { reversed = true, bold = true }
footer = { fg = "#a9b1d6", bg = "#c6d0f5" } # White on Light gray
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#9ece6a" } # Green
title_warn = { fg = "#f7768e" } # Red
title_error = { fg = "#e0af68" } # Yellow
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#e0af68" }, # Yellow
# Media
{ mime = "video/*", fg = "#f7768e" }, # Red
{ mime = "audio/*", fg = "#f7768e" }, # Red
# Archives
{ mime = "application/zip", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-tar", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-bzip*", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-bzip2", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-7z-compressed", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-rar", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-xz", fg = "#bb9af7" }, # Magenta
# Documents
{ mime = "application/doc", fg = "#9ece6a" }, # Green
{ mime = "application/pdf", fg = "#9ece6a" }, # Green
{ mime = "application/rtf", fg = "#9ece6a" }, # Green
{ mime = "application/vnd.*", fg = "#9ece6a" }, # Green
# Fallback
{ name = "*", fg = "#c6d0f5" }, # Light gray
{ name = "*/", fg = "#7aa2f7" } # Blue
]
# : }}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 KiB

File diff suppressed because it is too large Load Diff

17
.config/yazi/init.lua Normal file
View File

@ -0,0 +1,17 @@
-- ~/.config/yazi/init.lua
require("bookmarks"):setup({
last_directory = { enable = false, persist = false, mode = "dir" },
persist = "none",
desc_format = "full",
file_pick_mode = "hover",
custom_desc_input = false,
notify = {
enable = false,
timeout = 1,
message = {
new = "New bookmark '<key>' -> '<folder>'",
delete = "Deleted bookmark in '<key>'",
delete_all = "Deleted all bookmarks",
},
},
})

19
.config/yazi/keymap.toml Normal file
View File

@ -0,0 +1,19 @@
[[manager.prepend_keymap]]
on = [ "m" ]
run = "plugin bookmarks save"
desc = "Save current position as a bookmark"
[[manager.prepend_keymap]]
on = [ "'" ]
run = "plugin bookmarks jump"
desc = "Jump to a bookmark"
[[manager.prepend_keymap]]
on = [ "b", "d" ]
run = "plugin bookmarks delete"
desc = "Delete a bookmark"
[[manager.prepend_keymap]]
on = [ "b", "D" ]
run = "plugin bookmarks delete_all"
desc = "Delete all bookmarks"

19
.config/yazi/package.toml Normal file
View File

@ -0,0 +1,19 @@
[[plugin.deps]]
use = "dedukun/bookmarks"
rev = "95b2c58"
hash = "17a094653b7d0db4ac68ed531d2e1412"
[[flavor.deps]]
use = "BennyOe/tokyo-night"
rev = "695dac6"
hash = "a8f426ea0d9cb843b081d62ab01364c8"
[[flavor.deps]]
use = "gosxrgxx/flexoki-dark"
rev = "3e8cfba"
hash = "56a96293138f09da7fae25ee405a4393"
[[flavor.deps]]
use = "PinThePenguine/sunset"
rev = "181acd4"
hash = "cc4c39af7098f02c42fec223fc1fc967"

View File

@ -0,0 +1,19 @@
Copyright (c) 2024 dedukun
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,146 @@
# bookmarks.yazi
A [Yazi](https://github.com/sxyazi/yazi) plugin that adds the basic functionality of [vi-like marks](https://neovim.io/doc/user/motion.html#mark-motions).
https://github.com/dedukun/bookmarks.yazi/assets/25795432/9a9fe345-dd06-442e-99f1-8475ab22fad5
## Requirements
- [Yazi](https://github.com/sxyazi/yazi) v25.2.7+
## Features
- Create/delete bookmarks
- Custom Notifications
- `''` to go back to the previous folder
- Bookmarks persistence
## Installation
```sh
ya pack -a dedukun/bookmarks
```
## Import/Export bookmarks
This plugin uses [Yazi's DDS](https://yazi-rs.github.io/docs/dds/) for bookmark persistence, as such,
the bookmarks are saved in DDS's state file (`~/.local/state/yazi/.dds` on Linux and `C:\Users\USERNAME\AppData\Roaming\yazi\state\.dds` on Windows)
**_NOTE:_** This system may be used by other plugins that you have installed, so this file might have more data than just the bookmarks.
## Configuration
Add this to your `keymap.toml`:
```toml
[[manager.prepend_keymap]]
on = [ "m" ]
run = "plugin bookmarks save"
desc = "Save current position as a bookmark"
[[manager.prepend_keymap]]
on = [ "'" ]
run = "plugin bookmarks jump"
desc = "Jump to a bookmark"
[[manager.prepend_keymap]]
on = [ "b", "d" ]
run = "plugin bookmarks delete"
desc = "Delete a bookmark"
[[manager.prepend_keymap]]
on = [ "b", "D" ]
run = "plugin bookmarks delete_all"
desc = "Delete all bookmarks"
```
---
Additionally there are configurations that can be done using the plugin's `setup` function in Yazi's `init.lua`, i.e. `~/.config/yazi/init.lua`.
The following are the default configurations:
```lua
-- ~/.config/yazi/init.lua
require("bookmarks"):setup({
last_directory = { enable = false, persist = false, mode="dir" },
persist = "none",
desc_format = "full",
file_pick_mode = "hover",
custom_desc_input = false,
notify = {
enable = false,
timeout = 1,
message = {
new = "New bookmark '<key>' -> '<folder>'",
delete = "Deleted bookmark in '<key>'",
delete_all = "Deleted all bookmarks",
},
},
})
```
### `last_directory`
When enabled, a new bookmark is automatically created in `'` which allows the user to jump back to
the last directory.
There's also the option to enable persistence to this automatic bookmark.
Finally, there's a `mode` option with the following options:
| Value | Description |
| ------ | ------------------------------------------------------------ |
| `jump` | It saves the position before the last used mark |
| `mark` | It saves the last created mark |
| `dir` | Default, it saves the last visited directory (old behaviour) |
### `persist`
When enabled the bookmarks will persist, i.e. if you close and reopen Yazi they will still be
present.
There are three possible values for this option:
| Value | Description |
| ------ | -------------------------------------------------------------------------------------------------------------------- |
| `none` | The default value, i.e., no persistance |
| `all` | All the bookmarks are saved in persistent memory |
| `vim` | This mode emulates the vim global marks, i.e., only the bookmarks in upper case (A-Z) are saved to persistent memory |
### `desc_format`
The format for the bookmark description.
There are two possible values for this option:
| Value | Description |
| -------- | ----------------------------------------------------------------------------------------------- |
| `full` | The default, it shows the full path of the bookmark, i.e., the parent folder + the hovered file |
| `parent` | Only shows the parent folder of the bookmark |
### `file_pick_mode`
The mode for choosing which directory to bookmark.
There are two possible values for this option:
| Value | Description |
| -------- | ------------------------------------------------------------------- |
| `hover` | The default, it uses the path of the hovered file for new bookmarks |
| `parent` | Uses the path of the parent folder for new bookmarks |
### `notify`
When enabled, notifications will be shown when the user creates a new bookmark and deletes one or
all saved bookmarks.
By default the notification has a 1 second timeout that can be changed with `notify.timeout`.
Furthermore, you can customize the notification messages with `notify.message`.
For the `new` and `delete` messages, the `<key>` and `<folder>` keywords can be used, which will be replaced by the respective new/deleted bookmark's associated key and folder.
### `custom_desc_input`
When enabled, user can change description for new bookmark before it is saved.
By default the custom description input is filled with path.

View File

@ -0,0 +1,383 @@
--- @since 25.2.7
-- stylua: ignore
local SUPPORTED_KEYS = {
{ on = "0"}, { on = "1"}, { on = "2"}, { on = "3"}, { on = "4"},
{ on = "5"}, { on = "6"}, { on = "7"}, { on = "8"}, { on = "9"},
{ on = "A"}, { on = "B"}, { on = "C"}, { on = "D"}, { on = "E"},
{ on = "F"}, { on = "G"}, { on = "H"}, { on = "I"}, { on = "J"},
{ on = "K"}, { on = "L"}, { on = "M"}, { on = "N"}, { on = "O"},
{ on = "P"}, { on = "Q"}, { on = "R"}, { on = "S"}, { on = "T"},
{ on = "U"}, { on = "V"}, { on = "W"}, { on = "X"}, { on = "Y"}, { on = "Z"},
{ on = "a"}, { on = "b"}, { on = "c"}, { on = "d"}, { on = "e"},
{ on = "f"}, { on = "g"}, { on = "h"}, { on = "i"}, { on = "j"},
{ on = "k"}, { on = "l"}, { on = "m"}, { on = "n"}, { on = "o"},
{ on = "p"}, { on = "q"}, { on = "r"}, { on = "s"}, { on = "t"},
{ on = "u"}, { on = "v"}, { on = "w"}, { on = "x"}, { on = "y"}, { on = "z"},
}
local _send_notification = ya.sync(
function(state, message)
ya.notify {
title = "Bookmarks",
content = message,
timeout = state.notify.timeout,
}
end
)
local _get_real_index = ya.sync(function(state, idx)
for key, value in pairs(state.bookmarks) do
if value.on == SUPPORTED_KEYS[idx].on then
return key
end
end
return nil
end)
local _get_bookmark_file = ya.sync(function(state)
local folder = cx.active.current
if state.file_pick_mode == "parent" or not folder.hovered then
return { url = folder.cwd, is_parent = true }
end
return { url = folder.hovered.url, is_parent = false }
end)
local _generate_description = ya.sync(function(state, file)
-- if this is true, we don't have information about the folder, so just return the folder url
if file.is_parent then
return tostring(file.url)
end
if state.desc_format == "parent" then
return tostring(file.url:parent())
end
-- full description
return tostring(file.url)
end)
local _load_state = ya.sync(function(state)
ps.sub_remote("@bookmarks", function(body)
if not state.bookmarks and body then
state.bookmarks = {}
for _, value in pairs(body) do
table.insert(state.bookmarks, value)
end
end
end)
end)
local _save_state = ya.sync(function(state, bookmarks)
if not bookmarks then
ps.pub_to(0, "@bookmarks", nil)
return
end
local save_state = {}
if state.persist == "all" then
save_state = bookmarks
else -- VIM mode
local idx = 1
for _, value in pairs(bookmarks) do
-- Only save bookmarks in upper case keys
if string.match(value.on, "%u") then
save_state[idx] = value
idx = idx + 1
end
end
end
ps.pub_to(0, "@bookmarks", save_state)
end)
local _load_last = ya.sync(function(state)
ps.sub_remote("@bookmarks-last", function(body)
state.last_dir = body
if state.last_mode ~= "dir" then
ps.unsub_remote("@bookmarks-last")
end
end)
end)
local _save_last = ya.sync(function(state, persist, imediate)
local file = _get_bookmark_file()
local curr = {
on = "'",
desc = _generate_description(file),
path = tostring(file.url),
is_parent = file.is_parent,
}
if imediate then
state.curr_dir = nil
state.last_dir = curr
else
state.last_dir = state.curr_dir
state.curr_dir = curr
end
if persist and state.last_dir then
ps.pub_to(0, "@bookmarks-last", state.last_dir)
end
end)
local get_last_mode = ya.sync(function(state) return state.last_mode end)
local save_last_dir = ya.sync(function(state)
ps.sub("cd", function() _save_last(state.last_persist, false) end)
ps.sub("hover", function()
local file = _get_bookmark_file()
state.curr_dir.desc = _generate_description(file)
state.curr_dir.path = tostring(file.url)
end)
end)
local save_last_jump = ya.sync(function(state) _save_last(state.last_persist, true) end)
local save_last_mark = ya.sync(function(state) _save_last(state.last_persist, true) end)
local _is_custom_desc_input_enabled = ya.sync(function(state) return state.custom_desc_input end)
-- ***********************************************
-- **============= C O M M A N D S =============**
-- ***********************************************
local save_bookmark = ya.sync(function(state, idx, custom_desc)
local file = _get_bookmark_file()
state.bookmarks = state.bookmarks or {}
local _idx = _get_real_index(idx)
if not _idx then
_idx = #state.bookmarks + 1
end
local bookmark_desc = tostring(file.url)
if custom_desc then
bookmark_desc = tostring(custom_desc)
end
state.bookmarks[_idx] = {
on = SUPPORTED_KEYS[idx].on,
desc = bookmark_desc,
path = tostring(file.url),
is_parent = file.is_parent,
}
-- Custom sorting function
table.sort(state.bookmarks, function(a, b)
local key_a, key_b = a.on, b.on
-- Numbers first
if key_a:match("%d") and not key_b:match("%d") then
return true
elseif key_b:match("%d") and not key_a:match("%d") then
return false
end
-- Uppercase before lowercase
if key_a:match("%u") and key_b:match("%l") then
return true
elseif key_b:match("%u") and key_a:match("%l") then
return false
end
-- Regular alphabetical sorting
return key_a < key_b
end)
if state.persist then
_save_state(state.bookmarks)
end
if state.notify and state.notify.enable then
local message = state.notify.message.new
message, _ = message:gsub("<key>", state.bookmarks[_idx].on)
message, _ = message:gsub("<folder>", state.bookmarks[_idx].desc)
_send_notification(message)
end
if get_last_mode() == "mark" then
save_last_mark()
end
end)
local all_bookmarks = ya.sync(function(state, append_last_dir)
local bookmarks = {}
if state.bookmarks then
for _, value in pairs(state.bookmarks) do
table.insert(bookmarks, value)
end
end
if append_last_dir and state.last_dir then
table.insert(bookmarks, state.last_dir)
end
return bookmarks
end)
local delete_bookmark = ya.sync(function(state, idx)
if state.notify and state.notify.enable then
local message = state.notify.message.delete
message, _ = message:gsub("<key>", state.bookmarks[idx].on)
message, _ = message:gsub("<folder>", state.bookmarks[idx].desc)
_send_notification(message)
end
table.remove(state.bookmarks, idx)
if state.persist then
_save_state(state.bookmarks)
end
end)
local delete_all_bookmarks = ya.sync(function(state)
state.bookmarks = nil
if state.persist then
_save_state(nil)
end
if state.notify and state.notify.enable then
_send_notification(state.notify.message.delete_all)
end
end)
return {
entry = function(_, job)
local action = job.args[1]
if not action then
return
end
if action == "save" then
local key = ya.which { cands = SUPPORTED_KEYS, silent = true }
if key then
if _is_custom_desc_input_enabled() then
local value, event = ya.input {
title = "Save with custom description:",
position = { "top-center", y = 3, w = 60 },
value = tostring(_get_bookmark_file().url),
}
if event ~= 1 then
return
end
save_bookmark(key, value)
return
end
save_bookmark(key)
end
return
end
if action == "delete_all" then
return delete_all_bookmarks()
end
local bookmarks = all_bookmarks(action == "jump")
local selected = #bookmarks > 0 and ya.which { cands = bookmarks }
if not selected then
return
end
if action == "jump" then
if get_last_mode() == "jump" then
save_last_jump()
end
if bookmarks[selected].is_parent then
ya.manager_emit("cd", { bookmarks[selected].path })
else
ya.manager_emit("reveal", { bookmarks[selected].path })
end
elseif action == "delete" then
delete_bookmark(selected)
end
end,
setup = function(state, args)
if not args then
return
end
if type(args.last_directory) == "table" then
if args.last_directory.enable then
if args.last_directory.mode == "mark" then
state.last_persist = args.last_directory.persist
state.last_mode = "mark"
elseif args.last_directory.mode == "jump" then
state.last_persist = args.last_directory.persist
state.last_mode = "jump"
elseif args.last_directory.mode == "dir" then
state.last_persist = args.last_directory.persist
state.last_mode = "dir"
save_last_dir()
else
-- default
state.last_persist = args.last_directory.persist
state.last_mode = "dir"
save_last_dir()
end
if args.last_directory.persist then
_load_last()
end
end
end
if args.persist == "all" or args.persist == "vim" then
state.persist = args.persist
_load_state()
end
if args.desc_format == "parent" then
state.desc_format = "parent"
else
state.desc_format = "full"
end
if args.file_pick_mode == "parent" then
state.file_pick_mode = "parent"
else
state.file_pick_mode = "hover"
end
if type(args.custom_desc_input) == "boolean" then
state.custom_desc_input = args.custom_desc_input
end
state.notify = {
enable = false,
timeout = 1,
message = {
new = "New bookmark '<key>' -> '<folder>'",
delete = "Deleted bookmark in '<key>'",
delete_all = "Deleted all bookmarks",
},
}
if type(args.notify) == "table" then
if type(args.notify.enable) == "boolean" then
state.notify.enable = args.notify.enable
end
if type(args.notify.timeout) == "number" then
state.notify.timeout = args.notify.timeout
end
if type(args.notify.message) == "table" then
if type(args.notify.message.new) == "string" then
state.notify.message.new = args.notify.message.new
end
if type(args.notify.message.delete) == "string" then
state.notify.message.delete = args.notify.message.delete
end
if type(args.notify.message.delete_all) == "string" then
state.notify.message.delete_all = args.notify.message.delete_all
end
end
end
end,
}

3
.config/yazi/theme.toml Normal file
View File

@ -0,0 +1,3 @@
[flavor]
use = "sunset"
dark = "sunset"

14
.config/yazi/yazi.toml Normal file
View File

@ -0,0 +1,14 @@
[manager]
ratio = [1, 4, 3]
sort_by = "natural"
sort_sensitive = false
sort_reverse = false
sort_dir_first = true
sort_translit = false
linemode = "size"
show_hidden = true
show_symlink = true
scrolloff = 5
mouse_events = ["click", "scroll"]
# title_format = "Yazi: {cwd}"

View File

@ -25,7 +25,7 @@
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
; lg = !"git lg2" ; lg = !"git lg2"
tree = "forest --pretty=format:\"%C(red)%h %C(magenta)(%ar) %C(blue)%an %C(reset)%s\" --style=15 --reverse" amend = !git commit --amend --date=now --no-edit
lg = log --graph --pretty=slim --abbrev-commit --date=relative lg = log --graph --pretty=slim --abbrev-commit --date=relative
; lg date: sorted by date and with absolute dates ; lg date: sorted by date and with absolute dates
lgd = log --graph --pretty=slim --abbrev-commit --date=local --date-order lgd = log --graph --pretty=slim --abbrev-commit --date=local --date-order

View File

@ -1,3 +1,5 @@
# [![dotfiles](https://skillicons.dev/icons?i=apple,arch,plan9)](https://skillicons.dev) dotfiles # [![dotfiles](https://skillicons.dev/icons?i=apple,arch,plan9)](https://skillicons.dev) dotfiles
Do zarządzania konfiguracją używany jest [yadm]()