Clean up structure of dotfiles

This commit is contained in:
Hans Goor 2024-03-27 19:16:28 +01:00
parent eaf9c23a97
commit a8db391070
Signed by: eyedevelop
SSH key fingerprint: SHA256:Td89veptDEwCV8J3fjqnknNk7SbwzedYhauyC2nFBYg
15 changed files with 37 additions and 8 deletions

4
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "tmux/.tmux/plugins/tpm"] [submodule "tmux/dot-tmux/plugins/tpm"]
path = tmux/.tmux/plugins/tpm path = tmux/dot-tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm url = https://github.com/tmux-plugins/tpm

31
install.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
function do_stow() {
local package="$1"
local opts=( "--dotfiles" "--dir" "${DOTFILES_DIR}" )
if [[ "$#" -ge 2 ]]; then
opts+=( "--target" "$2" )
fi
stow "${opts[@]}" "$package"
}
set -eo pipefail
DOTFILES_DIR="$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")"
TARGET_DIR="$HOME"
if ! command -v stow &> /dev/null; then
echo "[!] Stow is not installed!"
exit 1
fi
# Install SSH separately, as it requres a different target.
do_stow ssh "${TARGET_DIR}/.ssh"
do_stow tmux
do_stow git
do_stow zsh
do_stow nvim "${TARGET_DIR}/.config"
echo "[+] Installed!"

View file

@ -1 +0,0 @@
plugins/

2
tmux/dot-tmux/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
plugins/*
!plugins/tpm

View file

@ -70,7 +70,7 @@ zstyle ':omz:update' mode auto # update automatically without asking
# Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=(git) plugins=()
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
@ -105,7 +105,4 @@ zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.*' insert-sections true zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:man:*' menu yes select zstyle ':completion:*:man:*' menu yes select
# Auto start tmux alias vim="nvim"
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ] && [ -z "$SSH_CONNECTION" ]; then
exec tmux
fi