From cc839e05c2a678ed531af6d64c78c89760aca2da Mon Sep 17 00:00:00 2001 From: Constantin Simonis Date: Wed, 28 May 2025 20:51:05 +0200 Subject: [PATCH] feat: add zsh plugins and update configuration files --- .alias.d/.alias.d | 1 - .gitignore | 5 +++-- .gitmodules | 9 +++++++++ .zshrc | 17 +++++++++++------ install | 16 ++++++++++++++++ setup | 9 ++++++++- zsh/plugins/zsh-autosuggestions | 1 + zsh/plugins/zsh-syntax-highlighting | 1 + zsh/themes/powerlevel10k | 1 + 9 files changed, 50 insertions(+), 10 deletions(-) delete mode 120000 .alias.d/.alias.d create mode 100644 .gitmodules create mode 100644 install create mode 160000 zsh/plugins/zsh-autosuggestions create mode 160000 zsh/plugins/zsh-syntax-highlighting create mode 160000 zsh/themes/powerlevel10k diff --git a/.alias.d/.alias.d b/.alias.d/.alias.d deleted file mode 120000 index b1d5277..0000000 --- a/.alias.d/.alias.d +++ /dev/null @@ -1 +0,0 @@ -/home/csimonis/.dotfiles/.alias.d \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3e111d3..3ea46b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ /* !setup - +!zsh/ !.gitignore !.alias.d/ !.config/ @@ -10,4 +10,5 @@ !.p10k.zsh !.zshrc !.zshenv.template -!.profile \ No newline at end of file +!.profile +!install \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..159d64d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "zsh/plugins/zsh-autosuggestions"] + path = zsh/plugins/zsh-autosuggestions + url = https://github.com/zsh-users/zsh-autosuggestions +[submodule "zsh/plugins/zsh-syntax-highlighting"] + path = zsh/plugins/zsh-syntax-highlighting + url = https://github.com/zsh-users/zsh-syntax-highlighting +[submodule "zsh/themes/powerlevel10k"] + path = zsh/themes/powerlevel10k + url = https://github.com/romkatv/powerlevel10k diff --git a/.zshrc b/.zshrc index 4b6ac76..ebbcbf5 100644 --- a/.zshrc +++ b/.zshrc @@ -5,6 +5,16 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +# Set custom Zsh plugin path +export ZSH_CUSTOM="$HOME/dotfiles/zsh" + +# Load plugins +source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +# Powerlevel10k theme +source $ZSH_CUSTOM/themes/powerlevel10k/powerlevel10k.zsh-theme + # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH @@ -108,9 +118,6 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -#source <(curl -s https://cdn.simonis.lol/all.sh) -#source <(curl -s https://cdn.simonis.lol/composer.sh) -#source <(curl -s https://cdn.simonis.lol/git.sh) # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh @@ -122,13 +129,11 @@ source $HOME/.zshenv eval "$(direnv hook zsh)" -source /home/csimonis/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - # Load Angular CLI autocompletion. source <(ng completion script) # bun completions -[ -s "/home/csimonis/.bun/_bun" ] && source "/home/csimonis/.bun/_bun" +[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun" # bun export BUN_INSTALL="$HOME/.bun" diff --git a/install b/install new file mode 100644 index 0000000..176df5e --- /dev/null +++ b/install @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +apt update +apt upgrade -yqq +apt install -yqq \ + git \ + zsh \ + curl \ + bat \ + ripgrep + +curl https://sh.rustup.rs -sSf | sh +curl -sfL https://direnv.net/install.sh | bash +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + +cargo install exa \ No newline at end of file diff --git a/setup b/setup index e0b0c91..08b9956 100755 --- a/setup +++ b/setup @@ -1,5 +1,11 @@ #!/usr/bin/env bash -sed -i -e 's/\r$//' ~/.dotfiles/* +#sed -i -e 's/\r$//' ~/dotfiles/* +set -e + +echo "[+] Cloning submodules..." +git submodule update --init --recursive + +echo "[+] Creating Gitconfigs..." ( for config in $PWD/.gitconfig.d/*.gitconfig; do @@ -8,6 +14,7 @@ sed -i -e 's/\r$//' ~/.dotfiles/* done; ) > "$HOME/.gitconfig" +echo "[+] Creating symlinks..." ln -sf "$PWD/.zshrc" "$HOME/.zshrc" ln -sf "$PWD/.p10k.zsh" "$HOME/.p10k.zsh" diff --git a/zsh/plugins/zsh-autosuggestions b/zsh/plugins/zsh-autosuggestions new file mode 160000 index 0000000..0e810e5 --- /dev/null +++ b/zsh/plugins/zsh-autosuggestions @@ -0,0 +1 @@ +Subproject commit 0e810e5afa27acbd074398eefbe28d13005dbc15 diff --git a/zsh/plugins/zsh-syntax-highlighting b/zsh/plugins/zsh-syntax-highlighting new file mode 160000 index 0000000..5eb677b --- /dev/null +++ b/zsh/plugins/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit 5eb677bb0fa9a3e60f0eff031dc13926e093df92 diff --git a/zsh/themes/powerlevel10k b/zsh/themes/powerlevel10k new file mode 160000 index 0000000..36f3045 --- /dev/null +++ b/zsh/themes/powerlevel10k @@ -0,0 +1 @@ +Subproject commit 36f3045d69d1ba402db09d09eb12b42eebe0fa3b