From 45503702fdb366ad643f4827e50c0df7cf93980e Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 13 Jan 2021 23:31:44 +0100 Subject: Reorder using Stow better --- bash/.bash_aliases | 44 ---------------------------------- bash/.bash_profile | 4 ---- bash/.bashrc | 65 --------------------------------------------------- bash/dot-bash_aliases | 44 ++++++++++++++++++++++++++++++++++ bash/dot-bash_profile | 4 ++++ bash/dot-bashrc | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 bash/.bash_aliases delete mode 100644 bash/.bash_profile delete mode 100644 bash/.bashrc create mode 100644 bash/dot-bash_aliases create mode 100644 bash/dot-bash_profile create mode 100644 bash/dot-bashrc (limited to 'bash') diff --git a/bash/.bash_aliases b/bash/.bash_aliases deleted file mode 100644 index 55b8292..0000000 --- a/bash/.bash_aliases +++ /dev/null @@ -1,44 +0,0 @@ -# vimdiff style with nvim -alias vim='nvim' -alias nvimdiff='nvim -d' - -# ssh as root -> Sysadmin trick -alias r='ssh -l root' - -# fuck! -alias fuck='COMMAND=$(history -p \!\!); echo sudo $COMMAND; sudo $COMMAND' - -# enable color support of ls and also add handy aliases -alias ls='ls --color=auto' -alias grep='grep --color=auto' -alias fgrep='fgrep --color=auto' -alias egrep='egrep --color=auto' - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -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$//'\'')"' - - -# alias for Node.js projects -alias ntree='tree -I node_modules' -# alias for Clojure projects -alias ctree='tree -I target' - -# Clean whiteboards! -# found at: https://gist.github.com/lelandbatey/8677901 -alias whiteboard="convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2" - -# Pandoc for ElenQ -alias pandoc-xelatex="pandoc $@ --pdf-engine=xelatex --to latex -N" -alias elenqdoc-article="pandoc-xelatex $@ --standalone --template elenq-article --metadata=documentclass:article" -alias elenqdoc-book="pandoc-xelatex $@ --standalone --template elenq-book --metadata=documentclass:book --top-level-division=chapter" - -# Kitty -if [ $TERM = "xterm-kitty" ]; then - alias ssh="kitty +kitten ssh" -fi diff --git a/bash/.bash_profile b/bash/.bash_profile deleted file mode 100644 index 7d5f3c9..0000000 --- a/bash/.bash_profile +++ /dev/null @@ -1,4 +0,0 @@ -# Load bashrc to mantain only one file -if [ -f "$HOME/.bashrc" ]; then - source "$HOME/.bashrc" -fi diff --git a/bash/.bashrc b/bash/.bashrc deleted file mode 100644 index df74698..0000000 --- a/bash/.bashrc +++ /dev/null @@ -1,65 +0,0 @@ -# Bash initialization for interactive non-login shells and -# for remote shells (info "(bash) Bash Startup Files"). - -export SHELL - -if [[ $- != *i* ]] -then - # We are being invoked from a non-interactive shell. If this - # is an SSH session (as in "ssh host command"), source - # /etc/profile so we get PATH and other essential variables. - [[ -n "$SSH_CLIENT" ]] && source /etc/profile - - # Don't do anything else. - return -fi - -source /etc/bashrc - -# VARIABLE EXPORTS -###################################################################### -export COLOR_BLACK="\[\033[0;30m\]" -export COLOR_RED="\[\033[0;31m\]" -export COLOR_GREEN="\[\033[0;32m\]" -export COLOR_YELLOW="\[\033[0;33m\]" -export COLOR_BLUE="\[\033[0;34m\]" -export COLOR_MAGENTA="\[\033[0;35m\]" -export COLOR_CYAN="\[\033[0;36m\]" -export COLOR_GREY="\[\033[0;37m\]" -export COLOR_DEFAULT="\[\033[0;39m\]" -export COLOR_WHITE=$COLOR_DEFAULT - -export EDITOR=nvim -PATH=$PATH:$HOME/.local/bin - -# PROMPT -PS1BASE="$COLOR_BLUE\u$COLOR_GREY@\h $COLOR_YELLOW\w\[\033[00m\]" - -#PS1BASE="$COLOR_CYAN\u $COLOR_YELLOW\w\[\033[m\]" -PS1GIT="$COLOR_BLUE\$(__git_ps1)$COLOR_DEFAULT" -PS1END="$COLOR_DEFAULT\$ " -export PS1="${PS1BASE}${PS1GIT}${PS1END}" - -# GUIX -###################################################################### - -# Adjust the prompt depending on whether we're in 'guix environment'. -if [ -n "$GUIX_ENVIRONMENT" ] -then - PS1="$PS1BASE$PS1GIT [env]$PS1END" -fi -###################################################################### - -# Pandoc bash completion -if hash pandoc 2>/dev/null; then - eval "$(pandoc --bash-completion)" -fi - -# Load in the git branch prompt script. -source ~/.git-prompt.sh - -# Load aliases -if [ -f ~/.bash_aliases ] ; then - . ~/.bash_aliases -fi - diff --git a/bash/dot-bash_aliases b/bash/dot-bash_aliases new file mode 100644 index 0000000..55b8292 --- /dev/null +++ b/bash/dot-bash_aliases @@ -0,0 +1,44 @@ +# vimdiff style with nvim +alias vim='nvim' +alias nvimdiff='nvim -d' + +# ssh as root -> Sysadmin trick +alias r='ssh -l root' + +# fuck! +alias fuck='COMMAND=$(history -p \!\!); echo sudo $COMMAND; sudo $COMMAND' + +# enable color support of ls and also add handy aliases +alias ls='ls --color=auto' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +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$//'\'')"' + + +# alias for Node.js projects +alias ntree='tree -I node_modules' +# alias for Clojure projects +alias ctree='tree -I target' + +# Clean whiteboards! +# found at: https://gist.github.com/lelandbatey/8677901 +alias whiteboard="convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2" + +# Pandoc for ElenQ +alias pandoc-xelatex="pandoc $@ --pdf-engine=xelatex --to latex -N" +alias elenqdoc-article="pandoc-xelatex $@ --standalone --template elenq-article --metadata=documentclass:article" +alias elenqdoc-book="pandoc-xelatex $@ --standalone --template elenq-book --metadata=documentclass:book --top-level-division=chapter" + +# Kitty +if [ $TERM = "xterm-kitty" ]; then + alias ssh="kitty +kitten ssh" +fi diff --git a/bash/dot-bash_profile b/bash/dot-bash_profile new file mode 100644 index 0000000..7d5f3c9 --- /dev/null +++ b/bash/dot-bash_profile @@ -0,0 +1,4 @@ +# Load bashrc to mantain only one file +if [ -f "$HOME/.bashrc" ]; then + source "$HOME/.bashrc" +fi diff --git a/bash/dot-bashrc b/bash/dot-bashrc new file mode 100644 index 0000000..df74698 --- /dev/null +++ b/bash/dot-bashrc @@ -0,0 +1,65 @@ +# Bash initialization for interactive non-login shells and +# for remote shells (info "(bash) Bash Startup Files"). + +export SHELL + +if [[ $- != *i* ]] +then + # We are being invoked from a non-interactive shell. If this + # is an SSH session (as in "ssh host command"), source + # /etc/profile so we get PATH and other essential variables. + [[ -n "$SSH_CLIENT" ]] && source /etc/profile + + # Don't do anything else. + return +fi + +source /etc/bashrc + +# VARIABLE EXPORTS +###################################################################### +export COLOR_BLACK="\[\033[0;30m\]" +export COLOR_RED="\[\033[0;31m\]" +export COLOR_GREEN="\[\033[0;32m\]" +export COLOR_YELLOW="\[\033[0;33m\]" +export COLOR_BLUE="\[\033[0;34m\]" +export COLOR_MAGENTA="\[\033[0;35m\]" +export COLOR_CYAN="\[\033[0;36m\]" +export COLOR_GREY="\[\033[0;37m\]" +export COLOR_DEFAULT="\[\033[0;39m\]" +export COLOR_WHITE=$COLOR_DEFAULT + +export EDITOR=nvim +PATH=$PATH:$HOME/.local/bin + +# PROMPT +PS1BASE="$COLOR_BLUE\u$COLOR_GREY@\h $COLOR_YELLOW\w\[\033[00m\]" + +#PS1BASE="$COLOR_CYAN\u $COLOR_YELLOW\w\[\033[m\]" +PS1GIT="$COLOR_BLUE\$(__git_ps1)$COLOR_DEFAULT" +PS1END="$COLOR_DEFAULT\$ " +export PS1="${PS1BASE}${PS1GIT}${PS1END}" + +# GUIX +###################################################################### + +# Adjust the prompt depending on whether we're in 'guix environment'. +if [ -n "$GUIX_ENVIRONMENT" ] +then + PS1="$PS1BASE$PS1GIT [env]$PS1END" +fi +###################################################################### + +# Pandoc bash completion +if hash pandoc 2>/dev/null; then + eval "$(pandoc --bash-completion)" +fi + +# Load in the git branch prompt script. +source ~/.git-prompt.sh + +# Load aliases +if [ -f ~/.bash_aliases ] ; then + . ~/.bash_aliases +fi + -- cgit v1.2.3