56 lines
1.3 KiB
Bash
56 lines
1.3 KiB
Bash
|
|
# ---- managed by boma dev_env role (stow) ----
|
||
|
|
# If Oh My Zsh is installed, point ZSH and load it; otherwise pure zsh.
|
||
|
|
export ZSH="$HOME/.oh-my-zsh"
|
||
|
|
|
||
|
|
ZSH_THEME="robbyrussell"
|
||
|
|
plugins=(git history sudo zsh-autosuggestions zsh-syntax-highlighting)
|
||
|
|
|
||
|
|
if [ -d "$ZSH" ]; then
|
||
|
|
source "$ZSH/oh-my-zsh.sh"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Oh My Posh prompt (preferred)
|
||
|
|
if command -v oh-my-posh >/dev/null 2>&1; then
|
||
|
|
eval "$(oh-my-posh init zsh --config /etc/oh-my-posh/zen.toml)"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Terminal title
|
||
|
|
function set_terminal_title {
|
||
|
|
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"
|
||
|
|
}
|
||
|
|
precmd() { set_terminal_title }
|
||
|
|
|
||
|
|
# Aliases and basics
|
||
|
|
alias ll="ls -lh"
|
||
|
|
alias la="ls -lha"
|
||
|
|
alias ..="cd .."
|
||
|
|
alias update="sudo apt update && sudo apt upgrade -y"
|
||
|
|
alias rclone="/usr/bin/rclone"
|
||
|
|
|
||
|
|
# Use neovim for vim/vi commands
|
||
|
|
alias vim='nvim'
|
||
|
|
alias vi='nvim'
|
||
|
|
|
||
|
|
# History
|
||
|
|
HISTFILE="$HOME/.zsh_history"
|
||
|
|
HISTSIZE=10000
|
||
|
|
SAVEHIST=10000
|
||
|
|
setopt inc_append_history share_history
|
||
|
|
|
||
|
|
# Completion/globbing
|
||
|
|
autoload -Uz compinit
|
||
|
|
compinit
|
||
|
|
setopt autocd correct globdots no_beep
|
||
|
|
|
||
|
|
# Editor & PATH
|
||
|
|
export EDITOR="/usr/local/bin/nvim"
|
||
|
|
export VISUAL="/usr/local/bin/nvim"
|
||
|
|
export PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||
|
|
|
||
|
|
# Ensure USER is set (edge cases)
|
||
|
|
export USER=$(whoami)
|
||
|
|
|
||
|
|
# Extras from inventory
|
||
|
|
# Enable direnv for automatic virtualenv activation
|
||
|
|
eval "$(direnv hook zsh)"
|