From e07d16e626f727f271d3f57bad0bd43bc3d215e7 Mon Sep 17 00:00:00 2001 From: Ian Mancini Date: Wed, 18 Mar 2020 18:11:56 -0300 Subject: [PATCH] Move shared env between zsh and bash to file --- template/bash/.bashrc | 66 ++-------------------- template/shell/.aliasrc | 4 +- template/shell/.envrc | 39 +++++++++++++ template/x/.xinitrc | 5 +- template/zathura/.config/zathura/zathurarc | 1 - template/zsh/.zshrc | 40 +------------ 6 files changed, 54 insertions(+), 101 deletions(-) create mode 100644 template/shell/.envrc diff --git a/template/bash/.bashrc b/template/bash/.bashrc index e289872..d6baa11 100755 --- a/template/bash/.bashrc +++ b/template/bash/.bashrc @@ -1,6 +1,12 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return +# load Aliases +[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" + +# Load environment +[ -f "$HOME/.aliasrc" ] && source "$HOME/.envrc" + # Enable bash_completion if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion @@ -9,66 +15,6 @@ fi # Enable vi mode set -o vi -# Enable colors -eval "`dircolors -b`" - -# env -EDITOR="nvim" -TERMINAL="urxvt" - -# FZF -export FZF_DEFAULT_COMMAND='ag -g ""' -export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - -# Keychain -if [ -z ${DISPLAY+x} ]; then - eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)" -else - eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" -fi - -# load Aliases -[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" - -# Add some colour to LESS/MAN pages -export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s" -export LESS='-R' - -export LESS_TERMCAP_mb=$'\E[01;31m' -export LESS_TERMCAP_md=$'\E[01;33m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;42;30m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[01;36m' - -# The Fuck -#eval $(thefuck --alias) - -# nnn - -n() -{ - nnn "$@" - - NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd - - if [ -f $NNN_TMPFILE ]; then - . $NNN_TMPFILE - rm -f $NNN_TMPFILE > /dev/null - fi -} - -# NVM -#export NODE_OPTIONS="--max-old-space-size=1024" -#export NVM_DIR="$HOME/.nvm" -#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nv - -# fnm - export PATH=/home/ianmethyst/.fnm:$PATH - eval "`fnm env --multi`" - # Sensible Bash - An attempt at saner Bash defaults # Maintainer: mrzool diff --git a/template/shell/.aliasrc b/template/shell/.aliasrc index d7511fd..eda4d3d 100644 --- a/template/shell/.aliasrc +++ b/template/shell/.aliasrc @@ -10,7 +10,9 @@ alias \ mv="mv -iv" \ rm="rm -v" \ mkdir="mkdir -pv" \ - dmesg="dmesg --ctime" + dmesg="dmesg --ctime" \ + sudo='sudo ' # https://wiki.archlinux.org/index.php/Sudo#Passing_aliases + # Color alias \ diff --git a/template/shell/.envrc b/template/shell/.envrc new file mode 100644 index 0000000..d49ec08 --- /dev/null +++ b/template/shell/.envrc @@ -0,0 +1,39 @@ +#!/bin/sh + +# env +EDITOR="nvim" +TERMINAL="alacritty" +BROWSER="chromium" + +# bin +export PATH=/home/ianmethyst/.local/bin:$PATH + +# Enable colors +eval "`dircolors -b`" + +# Add some colour to LESS/MAN pages +export LESSOPEN="| /usr/bin/source-highlight-esc.sh %s" +export LESS='-R' + +export LESS_TERMCAP_mb=$'\E[01;31m' +export LESS_TERMCAP_md=$'\E[01;33m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;42;30m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;36m' + +# fzf +export FZF_DEFAULT_COMMAND='ag --hidden -g ""' +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" + +# Keychain +if [ -z ${DISPLAY+x} ]; then + eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)" +else + eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" +fi + +# fnm +export PATH=/home/ianmethyst/.fnm:$PATH +eval "`fnm env --multi`" diff --git a/template/x/.xinitrc b/template/x/.xinitrc index b6be516..24d9371 100755 --- a/template/x/.xinitrc +++ b/template/x/.xinitrc @@ -1,6 +1,7 @@ [[ -f ~/.Xdefaults ]] && xrdb -merge -I $HOME ~/.Xdefaults -export TERMINAL=alacritty -export EDITOR=nvim +export EDITOR="nvim" +export BROWSER="chromium" +export TERMINAL="alacritty" exec i3 diff --git a/template/zathura/.config/zathura/zathurarc b/template/zathura/.config/zathura/zathurarc index e281721..ad1a56a 100755 --- a/template/zathura/.config/zathura/zathurarc +++ b/template/zathura/.config/zathura/zathurarc @@ -9,7 +9,6 @@ set pages-per-row 1 # Stop at page boundries set scroll-page-aware "true" -set smooth-scroll "true" set scroll-full-overlap 0.01 # Zoom settings diff --git a/template/zsh/.zshrc b/template/zsh/.zshrc index fcbd71c..fa72c1b 100755 --- a/template/zsh/.zshrc +++ b/template/zsh/.zshrc @@ -4,6 +4,9 @@ # Load aliases [ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" +# Load environment +[ -f "$HOME/.aliasrc" ] && source "$HOME/.envrc" + ######### # zplug # ######### @@ -87,10 +90,6 @@ setopt AUTO_CONTINUE # Don’t write over existing files with >, use >! instead setopt NOCLOBBER -# ls Colors -LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:'; -export LS_COLORS - # Completion zmodload zsh/complist autoload -Uz compinit @@ -122,36 +121,3 @@ zstyle ':completion:*' cache-path ~/.zsh/cache # bindkey "^[[B" history-beginning-search-forward bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down - -############### -# Environment # -############### - -# bin -export PATH=/home/ianmethyst/.local/bin:$PATH - -# fzf -export FZF_DEFAULT_COMMAND='ag --hidden -g ""' -export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - -# Keychain -if [ -z ${DISPLAY+x} ]; then - eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)" -else - eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" -fi - -# fnm -export PATH=/home/ianmethyst/.fnm:$PATH -eval "`fnm env --multi`" - -# NVM -#export NODE_OPTIONS="--max-old-space-size=1024" -#export NVM_DIR="$HOME/.nvm" -#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -# Base 16 -#BASE16_SHELL_SET_BACKGROUND=false -#BASE16_SHELL=$HOME/.config/base16-shell/ -#[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"