Comments (10)
well, telescope.builtin.oldfiles() already shows me the files edited in chezmoi but opening them and editing doesn't sync the file.
I tried the autocmd in readme.md but couldn't make it to work.
from chezmoi.nvim.
Did you lazy load this plugin?
from chezmoi.nvim.
yes the plugin is loaded.
when i edit via :chezmoiedit
everything works fine but when i edit outside of :chezmoiedit
(for example opening a file directly with nvim nvim "C:\Users\asharaf\.local\share\chezmoi\dot_config\nvim\init.lua"
) then sync won't happen.
this is my config on windows:
return {
"xvzc/chezmoi.nvim",
lazy = false,
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("chezmoi").setup({
-- your configurations
edit = {
watch = true, -- Set true to automatically apply on save.
force = true, -- Set true to force apply. Works only when watch = true.
},
notification = {
on_open = true, -- vim.notify when start editing chezmoi-managed file.
on_apply = true, -- vim.notify on apply.
},
telescope = {
select = { "<CR>" },
},
})
-- Autocmd for Chezmoi
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("USERPROFILE") .. "/.local/share/chezmoi/*" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
end,
}
from chezmoi.nvim.
Maybe because your path string contains /
instead of \\
which is the path separator for windows system?
By the way, I need to tell you that it's not throughly tested on windows system.
from chezmoi.nvim.
still doesn't trigger the sync using \ (double back slash)
no problem, i will use :chezmoiedit
for now.
-- Autocmd for Chezmoi
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("USERPROFILE") .. "\\.local\\share\\chezmoi\\*" },
callback = function()
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
from chezmoi.nvim.
I see this issue is closed, but I was able to get the autocmd working with the following. I use scoop to install packages on Windows, so the path might be different for other scoop install methods.
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = {
(vim.fn.has 'win32' == 1 and os.getenv 'USERPROFILE' .. '/AppData/Local/chezmoi/*' or os.getenv 'HOME' .. '/.local/share/chezmoi/*'),
},
callback = function()
vim.schedule(require('chezmoi.commands.__edit').watch)
end,
})
from chezmoi.nvim.
i closed it becasue couldn't fix it. I wil test your snippet by tomorrow.
from chezmoi.nvim.
@joncrangle what is this folder? what do you have inside of it?
'/AppData/Local/chezmoi/*'
from chezmoi.nvim.
@joncrangle what is this folder? what do you have inside if it?
'/AppData/Local/chezmoi/*'
This is the directory in Windows that contains my chezmoi source files/templates. On Mac and Linux the directory for me is ~/.local/share/chezmoi
, but on Windows it's %USERPROFILE%/AppData/Local/chezmoi
(or %LOCALAPPDATA%/chezmoi
), I installed chezmoi on Windows with scoop so I'm not sure if the default directory is different with other installation methods.
from chezmoi.nvim.
i changed the path accordingly but still doesn't trigger the sync.
for now i use this keymap to edit the chezmoi fiels:
keymap.set("n", "<leader>fc", telescope.extensions.chezmoi.find_files, { desc = "Find chezmoi files" })
from chezmoi.nvim.
Related Issues (14)
- Error when running list on new setup. HOT 6
- Chezmoi vim and chezmoi nvim conflict together HOT 5
- Chezmoi script support HOT 3
- Question about `--watch` HOT 2
- Apply is not working as intended? - Question not issue HOT 3
- Applying only once when writing multiple buffers? HOT 3
- Exclude the `externals` file type from the telescope extension results HOT 2
- Why does Telescope chezmoi find_files show files in ~ not ~/.local/share/chezmoi HOT 3
- Treat all files in `chezmoi source-path` as Chezmoi files HOT 9
- question about netrw HOT 3
- using telescope HOT 2
- apply on save doesn't work HOT 1
- find_files picker is incompatible with select_tab_drop HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chezmoi.nvim.