[zsh] Add config for shared servers

This commit is contained in:
Fabian Ising
2024-01-10 16:29:27 +01:00
parent 0814ed539a
commit 0ac57fb714
5 changed files with 1835 additions and 7 deletions

View File

@@ -7,10 +7,20 @@
# #
ln -Tsfv $PWD/zsh $HOME/.zsh if [ $1 = "shared" ]; then
ln -Tsfv ~/.zsh/.zshrc $HOME/.zshrc ln -Tsfv $PWD/zsh $HOME/.zsh
ln -Tsfv $PWD/tmux $HOME/.tmux ln -Tsfv ~/.zsh/.zshrc_shared $HOME/.zshrc
ln -Tsfv ~/.tmux/.tmux.conf $HOME/.tmux.conf ln -Tsfv $PWD/tmux $HOME/.tmux
mkdir -p $HOME/.config ln -Tsfv ~/.tmux/.tmux.conf $HOME/.tmux.conf
rm -rf $HOME/.config/nvim mkdir -p $HOME/.config
ln -Tsfv $PWD/nvim $HOME/.config/nvim rm -rf $HOME/.config/nvim
ln -Tsfv $PWD/nvim $HOME/.config/nvim
else
ln -Tsfv $PWD/zsh $HOME/.zsh
ln -Tsfv ~/.zsh/.zshrc $HOME/.zshrc
ln -Tsfv $PWD/tmux $HOME/.tmux
ln -Tsfv ~/.tmux/.tmux.conf $HOME/.tmux.conf
mkdir -p $HOME/.config
rm -rf $HOME/.config/nvim
ln -Tsfv $PWD/nvim $HOME/.config/nvim
fi

27
setup_ubuntu_shared.zsh Executable file
View File

@@ -0,0 +1,27 @@
#! /bin/bash
#
# clone_and_link.sh
# Copyright (C) 2016 fabian <fabian@fabi-laptop-arch>
#
# Distributed under terms of the MIT license.
#
sudo apt -y update
sudo apt -y dist-upgrade
sudo apt -y install neovim zsh tmux virtualenvwrapper powerline fonts-powerline python3 python3-pip
pip3 install neovim
./clone_and_link.sh shared; true
if [ $SHELL != "/bin/zsh" ]; then
chsh -s /usr/bin/zsh;
fi
for filename in zsh/.*_debian.example; do
cp $filename ${filename:0:-15}
done
for filename in tmux/.*_debian.example; do
cp $filename ${filename:0:-15}
done
for filename in nvim/.*_debian.example; do
cp $filename ${filename:0:-15}
done

1709
zsh/.p10k_shared.zsh Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
# Load OMZ plugins
ohmyzsh/ohmyzsh
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/golang
ohmyzsh/ohmyzsh path:plugins/ssh-agent
ohmyzsh/ohmyzsh path:plugins/pip
ohmyzsh/ohmyzsh path:plugins/python
ohmyzsh/ohmyzsh path:plugins/virtualenv
ohmyzsh/ohmyzsh path:plugins/python
ohmyzsh/ohmyzsh path:plugins/docker
ohmyzsh/ohmyzsh path:plugins/docker-compose
ohmyzsh/ohmyzsh path:plugins/command-not-found
romkatv/powerlevel10k
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-history-substring-search
urbainvaes/fzf-marks
zdharma-continuum/fast-syntax-highlighting kind:defer
# Initialize completions
belak/zsh-utils path:completion

58
zsh/.zshrc_shared Normal file
View File

@@ -0,0 +1,58 @@
export PATH="$HOME/.local/bin:$PATH"
[[ -z $SSH_AUTH_SOCK ]] || export FORWARD_SOCK=$SSH_AUTH_SOCK
[[ -f ~/.zsh/.powerline_config ]] && source ~/.zsh/.powerline_config
[[ -f ~/.zsh/.user_config ]] && source ~/.zsh/.user_config
[[ -f ~/.zsh/.virtual_env_config.zsh ]] && source ~/.zsh/.virtual_env_config.zsh
[[ -f ~/.zsh/.local_config ]] && source ~/.zsh/.local_config
[[ -f ~/.zsh/.os_config.zsh ]] && source ~/.zsh/.os_config.zsh
# Load Antidote
mkdir -p ${ZDOTDIR:-~}/.cache/zsh
static_file=${ZDOTDIR:-~}/.cache/zsh/.zsh_plugins.zsh
plugins_txt=${ZDOTDIR:-~}/.zsh/.zsh_plugins.txt
# clone antidote if necessary
if ! [[ -e ${ZDOTDIR:-~}/.antidote ]]; then
git clone https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
fi
zstyle ':omz:plugins:docker' legacy-completion yes
# source antidote and load plugins from `${ZDOTDIR:-~}/.zsh_plugins.txt`
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
antidote load ${plugins_txt} ${static_file}
export SSH_REAL_SOCK=$SSH_AUTH_SOCK
[[ -z $FORWARD_SOCK ]] || export SSH_AUTH_SOCK=$FORWARD_SOCK
setopt interactivecomments
setopt HIST_IGNORE_SPACE
# Clear screen by ctrl+q
bindkey '^q' clear-screen
alias vim=nvim
alias sudo='sudo '
alias cgrep="grep --color=always"
export EDITOR='nvim'
# Vi mode
bindkey -v
VI_MODE_SET_CURSOR=true
alias ls="ls --color=always"
delzip() {
unzip -Z -1 "$@" | xargs -I{} rm -rf {}
}
# mitmproxy
export MITMPROXY_SSLKEYLOGFILE="~/.mitmproxy/sslkeylogfile.txt"
[[ -f ~/.zsh/.mac_config ]] && source ~/.zsh/.mac_config
# Powerlevel 10k
# Remove padding on right side
ZLE_RPROMPT_INDENT=0
# To customize prompt, run `p10k configure` or edit ~/dotfiles/zsh/.p10k.zsh.
if test -f ~/dotfiles/zsh/.p10k.mac.zsh; then
source ~/dotfiles/zsh/.p10k.mac.zsh
else
[[ ! -f ~/dotfiles/zsh/.p10k_shared.zsh ]] || source ~/dotfiles/zsh/.p10k_shared.zsh
fi