-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
61 lines (50 loc) · 1.41 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -- GENERAL ZSH SETTINGS --
# Load zsh autocompletion and prompts
autoload -Uz compinit promptinit
compinit
promptinit
# Set zsh prompt
prompt redhat
# Set completion menu to be navigable
zstyle ':completion:*' menu select
# Set parameters for bash-history
export HISTSIZE=10000
setopt HIST_IGNORE_DUPS
# Set default programs (but restore emacs shell bindings)
export VISUAL=/usr/bin/nvim
export EDITOR="$VISUAL"
export BROWSER=/usr/bin/librewolf
bindkey -e
# Set TTY for GPG passkey prompting
export GPG_TTY=$(tty)
# Set other shell variables
export KAGGLE_CONFIG_DIR=~/.config/kaggle
# -- ALIASES --
# Set useful aesthetic aliases
alias ls="ls --color"
alias grep="grep --color"
# Custom viminit location, but don't conflict with Neovim
alias vim='vim -u ~/.config/vim/vimrc'
# Set up alias for controlling dotfiles via git and allow completions
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
unsetopt completealiases
# -- FUNCTIONS --
# Get non-password value from pass (adapted from dbrumbaugh)
# e.g. `show-pass-value github username`
show-pass-val () {
if [[ "$#" == 1 ]]; then
# If no extra args then print password
pass $1 | head -1
else
# search for $2 after ": " and print
pass $1 | awk -F ": " "/$2/"'{print $2}'
fi
}
# -- OTHER PROGRAM SETTINGS --
# Add fuzzyfinder
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Add Walk
function lk {
cd "$(walk "$@")"
}
. "$HOME/.cargo/env"