1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/zsh/.zshrc

82 lines
1.9 KiB
Bash
Raw Normal View History

2020-02-08 14:14:11 +00:00
source_if_exists() {
if [[ -f $1 ]]; then
source $1
fi
}
# Check if zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/b4b4r07/zplug ~/.zplug
fi
source ~/.zplug/init.zsh
# Spaceship theme
zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
2016-11-09 13:09:59 +00:00
2020-02-08 14:14:11 +00:00
# Oh my zsh lugins
# sudo must start after vi-mode for it to work properly
zplug "plugins/archlinux", from:oh-my-zsh
zplug "plugins/composer", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/docker-compose", from:oh-my-zsh
zplug "plugins/extract", from:oh-my-zsh
2020-02-10 20:24:29 +00:00
zplug "plugins/fzf", from:oh-my-zsh
2020-02-08 14:14:11 +00:00
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/gitignore", from:oh-my-zsh
zplug "plugins/pass", from:oh-my-zsh
zplug "plugins/ripgrep", from:oh-my-zsh
zplug "plugins/rsync", from:oh-my-zsh
zplug "plugins/systemd", from:oh-my-zsh
zplug "plugins/tmux", from:oh-my-zsh
zplug "plugins/vi-mode", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/yarn", from:oh-my-zsh
zplug "zsh-users/zsh-autosuggestions", from:github, defer:3
zplug "zsh-users/zsh-syntax-highlighting", from:github, defer:3
# Install packages
if ! zplug check --verbose; then
printf "Install zplug plugins? [y/N]: "
if read -q; then
echo
zplug install
fi
fi
zplug load
2016-11-09 13:09:59 +00:00
# vim alias
2020-02-14 15:03:21 +00:00
alias v="nvim"
alias sv="sudo nvim"
2019-03-20 13:54:32 +00:00
# ls alias
2020-02-03 23:28:23 +00:00
alias ls="exa"
alias l="exa -al"
# vifm alias
alias vifm="vifmrun"
2019-09-30 16:09:51 +00:00
# Use lf to switch directories and bind it to ctrl-o
2020-02-08 14:14:11 +00:00
lfcd() {
tmp="$(mktemp)"
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
2019-09-30 16:09:51 +00:00
}
bindkey -s '^o' 'lfcd\n'
2020-02-08 14:14:11 +00:00
# Set GPG TTY
export GPG_TTY="$(tty)"
2020-02-08 14:14:11 +00:00
2016-12-30 20:07:59 +00:00
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null
2020-02-08 14:14:11 +00:00
# Needed for broot
2020-02-03 23:28:23 +00:00
source /home/alrayyes/.config/broot/launcher/bash/br
2020-02-08 14:14:11 +00:00
neofetch