aboutsummaryrefslogtreecommitdiffhomepage
path: root/sync.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2022-12-16 09:50:54 +0900
committernsfisis <nsfisis@gmail.com>2022-12-16 09:50:54 +0900
commit28e97c03a8c11fd8939bc93017004f93882421e6 (patch)
treedd9c280f219909f910bbe3817eec354220e35c92 /sync.sh
parent189a160b5d3aa7d4e6e5a191fc973005a4b57544 (diff)
downloaddotfiles-28e97c03a8c11fd8939bc93017004f93882421e6.tar.gz
dotfiles-28e97c03a8c11fd8939bc93017004f93882421e6.tar.zst
dotfiles-28e97c03a8c11fd8939bc93017004f93882421e6.zip
misc: add sync.sh
Diffstat (limited to 'sync.sh')
-rwxr-xr-xsync.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/sync.sh b/sync.sh
new file mode 100755
index 0000000..9a487aa
--- /dev/null
+++ b/sync.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Neovim {{{1
+if type nvim >/dev/null 2>&1; then
+ packer_nvim_dir="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/packer/opt/packer.nvim
+ nvim_conf_dir="${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
+ if [ -d "$packer_nvim_dir" -a -d "$nvim_conf_dir" ]; then
+ echo "neovim: compile"
+ nvim --headless -u "$nvim_conf_dir/init.mini.lua" -c 'autocmd User PackerCompileDone quitall' -c 'PackerCompile'
+ echo "neovim: sync"
+ nvim --headless -u "$nvim_conf_dir/init.mini.lua" -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
+ fi
+fi
+
+# Bat {{{1
+if type bat >/dev/null 2>&1; then
+ echo "bat: rebuild cache"
+ bat cache --clear && bat cache --build
+fi
+
+# }}}
+# vim: foldmethod=marker