remove zsh add fish
This commit is contained in:
+41
-66
@@ -31,6 +31,8 @@ trap cleanup EXIT
|
|||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
APT_PACKAGES=(
|
APT_PACKAGES=(
|
||||||
|
fish
|
||||||
|
pandoc
|
||||||
build-essential
|
build-essential
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
mpv
|
mpv
|
||||||
@@ -79,8 +81,6 @@ APT_PACKAGES=(
|
|||||||
podman
|
podman
|
||||||
openssh-server
|
openssh-server
|
||||||
unixodbc-dev
|
unixodbc-dev
|
||||||
dbeaver-ce
|
|
||||||
zsh
|
|
||||||
patchelf
|
patchelf
|
||||||
ccache
|
ccache
|
||||||
pkg-config
|
pkg-config
|
||||||
@@ -95,79 +95,47 @@ sudo apt-get upgrade -y
|
|||||||
ACCEPT_EULA=Y sudo apt-get install -y "${APT_PACKAGES[@]}"
|
ACCEPT_EULA=Y sudo apt-get install -y "${APT_PACKAGES[@]}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Set zsh as default shell
|
# Set fish as default shell
|
||||||
# ============================================================
|
# ============================================================
|
||||||
echo "=== zsh default shell ==="
|
echo "=== fish default shell ==="
|
||||||
if [[ "$(getent passwd "$USER" | cut -d: -f7)" != *"zsh"* ]]; then
|
if [[ "$(getent passwd "$USER" | cut -d: -f7)" != *"fish"* ]]; then
|
||||||
chsh -s "$(which zsh)"
|
chsh -s "$(which fish)"
|
||||||
echo "*** zsh set as default shell — log out/in required for full effect. ***"
|
echo "*** fish set as default shell — log out/in required for full effect. ***"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# oh-my-zsh
|
# fish config
|
||||||
# ============================================================
|
# ============================================================
|
||||||
echo "=== oh-my-zsh ==="
|
echo "=== fish config ==="
|
||||||
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
|
mkdir -p "$HOME/.config/fish"
|
||||||
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
|
FISHCFG="$HOME/.config/fish/config.fish"
|
||||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
cat > "$FISHCFG" << 'FISHCFG_EOF'
|
||||||
fi
|
fish_add_path -g $HOME/.cargo/bin
|
||||||
|
fish_add_path -g $HOME/.local/bin
|
||||||
|
fish_add_path -g /usr/local/go/bin
|
||||||
|
set -gx GOPATH $HOME/go
|
||||||
|
fish_add_path -g $GOPATH/bin
|
||||||
|
fish_add_path -g $HOME/.atuin/bin
|
||||||
|
fish_add_path -g /opt/mssql-tools18/bin
|
||||||
|
|
||||||
# ============================================================
|
atuin init fish | source
|
||||||
# zsh plugins (syntax-highlighting + autosuggestions)
|
zoxide init fish | source
|
||||||
# ============================================================
|
|
||||||
echo "=== zsh plugins ==="
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_REPO="https://github.com/zsh-users/zsh-syntax-highlighting.git"
|
|
||||||
ZSH_AUTOSUGGEST_REPO="https://github.com/zsh-users/zsh-autosuggestions.git"
|
|
||||||
|
|
||||||
if [[ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]]; then
|
|
||||||
git clone --depth 1 "$ZSH_HIGHLIGHT_REPO" "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]]; then
|
|
||||||
git clone --depth 1 "$ZSH_AUTOSUGGEST_REPO" "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# .zshrc
|
|
||||||
# ============================================================
|
|
||||||
echo "=== .zshrc ==="
|
|
||||||
ZSHRC="$HOME/.zshrc"
|
|
||||||
cat > "$ZSHRC" << 'ZSHRC_EOF'
|
|
||||||
export ZSH="$HOME/.oh-my-zsh"
|
|
||||||
ZSH_THEME="robbyrussell"
|
|
||||||
plugins=(
|
|
||||||
git
|
|
||||||
zsh-syntax-highlighting
|
|
||||||
zsh-autosuggestions
|
|
||||||
)
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
|
||||||
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
export PATH="$PATH:/usr/local/go/bin"
|
|
||||||
export GOPATH="$HOME/go"
|
|
||||||
export PATH="$PATH:$GOPATH/bin"
|
|
||||||
export PATH="$HOME/.atuin/bin:$PATH"
|
|
||||||
|
|
||||||
. "$HOME/.local/bin/env"
|
|
||||||
|
|
||||||
eval "$(atuin init zsh)"
|
|
||||||
eval "$(zoxide init zsh)"
|
|
||||||
|
|
||||||
alias gp='git push'
|
alias gp='git push'
|
||||||
alias gcm='git commit -m'
|
alias gcm='git commit -m'
|
||||||
alias gsw='git switch'
|
alias gsw='git switch'
|
||||||
alias gst='git status'
|
alias gst='git status'
|
||||||
alias gaa='git add .'
|
alias ga='git add .'
|
||||||
alias ga='git add'
|
|
||||||
alias gtree='git log --graph --oneline --decorate --all'
|
alias gtree='git log --graph --oneline --decorate --all'
|
||||||
alias cd='z'
|
|
||||||
alias cdi='zi'
|
function cd
|
||||||
ZSHRC_EOF
|
z $argv
|
||||||
|
end
|
||||||
|
FISHCFG_EOF
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# tmux — default shell to zsh, vi mode
|
# tmux — default shell to fish, vi mode
|
||||||
# ============================================================
|
# ============================================================
|
||||||
echo "=== tmux config ==="
|
echo "=== tmux config ==="
|
||||||
TMUX_CONF="$HOME/.tmux.conf"
|
TMUX_CONF="$HOME/.tmux.conf"
|
||||||
@@ -175,7 +143,7 @@ if [[ ! -f "$TMUX_CONF" ]]; then
|
|||||||
touch "$TMUX_CONF"
|
touch "$TMUX_CONF"
|
||||||
fi
|
fi
|
||||||
if ! grep -qF 'set-option -g default-shell' "$TMUX_CONF"; then
|
if ! grep -qF 'set-option -g default-shell' "$TMUX_CONF"; then
|
||||||
printf 'set-option -g default-shell %s\n' "$(which zsh)" >> "$TMUX_CONF"
|
printf 'set-option -g default-shell %s\n' "$(which fish)" >> "$TMUX_CONF"
|
||||||
fi
|
fi
|
||||||
if ! grep -qF 'set-window-option -g mode-keys vi' "$TMUX_CONF"; then
|
if ! grep -qF 'set-window-option -g mode-keys vi' "$TMUX_CONF"; then
|
||||||
printf 'set-window-option -g mode-keys vi\n' >> "$TMUX_CONF"
|
printf 'set-window-option -g mode-keys vi\n' >> "$TMUX_CONF"
|
||||||
@@ -249,6 +217,14 @@ if ! command -v uv >/dev/null 2>&1; then
|
|||||||
cargo install --locked uv
|
cargo install --locked uv
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# typst
|
||||||
|
# ============================================================
|
||||||
|
if ! command -v uv >/dev/null 2>&1; then
|
||||||
|
cargo install --locked typst
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# fzf
|
# fzf
|
||||||
# ============================================================
|
# ============================================================
|
||||||
@@ -344,7 +320,6 @@ sudo systemctl enable --now libvirtd.service
|
|||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
echo "=== Done ==="
|
echo "=== Done ==="
|
||||||
echo "zsh is the default shell — log out and back in."
|
echo "fish is the default shell — log out and back in."
|
||||||
echo "tmux is configured to use zsh as default-shell."
|
echo "tmux is configured to use fish as default-shell."
|
||||||
echo "oh-my-zsh with syntax-highlighting + autosuggestions installed."
|
echo "Rust and Cargo are at ~/.cargo/bin — added to fish and .bashrc."
|
||||||
echo "Rust and Cargo are at ~/.cargo/bin — added to .zshrc and .bashrc."
|
|
||||||
|
|||||||
Reference in New Issue
Block a user