feat: Migrate Vim and Tmux plugins to dedicated managers

Migrated Vim plugins from Git submodules to vim-plug, and Tmux plugins
to TPM (Tmux Plugin Manager).

This change:
- Updates `install.sh` to automatically install vim-plug and TPM.
- Modifies `dotfiles/vimrc` to configure plugins via vim-plug.
- Modifies `dotfiles/tmux.conf` to configure plugins via TPM.
- Removes all Vim and Tmux submodule entries from `.gitmodules`.
- Deletes the old submodule directories from the repository.

This streamlines plugin management, making updates easier and reducing
the complexity of the main `install.sh` script.
This commit is contained in:
David Tomaschik
2026-02-10 19:15:52 +00:00
parent 4c9038c33d
commit d9223c92dc
9 changed files with 90 additions and 82 deletions

25
.gitmodules vendored
View File

@@ -1,24 +1 @@
[submodule "dotfiles/vim/pack/matir/opt/solarized8"]
path = dotfiles/vim/pack/matir/opt/solarized8
url = https://github.com/lifepillar/vim-solarized8.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/surround"]
path = dotfiles/vim/pack/matir/start/surround
url = https://github.com/tpope/vim-surround.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/editorconfig"]
path = dotfiles/vim/pack/matir/start/editorconfig
url = https://github.com/editorconfig/editorconfig-vim.git
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/fugitive"]
path = dotfiles/vim/pack/matir/start/fugitive
url = https://github.com/tpope/vim-fugitive
fetchRecurseSubmodules = true
[submodule "dotfiles/vim/pack/matir/start/ctrlp"]
path = dotfiles/vim/pack/matir/start/ctrlp
url = https://github.com/ctrlpvim/ctrlp.vim.git
fetchRecurseSubmodules = true
[submodule "dotfiles/tmux/tmux-logging"]
path = dotfiles/tmux/tmux-logging
url = https://github.com/tmux-plugins/tmux-logging.git
fetchRecurseSubmodules = true

View File

@@ -67,12 +67,10 @@ bind M \
bind C-c run "tmux show-buffer | xsel -i -b" bind C-c run "tmux show-buffer | xsel -i -b"
bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer" bind C-v run "tmux set-buffer -- \"$(xsel -o -b)\"; tmux paste-buffer"
# Enable logging module, if available # List of plugins
run-shell "~/.tmux/tmux-logging/logging.tmux || true"
# Enable TMUX Plugin Manager
# install with:
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
run-shell "~/.tmux/plugins/tpm/tpm || true" set -g @plugin 'tmux-plugins/tmux-logging'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -9,6 +9,17 @@ if !isdirectory($HOME . '/.cache/vim/swap')
silent !mkdir -p ~/.cache/vim/{backup,swap,undo} silent !mkdir -p ~/.cache/vim/{backup,swap,undo}
endif endif
" vim-plug plugin list
call plug#begin('~/.vim/plugged')
Plug 'lifepillar/vim-solarized8'
Plug 'tpope/vim-surround'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
call plug#end()
" Make sure files get completely written, but don't write backups " Make sure files get completely written, but don't write backups
set nobackup set nobackup
set writebackup set writebackup

View File

