Add NvChadUpdate command and shortcut for it

map leader+uu to it

summary of what it does:

first ask the user for confirmation and tell that the updater is gonna run git reset --hard in config repo and chadrc will be restored

take backup of chadrc in a lua string and locally in a file with chadrc.bak.(random numbers)

git reset on config dir and git pull

whether success or error, restore the chadrc file

if restore fails, then print backup file path

for more deep understanding, read the comments in utils.lua
This commit is contained in:
Akianonymus
2021-08-18 10:45:27 +05:30
committed by siduck76
parent 7753e03b9e
commit 4801ec86f1
4 changed files with 87 additions and 0 deletions

View File

@@ -141,6 +141,7 @@ M.mappings = {
copywhole_file = "<C-a>",
toggle_linenr = "<leader>n", -- show or hide line number
theme_toggle = "<leader>x",
update_nvchad = "<leader>uu",
},
}