Refactor .zshrc
- Split login stuff into .profile - Symlink .profile to .zprofile since zsh only loads the latter - Drop QPA_PLATFORMTHEME and see what breaks - Make bat my pager where I have it, most where I don't - Drop the OS-detection stuff for ls, use exa if I have it - Drop a couple old aliases
This commit is contained in:
parent
896f33addc
commit
e8100fc21d
3 changed files with 30 additions and 37 deletions
24
.profile
Normal file
24
.profile
Normal file
|
@ -0,0 +1,24 @@
|
|||
export LANG=en_US.UTF-8
|
||||
|
||||
# Start keychain only on my personal system
|
||||
if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
|
||||
eval `keychain --eval id_ed25519`
|
||||
fi
|
||||
|
||||
# These are pretty safe to assume exist
|
||||
export PATH=~/bin:$PATH
|
||||
export EDITOR=vim
|
||||
export VISUAL=$EDITOR
|
||||
|
||||
# Figure out my pager; these don't necessarily exist
|
||||
if [ -e /usr/bin/bat ]; then
|
||||
export PAGER="bat --plain"
|
||||
elif [ -e /usr/bin/most ]; then
|
||||
export PAGER=most
|
||||
fi
|
||||
|
||||
# Set shell history values
|
||||
# We use one history for any shell, which might bite us one day?
|
||||
export HISTFILE=~/.history
|
||||
export HISTSIZE=10000
|
||||
export SAVEHIST=10000
|
1
.zprofile
Symbolic link
1
.zprofile
Symbolic link
|
@ -0,0 +1 @@
|
|||
.profile
|
42
.zshrc
42
.zshrc
|
@ -1,12 +1,3 @@
|
|||
export LANG=en_US.UTF-8
|
||||
|
||||
# Start keychain only on my personal system
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
SESSION_TYPE=ssh
|
||||
else
|
||||
eval `keychain --eval id_ed25519`
|
||||
fi
|
||||
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
|
@ -25,44 +16,21 @@ fi
|
|||
# Despite being called precmd() this executes after process exits, before prompt
|
||||
precmd() { echo -ne "\033]0;${USER}@${HOST}\007" }
|
||||
|
||||
# These are pretty safe to assume exist
|
||||
export PATH=~/bin:$PATH
|
||||
export EDITOR=vim
|
||||
export VISUAL=$EDITOR
|
||||
|
||||
# QT theme via qt5ct app
|
||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||
|
||||
# most does not exist on every system I touch
|
||||
if [[ -a /usr/bin/most ]]; then
|
||||
export PAGER="most -w"
|
||||
fi
|
||||
|
||||
# Generic navigation keybinds
|
||||
bindkey "^[[H" beginning-of-line # HOME
|
||||
bindkey "^[[F" end-of-line # END
|
||||
bindkey "^[[3~" delete-char # DEL
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
|
||||
# OS-specific directives
|
||||
case "$OSTYPE" in
|
||||
darwin*)
|
||||
alias ls='ls -G'
|
||||
;;
|
||||
linux*)
|
||||
alias ls='exa'
|
||||
;;
|
||||
esac
|
||||
|
||||
# Global aliases
|
||||
alias ct="clear && task"
|
||||
alias tt="taskwarrior-tui"
|
||||
alias grep='grep -EIs --color=auto --exclude-dir=.git'
|
||||
alias highlight='highlight --out-format=xterm256 --style=base16'
|
||||
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
# Use exa if we have it
|
||||
if [ -e /usr/bin/exa ]; then
|
||||
alias ls=exa
|
||||
fi
|
||||
|
||||
setopt appendhistory
|
||||
|
||||
# Case-insensetive tab completion
|
||||
|
|
Loading…
Add table
Reference in a new issue