Skip to content

Commit

Permalink
feat(yazi): Add plugins for better experience
Browse files Browse the repository at this point in the history
Auto install and update plugins.
  • Loading branch information
5ouma committed Dec 10, 2024
1 parent 32b37bf commit 3ca211b
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
"datasourceTemplate": "github-releases",
"depNameTemplate": "charmbracelet/gum",
"extractVersionTemplate": "v(?<version>.*)"
},
{
"customType": "regex",
"fileMatch": ["yazi/package.toml"],
"matchStrings": ["use = \"?<depName>\"", "rev = \"?<currentDigest>\""],
"currentValueTemplate": "main",
"packageNameTemplate": "https://github.com/<depName>",
"datasourceTemplate": "git-refs"
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: 🔨 Install tools via Homebrew
run: |
rm -fv /Library/Frameworks/Python.framework/Versions/3.12/bin/{2to3-3.12,idle3.12,pydoc3.12,python3.12,python3.12-config}
brew install atuin gitlint mackup mise pre-commit sheldon vim zoxide zsh
brew install atuin gitlint mackup mise pre-commit sheldon vim yazi zoxide zsh
- name: 🍎 Install macOS tools via Homebrew
if: ${{ matrix.os == 'macOS-14' }}
Expand Down
15 changes: 8 additions & 7 deletions config/topgrade/.config/topgrade/topgrade.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,41 @@ autoremove = true
repos = ["~/*", "~/ghq/*/*/*"]

[commands]
"Jetpack" = "vim +Jetpack +qall"
"Shortcuts" = """
Jetpack = "vim +Jetpack +qall"
Shortcuts = """
if (type osascript &>/dev/null); then
osascript -e 'tell app "Shortcuts" to run shortcut "Backup"' -e 'tell app "Shortcuts" to quit'
else
printf '\\033[33;1mSkipped\\033[m\n'
fi
"""
"lporg" = """
lporg = """
if (type lporg &>/dev/null); then
lporg save -c="$data/lporg.yml"
else
printf '\\033[33;1mSkipped\\033[m\n'
fi
"""
"mackup" = """
mackup = """
if (mackup -n backup &>/dev/null); then
mackup -f backup
else
printf '\\033[33;1mSkipped\\033[m\n'
fi
"""
"mise" = "mise plugins update && mise upgrade"
"mksei" = """
mise = "mise plugins update && mise upgrade"
mksei = """
if (type mksei &>/dev/null); then
mksei save "$data/keyboard_shortcuts.json"
else
printf '\\033[33;1mSkipped\\033[m\n'
fi
"""
"mli" = """
mli = """
if (type mli &>/dev/null); then
mli save -f --file="$data/login_items.json"
else
printf '\\033[33;1mSkipped\\033[m\n'
fi
"""
yazi = "ya pack -i"
2 changes: 2 additions & 0 deletions config/yazi/.config/yazi/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require("full-border"):setup()
require("git"):setup()
6 changes: 6 additions & 0 deletions config/yazi/.config/yazi/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[plugin]
deps = [
{ use = "yazi-rs/plugins:full-border", rev = "ec97f88" },
{ use = "yazi-rs/plugins:git", rev = "ec97f88" },
{ use = "Reledia/glow", rev = "c2ed51e" },
]
18 changes: 16 additions & 2 deletions config/yazi/.config/yazi/yazi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ sort_by = "natural"
sort_sensitive = true
sort_reverse = false
show_hidden = true
linemode = "size"

[opener]
edit = [
{ run = 'vim "$@"', desc = "Vim", block = true },
{ run = 'code "$@"', desc = "VSCode" },
{ run = 'vim "$@"', desc = "Vim", block = true },
{ run = 'code "$@"', desc = "VS Code" },
]

[plugin]
prepend_previewers = [{ name = "*.md", run = "glow" }]

[[plugin.prepend_fetchers]]
id = "git"
name = "*"
run = "git"

[[plugin.prepend_fetchers]]
id = "git"
name = "*/"
run = "git"
5 changes: 5 additions & 0 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ installVimPlugins() {
gum run 'Building a binary of vim-lumen...' -- vim +qall!
} && run 'installVimPlugins' '## 🖌 Install Vim plugins'

installYaziPlugins() {
[ -d "$XDG_DATA_HOME/yazi/packages" ] && skip
ya pack -i
} && run 'installYaziPlugins' '## 🐤 Install Yazi plugins'

#==================================================[ Done! ]==================================================#

if ($executed); then
Expand Down

0 comments on commit 3ca211b

Please sign in to comment.