mirror of
https://github.com/alrayyes/dotfiles/
synced 2023-11-14 15:56:30 +00:00
Compare commits
3 Commits
a51981aeb0
...
29e225797d
Author | SHA1 | Date | |
---|---|---|---|
29e225797d | |||
919c440ef5 | |||
0732b6ad79 |
28
README.org
28
README.org
@ -26,6 +26,10 @@
|
||||
- [[#ui][UI]]
|
||||
- [[#npm][NPM]]
|
||||
- [[#packages-1][Packages]]
|
||||
- [[#zsh][Zsh]]
|
||||
- [[#theme-2][Theme]]
|
||||
- [[#plugin-manager-1][Plugin Manager]]
|
||||
- [[#plugins-1][Plugins]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#installation][Installation]]
|
||||
- [[#find--delete-orphaned-symlinks][Find & delete orphaned symlinks]]
|
||||
@ -176,6 +180,30 @@ A repository of my personal configuration files.
|
||||
** Packages
|
||||
- [[https://github.com/GoogleChrome/lighthouse][lighthouse]]
|
||||
|
||||
* Zsh
|
||||
** Theme
|
||||
- [[https://github.com/denysdovhan/spaceship-prompt][spaceship zsh]]
|
||||
** Plugin Manager
|
||||
- [[https://github.com/zplug/zplug][zplug]]
|
||||
** Plugins
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/archlinux][archlinux]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/composer][composer]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker][docker]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker-compose][docker-compose]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/extract][extract]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/fzf][fzf]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git][git]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitignore][gitignore]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/pass][pass]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ripgrep][ripgrep]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/rsync][rsync]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo][sudo]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/systemd][systemd]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/tmux][tmux]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vi-mode][vi-mode]]
|
||||
- [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]]
|
||||
- [[https://github.com/zsh-users/zsh-syntax-highlighting][zsh-syntax-highlighting]]
|
||||
|
||||
* Configuration
|
||||
** Installation
|
||||
#+BEGIN_SRC shell
|
||||
|
3
zsh/.zprofile
Normal file
3
zsh/.zprofile
Normal file
@ -0,0 +1,3 @@
|
||||
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
||||
exec startx
|
||||
fi
|
231
zsh/.zshenv
Normal file
231
zsh/.zshenv
Normal file
@ -0,0 +1,231 @@
|
||||
path_if_exists() {
|
||||
if [[ -d $1 ]]; then
|
||||
export PATH="$1:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop tmux bitching about 256 colours
|
||||
TERM="xterm-256color"
|
||||
|
||||
# PATH
|
||||
path_if_exists ~/.config/yarn/global/node_modules/.bin
|
||||
path_if_exists ~/.local/bin
|
||||
path_if_exists ~/.emacs.d/bin
|
||||
path_if_exists ~/go/bin
|
||||
|
||||
# Set GPG TTY
|
||||
export GPG_TTY="$(tty)"
|
||||
|
||||
# Set default browser
|
||||
if [ -e "/usr/bin/brave" ]; then
|
||||
export BROWSER="brave"
|
||||
else
|
||||
if [ -e "/usr/bin/firefox" ]; then
|
||||
export BROWSER="firefox"
|
||||
elif [ -e "/usr/bin/iceweasel" ]; then
|
||||
export BROWSER="iceweasel"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set default terminal
|
||||
export TERMINAL="alacritty"
|
||||
|
||||
# pkg editor
|
||||
export VISUAL="nvim"
|
||||
|
||||
# editor
|
||||
export EDITOR="nvim"
|
||||
|
||||
# Enable password store extensions
|
||||
export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
|
||||
|
||||
# Make sure pass uses the proper directory
|
||||
export PASSWORD_STORE_DIR=~/.local/share/pass
|
||||
|
||||
# Use alternative muhome
|
||||
export MU_HOME=~/.cache/mu
|
||||
|
||||
# Load xinit from the proper directory
|
||||
export XINITRC=~/X11/xinitrc
|
||||
|
||||
# This needs to be set for bspwm to see config
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
|
||||
# Enable icons in lf
|
||||
export LF_ICONS="\
|
||||
tw=:\
|
||||
st=:\
|
||||
ow=:\
|
||||
dt=:\
|
||||
di=:\
|
||||
fi=:\
|
||||
ln=:\
|
||||
or=:\
|
||||
ex=:\
|
||||
*.c=:\
|
||||
*.cc=:\
|
||||
*.clj=:\
|
||||
*.coffee=:\
|
||||
*.cpp=:\
|
||||
*.css=:\
|
||||
*.d=:\
|
||||
*.dart=:\
|
||||
*.erl=:\
|
||||
*.exs=:\
|
||||
*.fs=:\
|
||||
*.go=:\
|
||||
*.h=:\
|
||||
*.hh=:\
|
||||
*.hpp=:\
|
||||
*.hs=:\
|
||||
*.html=:\
|
||||
*.java=:\
|
||||
*.jl=:\
|
||||
*.js=:\
|
||||
*.json=:\
|
||||
*.lua=:\
|
||||
*.md=:\
|
||||
*.php=:\
|
||||
*.pl=:\
|
||||
*.pro=:\
|
||||
*.py=:\
|
||||
*.rb=:\
|
||||
*.rs=:\
|
||||
*.scala=:\
|
||||
*.ts=:\
|
||||
*.vim=:\
|
||||
*.cmd=:\
|
||||
*.ps1=:\
|
||||
*.sh=:\
|
||||
*.bash=:\
|
||||
*.zsh=:\
|
||||
*.fish=:\
|
||||
*.tar=:\
|
||||
*.tgz=:\
|
||||
*.arc=:\
|
||||
*.arj=:\
|
||||
*.taz=:\
|
||||
*.lha=:\
|
||||
*.lz4=:\
|
||||
*.lzh=:\
|
||||
*.lzma=:\
|
||||
*.tlz=:\
|
||||
*.txz=:\
|
||||
*.tzo=:\
|
||||
*.t7z=:\
|
||||
*.zip=:\
|
||||
*.z=:\
|
||||
*.dz=:\
|
||||
*.gz=:\
|
||||
*.lrz=:\
|
||||
*.lz=:\
|
||||
*.lzo=:\
|
||||
*.xz=:\
|
||||
*.zst=:\
|
||||
*.tzst=:\
|
||||
*.bz2=:\
|
||||
*.bz=:\
|
||||
*.tbz=:\
|
||||
*.tbz2=:\
|
||||
*.tz=:\
|
||||
*.deb=:\
|
||||
*.rpm=:\
|
||||
*.jar=:\
|
||||
*.war=:\
|
||||
*.ear=:\
|
||||
*.sar=:\
|
||||
*.rar=:\
|
||||
*.alz=:\
|
||||
*.ace=:\
|
||||
*.zoo=:\
|
||||
*.cpio=:\
|
||||
*.7z=:\
|
||||
*.rz=:\
|
||||
*.cab=:\
|
||||
*.wim=:\
|
||||
*.swm=:\
|
||||
*.dwm=:\
|
||||
*.esd=:\
|
||||
*.jpg=:\
|
||||
*.jpeg=:\
|
||||
*.mjpg=:\
|
||||
*.mjpeg=:\
|
||||
*.gif=:\
|
||||
*.bmp=:\
|
||||
*.pbm=:\
|
||||
*.pgm=:\
|
||||
*.ppm=:\
|
||||
*.tga=:\
|
||||
*.xbm=:\
|
||||
*.xpm=:\
|
||||
*.tif=:\
|
||||
*.tiff=:\
|
||||
*.png=:\
|
||||
*.svg=:\
|
||||
*.svgz=:\
|
||||
*.mng=:\
|
||||
*.pcx=:\
|
||||
*.mov=:\
|
||||
*.mpg=:\
|
||||
*.mpeg=:\
|
||||
*.m2v=:\
|
||||
*.mkv=:\
|
||||
*.webm=:\
|
||||
*.ogm=:\
|
||||
*.mp4=:\
|
||||
*.m4v=:\
|
||||
*.mp4v=:\
|
||||
*.vob=:\
|
||||
*.qt=:\
|
||||
*.nuv=:\
|
||||
*.wmv=:\
|
||||
*.asf=:\
|
||||
*.rm=:\
|
||||
*.rmvb=:\
|
||||
*.flc=:\
|
||||
*.avi=:\
|
||||
*.fli=:\
|
||||
*.flv=:\
|
||||
*.gl=:\
|
||||
*.dl=:\
|
||||
*.xcf=:\
|
||||
*.xwd=:\
|
||||
*.yuv=:\
|
||||
*.cgm=:\
|
||||
*.emf=:\
|
||||
*.ogv=:\
|
||||
*.ogx=:\
|
||||
*.aac=:\
|
||||
*.au=:\
|
||||
*.flac=:\
|
||||
*.m4a=:\
|
||||
*.mid=:\
|
||||
*.midi=:\
|
||||
*.mka=:\
|
||||
*.mp3=:\
|
||||
*.mpc=:\
|
||||
*.ogg=:\
|
||||
*.ra=:\
|
||||
*.wav=:\
|
||||
*.oga=:\
|
||||
*.opus=:\
|
||||
*.spx=:\
|
||||
*.xspf=:\
|
||||
*.pdf=:\
|
||||
*.nix=:\
|
||||
"
|
||||
|
||||
# Save history file in proper place
|
||||
HISTFILE=~/.cache/zsh/history
|
||||
|
||||
# Use alternative muhome
|
||||
export MU_HOME="/home/alrayyes/.cache/mu"
|
||||
|
||||
# Needed to get zsh to play nice with emacs vterm
|
||||
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
|
||||
alias clear='printf "\e]51;Evterm-clear-scrollback\e\\";tput clear'
|
||||
fi
|
||||
vterm_prompt_end() {
|
||||
printf "\e]51;A$(whoami)@$(hostname):$(pwd)\e\\"
|
||||
}
|
||||
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
107
zsh/.zshrc
Normal file
107
zsh/.zshrc
Normal file
@ -0,0 +1,107 @@
|
||||
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
|
||||
|
||||
# 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
|
||||
zplug "plugins/fzf", from:oh-my-zsh
|
||||
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
|
||||
|
||||
# nvim alias
|
||||
alias v="nvim"
|
||||
alias sv="sudo nvim"
|
||||
|
||||
# ls alias
|
||||
alias ls="exa"
|
||||
alias l="exa -al"
|
||||
|
||||
# vifm alias
|
||||
alias vifm="vifmrun"
|
||||
|
||||
# wget alias
|
||||
alias wget='wget --hsts-file="~/.config/wget-hsts"'
|
||||
|
||||
# weechat
|
||||
alias weechat="weechat -d ~/.config/weechat"
|
||||
|
||||
# tmux
|
||||
alias tmux="tmux -f ~/.config/tmux/tmux.conf"
|
||||
|
||||
# pass
|
||||
alias pass="PASSWORD_STORE_DIR=$PASSWORD_STORE_DIR /usr/bin/pass"
|
||||
|
||||
# pacman aliases
|
||||
alias pacrmorphans="sudo pacman -Rs (pacman -Qtdq)"
|
||||
alias pacrem="sudo pacman -Rns"
|
||||
|
||||
# git alaises
|
||||
alias gpoat="git push origin --all && git push origin --tags"
|
||||
alias gs="git status"
|
||||
alias gd="git diff"
|
||||
alias g="git"
|
||||
|
||||
# Prevent mv & rm oopsies
|
||||
alias mv="mv -i"
|
||||
alias rm="rm -i"
|
||||
|
||||
# Use lf to switch directories and bind it to ctrl-o
|
||||
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
|
||||
}
|
||||
|
||||
bindkey -s '^o' 'lfcd\n'
|
||||
|
||||
# Set GPG TTY
|
||||
export GPG_TTY="$(tty)"
|
||||
|
||||
# Refresh gpg-agent tty in case user switches into an X session
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||
|
||||
# Needed for broot
|
||||
source /home/alrayyes/.config/broot/launcher/bash/br
|
||||
|
||||
pfetch
|
Loading…
Reference in New Issue
Block a user