summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-19 19:59:18 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-19 19:59:18 +0200
commit30b733851b17c2786a3340bff017c8ef0e057de7 (patch)
tree3ba823da5c276bc8c3a5748a10b3184c16720054 /.local
parent727591a688c5b3b7c19d77e3c2eba49447e04f72 (diff)
downloaddotfiles-30b733851b17c2786a3340bff017c8ef0e057de7.tar.gz
dotfiles-30b733851b17c2786a3340bff017c8ef0e057de7.zip
feat(dotfiles): add reinstall-nvim subcommand
- New 'dotfiles reinstall-nvim': clean rebuild of nvim from the currently checked-out submodule tag (prompted), independent of sync's version check. - Fix build_and_install_nvim: rm targeted $build_dir/build (install prefix, nonexistent) instead of the real build tree; now clears $src_dir/{build,.deps} so rebuilds are from scratch. sync only worked before because a new tag changed sources. - Add reinstall-nvim to the _comp_dotfiles completion.
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/dotfiles11
-rw-r--r--.local/share/dotfiles/dotfiles_on.env2
2 files changed, 10 insertions, 3 deletions
diff --git a/.local/bin/dotfiles b/.local/bin/dotfiles
index 40855f7..d29f4fe 100755
--- a/.local/bin/dotfiles
+++ b/.local/bin/dotfiles
@@ -47,7 +47,7 @@ sync_mdformat() {
build_and_install_nvim() {
local src_dir="$HOME/.local/share/dotfiles/deps/neovim"
local build_dir="$HOME/.local/share/nvim"
- rm -rf "$build_dir/build/"
+ rm -rf "$src_dir/build/" "$src_dir/.deps/"
make \
--directory="$src_dir" \
CMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -76,6 +76,12 @@ sync_nvim() {
fi
}
+reinstall_nvim() {
+ if prompt_for_install "Rebuild nvim from source"; then
+ build_and_install_nvim
+ fi
+}
+
case ${1:-} in
sync)
declare deps=(
@@ -105,10 +111,11 @@ sync)
sync_nvim
sync_mdformat
;;
+reinstall-nvim) reinstall_nvim ;;
on) clipboard_hint "source $HOME/.local/share/dotfiles/dotfiles_on.env" ;;
off) clipboard_hint "source $HOME/.local/share/dotfiles/dotfiles_off.env" ;;
*)
- echo "usage: dotfiles {sync|on|off}"
+ echo "usage: dotfiles {sync|reinstall-nvim|on|off}"
exit 1
;;
esac
diff --git a/.local/share/dotfiles/dotfiles_on.env b/.local/share/dotfiles/dotfiles_on.env
index f02b9f4..99c6fdb 100644
--- a/.local/share/dotfiles/dotfiles_on.env
+++ b/.local/share/dotfiles/dotfiles_on.env
@@ -1,6 +1,6 @@
export GIT_DIR="$DOTFILES_DIR" GIT_WORK_TREE="$HOME"
function _comp_dotfiles() {
- COMPREPLY=(sync on off)
+ COMPREPLY=(sync reinstall-nvim on off)
}
complete -F _comp_dotfiles dotfiles