commit d6c384f8e1f0add3125232fd8346bf0800ee498f
parent 1ef159f2ec3589f23742a685bca6f424baf44632
Author: oscarbenedito <oscar@oscarbenedito.com>
Date:   Fri, 24 Apr 2020 22:21:31 +0200

zsh files moved to .config/zsh

Diffstat:
Ddot_config/aliases.tmpl | 70----------------------------------------------------------------------
Adot_config/zsh/aliases.tmpl | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adot_config/zsh/dot_zshrc.tmpl | 44++++++++++++++++++++++++++++++++++++++++++++
Mdot_zshenv | 1+
Ddot_zshrc.tmpl | 42------------------------------------------
5 files changed, 116 insertions(+), 112 deletions(-)

diff --git a/dot_config/aliases.tmpl b/dot_config/aliases.tmpl @@ -1,70 +0,0 @@ -alias clear="printf '\033c'" - -# Colors -alias ls="ls -hv --color=auto --group-directories-first" -alias grep="grep --color=auto" -alias fgrep="fgrep --color=auto" -alias egrep="egrep --color=auto" -alias diff="diff --color=auto" - -# Options aliases -alias cp="cp --interactive" -alias mv="mv --interactive" -alias mkdir="mkdir --parents" - -# Shortcuts -alias v="nvim" -alias vim="nvim" - -{{- if ne .chezmoi.hostname "fme-desktop" }} - -# Zsh aliases -alias -g l="|less" -alias -g e="|entr" -alias -g null="> /dev/null 2>&1" -{{- end }} - -# Chezmoi -{{- if eq .chezmoi.hostname "fme-desktop" }} -alias chezmoi="$HOME/.local/bin/chezmoi" -{{- end }} -alias c="chezmoi" -alias ce="chezmoi edit" - -# Git -alias g="git" -alias gs="git status" -alias gc="git commit -m" -alias gd="git diff" -alias ga="git add" -alias gpl="git pull" -alias gps="git push" -alias gsh="git stash" - -{{ if ne .chezmoi.hostname "fme-desktop" -}} -{{- if eq .chezmoi.osRelease.id "debian" -}} -alias upgrade="sudo apt-get update && sudo apt-get -y upgrade" -alias ag="sudo apt-get" -{{- else -}} -alias upgrade="sudo pacman -Syyu --noconfirm" -alias p="sudo pacman" -{{- end }} -{{- end }} - -{{- if eq .chezmoi.hostname "fme-desktop" }} -alias vscode="$HOME/KOLMOGOROV/VSCode-linux-x64/bin/code" -{{- end }} - -{{- if .backup }} - -# Backup to external HD -alias backup_all='rsync -loptruzvP --delete {{ range $i, $dir := .backup.backup_exclude }}--exclude "{{ $dir }}" {{ end }} "$HOME/" "/media/$USER/OSCAR/.{{ .backup.backup_dir }}/"' - -# Backup the contents of the USB -alias backup_usb='rsync -gloptruzvP --delete --exclude "/Varis/copia-gris.hc" --exclude "/Varis/copia-gris-git.hc" --exclude "/.Trash-1000" --exclude "/.Trashes" --exclude "/.Spotlight-V100" "/media/$USER/Oscar/" "$HOME/Documents/Backups/USB/"' -{{- end }} - -{{- if eq .chezmoi.hostname "fme-desktop" }} - -setxkbmap -option "caps:swapescape" # Switch caps and escape -{{- end }} diff --git a/dot_config/zsh/aliases.tmpl b/dot_config/zsh/aliases.tmpl @@ -0,0 +1,71 @@ +# vim: filetype=zsh +alias clear="printf '\033c'" + +# Colors +alias ls="ls -hv --color=auto --group-directories-first" +alias grep="grep --color=auto" +alias fgrep="fgrep --color=auto" +alias egrep="egrep --color=auto" +alias diff="diff --color=auto" + +# Options aliases +alias cp="cp --interactive" +alias mv="mv --interactive" +alias mkdir="mkdir --parents" + +# Shortcuts +alias v="nvim" +alias vim="nvim" + +{{- if ne .chezmoi.hostname "fme-desktop" }} + +# Zsh aliases +alias -g l="|less" +alias -g e="|entr" +alias -g null="> /dev/null 2>&1" +{{- end }} + +# Chezmoi +{{- if eq .chezmoi.hostname "fme-desktop" }} +alias chezmoi="$HOME/.local/bin/chezmoi" +{{- end }} +alias c="chezmoi" +alias ce="chezmoi edit" + +# Git +alias g="git" +alias gs="git status" +alias gc="git commit -m" +alias gd="git diff" +alias ga="git add" +alias gpl="git pull" +alias gps="git push" +alias gsh="git stash" + +{{ if ne .chezmoi.hostname "fme-desktop" -}} +{{- if eq .chezmoi.osRelease.id "debian" -}} +alias upgrade="sudo apt-get update && sudo apt-get -y upgrade" +alias ag="sudo apt-get" +{{- else -}} +alias upgrade="sudo pacman -Syyu --noconfirm" +alias p="sudo pacman" +{{- end }} +{{- end }} + +{{- if eq .chezmoi.hostname "fme-desktop" }} +alias vscode="$HOME/KOLMOGOROV/VSCode-linux-x64/bin/code" +{{- end }} + +{{- if .backup }} + +# Backup to external HD +alias backup_all='rsync -loptruzvP --delete {{ range $i, $dir := .backup.backup_exclude }}--exclude "{{ $dir }}" {{ end }} "$HOME/" "/media/$USER/OSCAR/.{{ .backup.backup_dir }}/"' + +# Backup the contents of the USB +alias backup_usb='rsync -gloptruzvP --delete --exclude "/Varis/copia-gris.hc" --exclude "/Varis/copia-gris-git.hc" --exclude "/.Trash-1000" --exclude "/.Trashes" --exclude "/.Spotlight-V100" "/media/$USER/Oscar/" "$HOME/Documents/Backups/USB/"' +{{- end }} + +{{- if eq .chezmoi.hostname "fme-desktop" }} + +setxkbmap -option "caps:swapescape" # Switch caps and escape +{{- end }} diff --git a/dot_config/zsh/dot_zshrc.tmpl b/dot_config/zsh/dot_zshrc.tmpl @@ -0,0 +1,44 @@ +# vim: filetype=zsh +# Load colors and set up prompt +autoload -U colors && colors +PS1="%B%{$fg[magenta]%}%n%{$fg[blue]%}@%{$fg[green]%}%M %{$fg[yellow]%}%~%b%{$fg[red]%}$%{$reset_color%} " + +# Set up history and history file +HISTSIZE=1000 +SAVEHIST=1000 +HISTFILE=~/.cache/zsh/history + +setopt HIST_IGNORE_DUPS +setopt HIST_FIND_NO_DUPS + +# Set up navigation menu when pressing tab multiple times +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit -d ~/.cache/zsh/zcompdump +#_comp_options+=(globdots) + +# Auto complete case insensitive +zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# Set up vi style keys +bindkey -v +export KEYTIMEOUT=1 +bindkey "^?" backward-delete-char + +# Also set vi keys to navigate the menus when double pressing tab +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history + +# Process the alias file +[ -f "$XDG_CONFIG_HOME/zsh/aliases" ] && source "$XDG_CONFIG_HOME/zsh/aliases" +[ -f "$XDG_CONFIG_HOME/zsh/aliases-auto" ] && source "$XDG_CONFIG_HOME/zsh/aliases-auto" + +# Include the highlighting plug-in +{{- if eq .chezmoi.osRelease.id "debian" }} +source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2> /dev/null +{{- else }} +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2> /dev/null +{{- end }} diff --git a/dot_zshenv b/dot_zshenv @@ -10,6 +10,7 @@ export XDG_CACHE_HOME="$HOME/.cache" export R_LIBS_USER="$XDG_DATA_HOME/R" export ATOM_HOME="$XDG_DATA_HOME/atom" export GOPATH="$XDG_DATA_HOME/go" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl @@ -1,42 +0,0 @@ -# Load colors and set up prompt -autoload -U colors && colors -PS1="%B%{$fg[magenta]%}%n%{$fg[blue]%}@%{$fg[green]%}%M %{$fg[yellow]%}%~%b%{$fg[red]%}$%{$reset_color%} " - -# Set up history and history file -HISTSIZE=1000 -SAVEHIST=1000 -HISTFILE=~/.cache/zsh/history - -setopt HIST_IGNORE_DUPS -setopt HIST_FIND_NO_DUPS - -# Set up navigation menu when pressing tab multiple times -autoload -U compinit -zstyle ':completion:*' menu select -zmodload zsh/complist -compinit -d ~/.cache/zsh/zcompdump -#_comp_options+=(globdots) - -# Auto complete case insensitive -zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - -# Set up vi style keys -bindkey -v -export KEYTIMEOUT=1 -bindkey "^?" backward-delete-char - -# Also set vi keys to navigate the menus when double pressing tab -bindkey -M menuselect 'h' vi-backward-char -bindkey -M menuselect 'k' vi-up-line-or-history -bindkey -M menuselect 'l' vi-forward-char -bindkey -M menuselect 'j' vi-down-line-or-history - -# Process the alias file -[ -f "$HOME/.config/aliases" ] && source "$HOME/.config/aliases" - -# Include the highlighting plug-in -{{- if eq .chezmoi.osRelease.id "debian" }} -source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2> /dev/null -{{- else }} -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2> /dev/null -{{- end }}