Home directory cleanup, backups, vim config

This commit is contained in:
koumakpet 2020-03-26 17:41:25 +01:00
parent f194e71dda
commit b5a357f57b
7 changed files with 101 additions and 60 deletions

View file

@ -41,7 +41,7 @@ alias py2='python2'
# Config access shortcuts
alias cfvim='vim ~/.vimrc'
alias cfzsh='vim ~/config/zsh/.zsh_config'
alias cfzsh='vim ~/.config/zsh/.zsh_config'
alias cfzshrc='vim ~/.zshrc'
# Replacements
@ -54,6 +54,9 @@ alias tty-clock='tty-clock -Ssc' # Terminal clock screensaver
# Custom aliases
alias nvidia='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia' # Run app with nvidia (on hybrid mode with optimus)
alias fhere='find . -name' # Find file/dir from currrent dir
alias ssh-list='ss | grep ssh' # List all SSH connections
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
@ -72,7 +75,8 @@ alias pacman-extract='pacman -Syw --cachedir .' # Extract package/es into curren
alias mount-table='df' # Show list of all mounted devices and their mount locations
alias swapout='sudo swapoff -a; sudo swapon -a' # Reset swap (move everything to RAM)
alias sound_control='alsamixer' # Sound control tool in alsa_utils package
alias md-to-pdf='pandoc -s -o' # Convert markdown to pdf
alias pdf-reader='mupdf' # Open pdf file
# If user is not root, pass all commands via sudo
if [ $UID -ne 0 ]; then

View file

@ -1,19 +0,0 @@
# Enable colors
autoload -U colors && colors
# Basic auto/tab complete
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
# Setup aliases
if [ -f ~/.config/sh/.aliases ]; then
source ~/.config/sh/.aliases
fi
# Load zsh-syntax-highlighting (should be last)
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

View file

@ -24,6 +24,12 @@ set laststatus=2 " Always show status line
set wildmode=longest,list,full " Enable autocompletion
set splitbelow splitright " Split in more natural way
" SET VIM Locations
set undodir=$XDG_DATA_HOME/vim/undo
set directory=$XDG_DATA_HOME/vim/swap
set backupdir=$XDG_DATA_HOME/vim/backup
set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
"set nomodeline " Disable as a security precaution
"set wildmenu " Enable wildmenu

View file

@ -1,17 +1,19 @@
#save_aliases=$(alias -L)
ZSH_CACHE="$HOME/.cache/zsh"
# History in cache directory
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
HISTFILE=$ZSH_CACHE/history
# Move .zsh-update to $ZSH_CACHE
[ -f ~/.zsh-update ] && mv ~/.zsh-update $ZSH_CACHE/.zsh-update
# Export oh-my-zsh location as $ZSH
export ZSH="$HOME/.config/oh-my-zsh"
export ZSH="/usr/share/oh-my-zsh"
# Set theme
#ZSH_THEME="agnoster"
#ZSH_THEME="bira"
#ZSH_THEME="gnzh"
#ZSH_THEME="rkj-repos"i
ZSH_THEME="af-magic"
# How often should zsh be updated
@ -23,18 +25,33 @@ ENABLE_CORRECTION="false"
# Run oh-my-zsh
source $ZSH/oh-my-zsh.sh
# Load plugins
plugins=(
git
python
pylint
pyenv
autopep8
zsh-autosuggestions
)
if [ -f "$HOME/.config/sh/zsh/.zsh_config" ]; then
source "$HOME/.config/sh/zsh/.zsh_config"
fi
# Enable colors
autoload -U colors && colors
# Basic auto/tab complete
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
# Setup aliases
[ -f ~/.config/sh/.aliases ] && source ~/.config/sh/.aliases
# XDG Exports
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
# ~/ Clean-up
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # Might break some DMs
export WGETRC="$HOME/.config/wget/wgetrc"
export LESSHISTFILE="-"
export VIMINIT=":source $XDG_CONFIG_HOME"/vim/vimrc
# Load zsh-syntax-highlighting (should be last)
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#neofetch --cpu_temp C --gtk2 off --gtk3 off --color_blocks on --pixterm