Code Monkey home page Code Monkey logo

Comments (5)

azinsharaf avatar azinsharaf commented on June 12, 2024

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.

xvzc avatar xvzc commented on June 12, 2024

Did you lazy load this plugin?

from chezmoi.nvim.

azinsharaf avatar azinsharaf commented on June 12, 2024

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.

xvzc avatar xvzc commented on June 12, 2024

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.

azinsharaf avatar azinsharaf commented on June 12, 2024

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.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.