@@ -52,14 +52,22 @@ prerequisites() {
fi fi
} }
install_dotfile_dir() { link_directory_contents() {
local SRCDIR="${1}" local SRCDIR="${1}"
local dotfile local DESTDIR="${2}"
local submodule_prune="$(git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \ local PREFIX="${3}"
local file
local submodule_prune=""
# Submodule logic only applies when we are installing dotfiles (PREFIX=".")
if [[ "${PREFIX}" == "." ]]; then
submodule_prune="$(git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \
awk '{print $2}' | \ awk '{print $2}' | \
while read -r submod ; do while read -r submod ; do
echo -n " -o -path ${BASEDIR}/${submod}" echo -n " -o -path ${BASEDIR}/${submod}"
done)" done)"
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
find "${SRCDIR}" \( -name .git -o \ find "${SRCDIR}" \( -name .git -o \
-name install.sh -o \ -name install.sh -o \
@@ -67,16 +75,19 @@ install_dotfile_dir() {
-name .gitignore \ -name .gitignore \
${submodule_prune} \) \ ${submodule_prune} \) \
-prune -o ${FINDTYPE} f -print | \ -prune -o ${FINDTYPE} f -print | \
while read -r dotfile ; do while read -r file ; do
local TARGET="${HOME}/.${dotfile#"${SRCDIR}"/}" local TARGET="${DESTDIR}/${PREFIX}${file#"${SRCDIR}"/}"
mkdir -p "$(dirname "${TARGET}")" mkdir -p "$(dirname "${TARGET}")"
ln -s -f "${dotfile}" "${TARGET}" ln -s -f "${file}" "${TARGET}"
done done
# Submodule logic only applies when we are installing dotfiles (PREFIX=".")
if [[ "${PREFIX}" == "." ]]; then
git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \ git -C "${BASEDIR}" submodule status -- "${SRCDIR}" 2>/dev/null | \
awk '{print $2}' | \ awk '{print $2}' | \
while read -r submodule ; do while read -r submodule ; do
local FULLNAME="${BASEDIR}/${submodule}" local FULLNAME="${BASEDIR}/${submodule}"
local TARGET="${HOME}/.${FULLNAME#"${SRCDIR}"/}" local TARGET="${DESTDIR}/${PREFIX}${FULLNAME#"${SRCDIR}"/}"
mkdir -p "$(dirname "${TARGET}")" mkdir -p "$(dirname "${TARGET}")"
if [[ -L "${TARGET}" ]] ; then if [[ -L "${TARGET}" ]] ; then
if [[ "$(readlink "${TARGET}")" != "${FULLNAME}" ]] ; then if [[ "$(readlink "${TARGET}")" != "${FULLNAME}" ]] ; then
@@ -88,18 +99,7 @@ install_dotfile_dir() {
ln -s -f "${FULLNAME}" "${TARGET}" ln -s -f "${FULLNAME}" "${TARGET}"
fi fi
done done
} fi
install_basic_dir() {
local SRCDIR="${1}"
local DESTDIR="${2}"
local file
find "${SRCDIR}" \( -name .git -o -name README.md -o -name .gitignore \) -prune -o ${FINDTYPE} f -print | \
while read -r file ; do
local TARGET="${DESTDIR}/${file#"${SRCDIR}"/}"
mkdir -p "$(dirname "${TARGET}")"
ln -s -f "${file}" "${TARGET}"
done
} }
ssh_key_already_installed() { ssh_key_already_installed() {
@@ -237,14 +237,14 @@ verbose() {
# Operations # Operations
install_dotfiles() { install_dotfiles() {
install_dotfile_dir "${BASEDIR}/dotfiles" link_directory_contents "${BASEDIR}/dotfiles" "${HOME}" "."
if [[ -d "${BASEDIR}/local_dotfiles" ]] ; then if [[ -d "${BASEDIR}/local_dotfiles" ]] ; then
install_dotfile_dir "${BASEDIR}/local_dotfiles" link_directory_contents "${BASEDIR}/local_dotfiles" "${HOME}" "."
fi fi
if [[ -d "${BASEDIR}/dotfile_overlays" ]] ; then if [[ -d "${BASEDIR}/dotfile_overlays" ]] ; then
for dotfiledir in "${BASEDIR}/dotfile_overlays/"* ; do for dotfiledir in "${BASEDIR}/dotfile_overlays/"* ; do
if [[ -d "${dotfiledir}" ]] ; then if [[ -d "${dotfiledir}" ]] ; then
install_dotfile_dir "${dotfiledir}" link_directory_contents "${dotfiledir}" "${HOME}" "."
fi fi
done done
fi fi
@@ -254,14 +254,41 @@ install_main() {
if [[ -d "${BASEDIR}/.git" && have_command git ]] ; then if [[ -d "${BASEDIR}/.git" && have_command git ]] ; then
if [[ -z "$(git -C "${BASEDIR}" status --porcelain)" ]]; then if [[ -z "$(git -C "${BASEDIR}" status --porcelain)" ]]; then
git -C "${BASEDIR}" pull --ff-only || true git -C "${BASEDIR}" pull --ff-only || true
[[ "$MINIMAL" = 1 ]] || \
git -C "${BASEDIR}" submodule update --init --recursive --depth 1
else else
echo "Skipping self-update: repository has local changes." >&2 echo "Skipping self-update: repository has local changes." >&2
fi fi
fi fi
[[ "$MINIMAL" = 1 ]] || { [[ "$MINIMAL" = 1 ]] || {
prerequisites prerequisites
# Install vim-plug if not already present
local VIM_PLUG_URL="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
local VIM_AUTOLOAD_DIR="${HOME}/.vim/autoload"
local VIM_PLUG_FILE="${VIM_AUTOLOAD_DIR}/plug.vim"
if [[ ! -f "${VIM_PLUG_FILE}" ]]; then
verbose "Installing vim-plug..."
mkdir -p "${VIM_AUTOLOAD_DIR}"
if have_command curl; then
curl -fLo "${VIM_PLUG_FILE}" --create-dirs "${VIM_PLUG_URL}"
else
echo "Error: curl not found. Cannot install vim-plug." >&2
fi
fi
# Install TPM (Tmux Plugin Manager) if not already present
local TPM_DIR="${HOME}/.tmux/plugins/tpm"
local TPM_REPO="https://github.com/tmux-plugins/tpm"
if [[ ! -d "${TPM_DIR}" ]]; then
verbose "Installing TPM (Tmux Plugin Manager)..."
if have_command git; then
git clone "${TPM_REPO}" "${TPM_DIR}"
else
echo "Error: git not found. Cannot install TPM." >&2
fi
fi
# try to update dotfile overlays # try to update dotfile overlays
if [[ -d "${BASEDIR}/dotfile_overlays" ]] ; then if [[ -d "${BASEDIR}/dotfile_overlays" ]] ; then
for dotfiledir in "${BASEDIR}/dotfile_overlays/"* ; do for dotfiledir in "${BASEDIR}/dotfile_overlays/"* ; do
@@ -273,7 +300,7 @@ install_main() {
fi fi
} }
install_dotfiles install_dotfiles
install_basic_dir "${BASEDIR}/bin" "${HOME}/bin" link_directory_contents "${BASEDIR}/bin" "${HOME}/bin" ""
[[ "$INSTALL_KEYS" = 1 ]] && install_keys [[ "$INSTALL_KEYS" = 1 ]] && install_keys
save_prefs save_prefs
setup_git_email setup_git_email