lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 9ed6f1d 7/7: Rework zsh and vim configuration


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 9ed6f1d 7/7: Rework zsh and vim configuration for centos; mark common block #9
Date: Mon, 25 May 2020 18:46:14 -0400 (EDT)

branch: master
commit 9ed6f1d2aeccabc4aa6374e89c7551b6b39086c4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Rework zsh and vim configuration for centos; mark common block #9
    
    * install_centos.sh: Removed "experimental" configuration for root.
    Similar commands for the normal user always failed, and were recently
    removed. This was the wrong place to configure packages that hadn't
    been installed for users that hadn't been created.
    
    * lmi_setup_21.sh: Marked reusable block #9.
    
    * install_centos_1.sh: Copied block #9 from 'lmi_setup_21.sh'.
    Eventually it should be factored out.
---
 install_centos.sh   | 11 -----------
 install_centos_1.sh | 36 ++++++++++++++++++++++++++++++++++++
 lmi_setup_21.sh     |  6 ++++--
 3 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/install_centos.sh b/install_centos.sh
index a8b49bc..d623225 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -121,17 +121,6 @@ cp -a /tmp/schroot_env /srv/chroot/centos7lmi/tmp
 cp -a lmi_setup_*.sh   /srv/chroot/centos7lmi/tmp
 cp -a install_centos_* /srv/chroot/centos7lmi/tmp
 
-cp -a ~/.vimrc /srv/chroot/centos7lmi/root/.vimrc
-
-# Experimentally, instead of this:
-# cp -a ~/.zshrc /srv/chroot/centos7lmi/root/.zshrc
-# cp -a ~/.zshrc /srv/chroot/centos7lmi/home/"${NORMAL_USER}"/.zshrc
-# do this:
-wget -N -nv "${GIT_URL_BASE}"/gwc/.zshrc
-cp -a ~/.zshrc /srv/chroot/centos7lmi/root/.zshrc
-# If that works well, then treat vim configuration the same way,
-# here and elsewhere.
-
 # BEGIN ./lmi_setup_13.sh
 CACHEDIR=/var/cache/"${CODENAME}"
 mkdir -p "${CACHEDIR}"
diff --git a/install_centos_1.sh b/install_centos_1.sh
index e27dc65..59ea148 100755
--- a/install_centos_1.sh
+++ b/install_centos_1.sh
@@ -31,6 +31,42 @@ assert_not_chrooted
 
 ./lmi_setup_05c.sh
 ./lmi_setup_07r.sh
+
+# BEGIN ./lmi_setup_09.sh
+# Configure zsh, for root and normal users.
+
+wget -N -nv "${GIT_URL_BASE}"/gwc/.zshrc
+mv .zshrc ~
+cp -a ~/.zshrc /home/"${NORMAL_USER}"/.zshrc
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.zshrc
+
+# Configure vim. Rather than trying to split its contents between
+# '~/.vimrc' and '/etc/vim/vimrc.local', use '~/.vimrc' for all
+# customizations and copy that file for the normal user too.
+
+wget -N -nv "${GIT_URL_BASE}"/gwc/.vimrc
+mv .vimrc ~
+cp -a ~/.vimrc /home/"${NORMAL_USER}"/.vimrc
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vimrc
+
+# Without this, 'zg' gives an error message; with it, vim creates a
+# spellfile the first time 'zg' is used, if none already exists.
+mkdir ~/.vim
+mkdir /home/"${NORMAL_USER}"/.vim
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim
+# It's a much better idea to copy a mature spellfile hither:
+wget -N -nv "${GIT_URL_BASE}"/gwc/.vim/spell/en.utf-8.add
+mkdir ~/.vim/spell
+mv en.utf-8.add ~/.vim/spell/en.utf-8.add
+mkdir /home/"${NORMAL_USER}"/.vim/spell
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim/spell
+cp -a ~/.vim/spell/en.utf-8.add /home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
+chown "${NORMAL_USER}":"${NORMAL_GROUP}" 
/home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
+# and then (imperatively) run this command:
+vim -es -c ':mkspell! ~/.vim/spell/en.utf-8.add' -c ':q'
+# which will be repeated later for the normal user.
+# END   ./lmi_setup_09.sh
+
 ./lmi_setup_10r.sh
 ./lmi_setup_11.sh
 
diff --git a/lmi_setup_21.sh b/lmi_setup_21.sh
index 9ae479d..bb07589 100755
--- a/lmi_setup_21.sh
+++ b/lmi_setup_21.sh
@@ -94,7 +94,8 @@ EOF
 patch --dry-run --strip=0 --directory=/ 
</home/"${NORMAL_USER}"/ltmain.sh.patch \
  && patch --strip=0 --directory=/ </home/"${NORMAL_USER}"/ltmain.sh.patch
 
-# Configure zsh, for root as well as the user configured above.
+# BEGIN ./lmi_setup_09.sh
+# Configure zsh, for root and normal users.
 
 wget -N -nv "${GIT_URL_BASE}"/gwc/.zshrc
 mv .zshrc ~
@@ -125,7 +126,8 @@ cp -a ~/.vim/spell/en.utf-8.add 
/home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
 chown "${NORMAL_USER}":"${NORMAL_GROUP}" 
/home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
 # and then (imperatively) run this command:
 vim -es -c ':mkspell! ~/.vim/spell/en.utf-8.add' -c ':q'
-# which will be repeated below in the user chroot.
+# which will be repeated later for the normal user.
+# END   ./lmi_setup_09.sh
 
 # Enable stable and security upgrades--see:
 #    https://www.debian.org/releases/stretch/amd64/apds03.html.en#idm4504



reply via email to

[Prev in Thread] Current Thread [Next in Thread]