Skip to content

Commit

Permalink
refactor(LazyVim): reorganise chezmoi config into one file
Browse files Browse the repository at this point in the history
  • Loading branch information
Botond Kalocsai committed Jul 2, 2024
1 parent 73996cc commit f685ac6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
if vim.g.vscode then
-- vscode-nvim settings
else
-- Chezmoi
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { "{{.chezmoi.workingTree}}/**" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
desc = "Edit chezmoi managed files in the working tree.",
})

-- OpenCL file settings
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*.cl",
Expand Down
32 changes: 0 additions & 32 deletions home/dot_config/nvim/lua/plugins/chezmoi.lua

This file was deleted.

58 changes: 58 additions & 0 deletions home/dot_config/nvim/lua/plugins/chezmoi.lua.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
return {
{
"alker0/chezmoi.vim", -- For syntax highlighting
lazy = false,
init = function()
-- This option is required.
vim.g["chezmoi#use_tmp_buffer"] = true
-- add other options here if needed.
vim.g["chezmoi#source_dir_path"] = "{{.chezmoi.sourceDir}}"
end,
},
{
"xvzc/chezmoi.nvim", -- For chezmoi-managed file editing, applying
event = "LazyFile",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local telescope = require("telescope")
-- require("chezmoi").setup({
-- -- your configurations
-- })
telescope.load_extension("chezmoi")
end,
init = function()
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { "{{.chezmoi.workingTree}}/**" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
desc = "Edit chezmoi managed files in the working tree.",
})
end,
keys = {
{
"<leader>fz",
function()
require("telescope").extensions.chezmoi.find_files()
end,
desc = "Find Chezmoi Source File",
},
},
},
{
"nvimdev/dashboard-nvim",
opts = function(_, opts)
table.insert(
opts.config.center,
6,
{ -- Inserting chezmoi dashboard entry
action = require("telescope").extensions.chezmoi.find_files,
desc = " Chezmoi",
icon = opts.config.center[5].icon,
key = "z",
key_format = opts.config.center[5].key_format,
}
)
end,
},
}
16 changes: 0 additions & 16 deletions home/dot_config/nvim/lua/plugins/dashboard.lua

This file was deleted.

0 comments on commit f685ac6

Please sign in to comment.