Created
July 10, 2023 04:39
-
-
Save funasoul/baa7383eced59947387e9ad0b5ecd4bc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# backup my nvim config | |
# backup my neovim config. you can restore the config by using restore-nvim.zsh | |
backup-nvim() { | |
local timestamp=$(date "+%Y-%m-%d-%H%M") | |
echo "Backup following directories" | |
echo " ~/.config/nvim => ~/.config/nvim.${timestamp}" | |
echo " ~/.local/share/nvim => ~/.local/share/nvim.${timestamp}" | |
echo " ~/.local/state/nvim => ~/.local/state/nvim.${timestamp}" | |
echo " ~/.cache/nvim => ~/.cache/nvim.${timestamp}" | |
# required | |
mv ~/.config/nvim ~/.config/nvim.${timestamp} | |
# optional but recommended | |
mv ~/.local/share/nvim ~/.local/share/nvim.${timestamp} | |
mv ~/.local/state/nvim ~/.local/state/nvim.${timestamp} | |
mv ~/.cache/nvim ~/.cache/nvim.${timestamp} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment