diff setup @ 743:2b0112948102 default tip

[vim] better viminfo location
author nanaya <me@nanaya.net>
date Mon, 03 Feb 2025 18:34:55 +0900
parents 3b001c615c36
children
line wrap: on
line diff
--- a/setup	Mon Feb 03 18:28:41 2025 +0900
+++ b/setup	Mon Feb 03 18:34:55 2025 +0900
@@ -133,8 +133,10 @@
   test "${1}" = "uninstall" && return
   shift
 
-  touch "${@}"
-  _echo "Ensured existence of ${*}"
+  _target="${HOME}/${1}"
+  mkdir -p "${_target%/*}"
+  touch "${_target}"
+  _echo "Ensured existence of ${_target}"
 }
 
 _vim_x() {
@@ -210,15 +212,16 @@
     _rc "${1}" "gitconfig" ".config/git/config"
     _rc "${1}" "gitignore_global" ".config/git/ignore"
     _rc "${1}" "hgrc" ".config/hg/hgrc"
-    _touch "${1}" "${HOME}/.config/hg/hgrc.local"
+    _touch "${1}" ".config/hg/hgrc.local"
     _rc "${1}" "hgignore_global" ".config/hg/ignore"
-    _touch "${1}" "${HOME}/.config/hg/ignore.local"
+    _touch "${1}" ".config/hg/ignore.local"
     _rc "${1}" "editrc" ".editrc"
     _rc "${1}" "inputrc" ".inputrc"
     _rc "${1}" "tmux.conf" ".config/tmux/tmux.conf"
     _vim_x "${1}" syntax
     _vim_packs "${1}"
     _rc "${1}" "vimrc" ".vim/vimrc"
+    _touch "${1}" ".local/state/vim/viminfo"
     _rc "${1}" "irbrc" ".config/irb/irbrc"
   ;;
   *)