-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Chezmoi Pack | ||
|
||
This plugin pack does the following: | ||
|
||
- [chezmoi.vim](https://github.com/alker0/chezmoi.vim) for syntax highlighting of Chezmoi templates | ||
- [chezmoi.nvim](https://github.com/xvzc/chezmoi.nvim) searching and applying Chezmoi configurations | ||
- Adds the [TOML Language Pack](https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack/toml) for editing Chezmoi configuration file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
return { | ||
{ import = "astrocommunity.pack.toml" }, | ||
{ | ||
"alker0/chezmoi.vim", | ||
lazy = false, | ||
specs = { | ||
{ | ||
"AstroNvim/astrocore", | ||
opts = { | ||
options = { | ||
g = { | ||
["chezmoi#use_tmp_buffer"] = 1, | ||
["chezmoi#source_dir_path"] = os.getenv "HOME" .. "/.local/share/chezmoi", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"xvzc/chezmoi.nvim", | ||
opts = { | ||
edit = { | ||
watch = false, | ||
force = false, | ||
}, | ||
notification = { | ||
on_open = true, | ||
on_apply = true, | ||
on_watch = false, | ||
}, | ||
telescope = { | ||
select = { "<CR>" }, | ||
}, | ||
}, | ||
specs = { | ||
{ | ||
"AstroNvim/astrocore", | ||
---@type AstroCoreOpts | ||
opts = { | ||
autocmds = { | ||
chezmoi = { | ||
{ | ||
event = { "BufRead", "BufNewFile" }, | ||
pattern = { os.getenv "HOME" .. "/.local/share/chezmoi/*" }, | ||
callback = function() vim.schedule(require("chezmoi.commands.__edit").watch) end, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"nvim-telescope/telescope.nvim", | ||
optional = true, | ||
dependencies = { | ||
"xvzc/chezmoi.nvim", | ||
{ | ||
"AstroNvim/astrocore", | ||
opts = { | ||
mappings = { | ||
n = { | ||
["<Leader>f."] = { | ||
function() require("telescope").extensions.chezmoi.find_files() end, | ||
desc = "Find chezmoi config", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
opts = function() require("telescope").load_extension "chezmoi" end, | ||
}, | ||
}, | ||
{ | ||
"ibhagwan/fzf-lua", | ||
optional = true, | ||
dependencies = { | ||
{ | ||
"AstroNvim/astrocore", | ||
---@type AstroCoreOpts | ||
opts = { | ||
commands = { | ||
ChezmoiFzf = { | ||
function() | ||
require("fzf-lua").fzf_exec(require("chezmoi.commands").list(), { | ||
actions = { | ||
["default"] = function(selected, _) | ||
require("chezmoi.commands").edit { | ||
targets = { "~/" .. selected[1] }, | ||
args = { "--watch" }, | ||
} | ||
end, | ||
}, | ||
}) | ||
end, | ||
desc = "Search Chezmoi configuration with FZF", | ||
}, | ||
}, | ||
mappings = { | ||
n = { | ||
["<Leader>f."] = { function() vim.cmd.ChezmoiFzf() end, desc = "Find chezmoi config" }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"echasnovski/mini.icons", | ||
opts = { | ||
file = { | ||
[".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
[".chezmoiremove"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
[".chezmoiroot"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
[".chezmoiversion"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["bash.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["json.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["ps1.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["sh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["toml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["yaml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
["zsh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, | ||
}, | ||
}, | ||
}, | ||
} |