aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2019-06-24 00:00:15 -0700
committerRaúl Benencia <rul@kalgan.cc>2019-06-24 00:01:34 -0700
commit88fd5bed96899f99f425773f439852b4e690510c (patch)
tree9c94be1fd6a7611a53aef952e23cb714787ef249
parent284c8327c95bb0c71b111ebf95723a35a478295c (diff)
Add .bashrc and related
-rw-r--r--.alias.d/00-general19
-rw-r--r--.alias.d/05-debian2
-rw-r--r--.alias.d/10-git127
-rw-r--r--.bashrc109
-rw-r--r--.environment42
5 files changed, 299 insertions, 0 deletions
diff --git a/.alias.d/00-general b/.alias.d/00-general
new file mode 100644
index 0000000..e6d1b1f
--- /dev/null
+++ b/.alias.d/00-general
@@ -0,0 +1,19 @@
+# aliases
+alias grep='grep --color'
+alias ec="$EDITOR"
+alias psc='ps xawf -eo pid,user,cgroup,args'
+alias gcm='git checkout master && git fetch upstream && git reset --hard upstream/master && git push'
+alias cdp='cd $HOME/git/te/puppet/'
+
+alias df='df -h -x none'
+alias free='free -m'
+alias c='cd; clear'
+alias ls='ls -b -CF --color=auto'
+alias l=ls
+alias ll='ls -lS'
+alias dir='ls -lha'
+alias du='du -h'
+alias cal='cal -3'
+alias edit=$EDITOR
+alias e=$EDITOR
+alias mtr='mtr --curses'
diff --git a/.alias.d/05-debian b/.alias.d/05-debian
new file mode 100644
index 0000000..a283290
--- /dev/null
+++ b/.alias.d/05-debian
@@ -0,0 +1,2 @@
+alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
+alias lf='lintian --color always --pedantic -I' \ No newline at end of file
diff --git a/.alias.d/10-git b/.alias.d/10-git
new file mode 100644
index 0000000..d067f8d
--- /dev/null
+++ b/.alias.d/10-git
@@ -0,0 +1,127 @@
+# stolen from oh-my-zsh git plugin
+alias g='git'
+
+alias ga='git add'
+alias gaa='git add --all'
+alias gapa='git add --patch'
+
+alias gb='git branch'
+alias gba='git branch -a'
+alias gpb='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
+alias gbda='git branch --merged | command grep -vE "^(\*|\s*master\s*$)" | command xargs -n 1 git branch -d'
+alias gbl='git blame -b -w'
+alias gbnm='git branch --no-merged'
+alias gbr='git branch --remote'
+alias gbs='git bisect'
+alias gbsb='git bisect bad'
+alias gbsg='git bisect good'
+alias gbsr='git bisect reset'
+alias gbss='git bisect start'
+
+alias gc='git commit -v'
+alias gc!='git commit -v --amend'
+alias gca='git commit -v -a'
+alias gca!='git commit -v -a --amend'
+alias gcan!='git commit -v -a -s --no-edit --amend'
+alias gcam='git commit -a -m'
+alias gcb='git checkout -b'
+alias gcf='git config --list'
+alias gcl='git clone --recursive'
+alias gclean='git clean -fd'
+alias gpristine='git reset --hard && git clean -dfx'
+#alias gcm='git checkout master'
+#alias gcmsg='git commit -m'
+alias gco='git checkout'
+alias gcount='git shortlog -sn'
+
+alias gcp='git cherry-pick'
+alias gcs='git commit -S'
+
+alias gd='git diff'
+alias gdca='git diff --cached'
+alias gdt='git diff-tree --no-commit-id --name-only -r'
+
+alias gdw='git diff --word-diff'
+
+alias gf='git fetch'
+alias gfa='git fetch --all --prune'
+alias gfo='git fetch origin'
+
+alias gg='git gui citool'
+alias gga='git gui citool --amend'
+alias ggpull='git pull origin $(current_branch)'
+alias gignore='git update-index --assume-unchanged'
+alias gignored='git ls-files -v | grep "^[[:lower:]]"'
+alias gk='\gitk --all --branches'
+alias gke='\gitk --all $(git log -g --pretty=format:%h)'
+alias gl='git pull'
+alias glg='git log --stat --color'
+alias glgp='git log --stat --color -p'
+alias glgg='git log --graph --color'
+alias glgga='git log --graph --decorate --all'
+alias glgm='git log --graph --max-count=10'
+alias glo='git log --oneline --decorate --color'
+alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
+alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
+alias glog='git log --oneline --decorate --color --graph'
+alias glp="_git_log_prettily"
+
+alias gm='git merge'
+alias gmom='git merge origin/master'
+alias gmt='git mergetool --no-prompt'
+alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
+alias gmum='git merge upstream/master'
+
+alias gp='git push'
+alias gpd='git push --dry-run'
+alias gpoat='git push origin --all && git push origin --tags'
+
+alias gpu='git push upstream'
+alias gpv='git push -v'
+
+alias gr='git remote'
+alias gra='git remote add'
+alias grb='git rebase'
+alias grba='git rebase --abort'
+alias grbc='git rebase --continue'
+alias grbi='git rebase -i'
+alias grbm='git rebase master'
+alias grbs='git rebase --skip'
+alias grh='git reset HEAD'
+alias grhh='git reset HEAD --hard'
+alias grmv='git remote rename'
+alias grrm='git remote remove'
+alias grset='git remote set-url'
+alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
+alias gru='git reset --'
+alias grup='git remote update'
+alias grv='git remote -v'
+
+alias gsb='git status -sb'
+alias gsd='git svn dcommit'
+alias gsi='git submodule init'
+alias gsps='git show --pretty=short --show-signature'
+alias gsr='git svn rebase'
+alias gss='git status -s'
+alias gst='git status'
+alias gsta='git stash'
+alias gstaa='git stash apply'
+alias gstd='git stash drop'
+alias gstl='git stash list'
+alias gstp='git stash pop'
+alias gsts='git stash show --text'
+alias gsu='git submodule update'
+
+alias gts='git tag -s'
+
+alias gunignore='git update-index --no-assume-unchanged'
+alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
+alias gup='git pull --rebase'
+alias gupv='git pull --rebase -v'
+
+alias gvt='git verify-tag'
+
+alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
+alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"'
+alias git-delete-merged-branches='git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d'
+alias gfrh='git fetch && git reset --hard "origin/$(git rev-parse --abbrev-ref HEAD)"'
diff --git a/.bashrc b/.bashrc
new file mode 100644
index 0000000..b5907f1
--- /dev/null
+++ b/.bashrc
@@ -0,0 +1,109 @@
+# Debian packages: fzf
+
+# If not running interactively, don't do anything else
+[ -z "$PS1" ] && return
+
+if [ -f $HOME/.environment ]; then
+ . $HOME/.environment
+fi
+
+eval `dircolors 2>/dev/null`
+
+# don't put duplicate lines in the history
+export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+# store multi-line commands in history
+shopt -s cmdhist
+
+# this breaks eg "bts show #nnnnnn"
+shopt -u interactive_comments
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# Name directory to change to it.
+shopt -s autocd
+
+# Disable XOFF, for f*** sake
+stty -ixon
+
+# enable completion
+if [ -f /etc/bash_completion ]; then
+ . /etc/bash_completion
+fi
+
+# enable fzf completion if available
+if [ -f /usr/share/bash-completion/completions/fzf ]; then
+ . /usr/share/bash-completion/completions/fzf
+fi
+
+if [ -f /usr/share/doc/fzf/examples/key-bindings.bash ]; then
+ . /usr/share/doc/fzf/examples/key-bindings.bash
+fi
+
+# enable local completion
+if [ -d ~/.bash_completion.d/ ]; then
+ for f in $(find ~/.bash_completion.d/ -type f); do
+ . $f
+ done
+fi
+
+# aliases
+if [ -e ~/.alias.d/ ]; then
+ for e in $(find ~/.alias.d/ -type f); do
+ . $e
+ done
+fi
+
+umask 022
+
+update_title () {
+ printf "\e]0;$USER@$HOSTNAME: %s\a" "$1"
+}
+
+# Update title before executing a command: set it to the full command
+show_command () {
+ this_command="`history 1`"
+ update_title "${this_command/+([ ])+([0-9])+([ ])/}"
+}
+
+# Things to do before displaying the command prompt, including printing
+# nonzero exit status of the last run command, and setting the git branch.
+prompt_command_notitle () {
+ local code="$?"
+ if [ "$code" -ne 0 ]; then
+ echo "- exit $code"
+ fi
+
+ local fullbranch="$(cat .git/HEAD 2>/dev/null)"
+ if [ "$fullbranch" = "" ]; then
+ local fullbranch="$(git symbolic-ref HEAD 2>/dev/null)"
+ fi
+ local branch="${fullbranch##*/}"
+ vcsinfo="${branch:+#$branch}"
+}
+
+prompt_command () {
+ prompt_command_notitle
+ update_title
+}
+
+PS1='\u@\h:\w$vcsinfo> '
+
+case "$TERM" in
+xterm*|rxvt*|screen)
+ PS1="\[\e]0;\u@\h:\w\a\]$PS1"
+ trap show_command DEBUG
+ PROMPT_COMMAND=prompt_command
+ ;;
+*)
+ PROMPT_COMMAND=prompt_command_notitle
+ ;;
+esac
+
+export HISTFILESIZE=
+export HISTSIZE=
diff --git a/.environment b/.environment
new file mode 100644
index 0000000..03ffd61
--- /dev/null
+++ b/.environment
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Global environment file. Sourced at shell start and X start.
+# Keep it simple and POSIX
+
+# Select an editor.
+if [ -x "`which emacsclient`" ]; then
+ export EDITOR="emacsclient -c --alternate-editor=vi"
+else
+ export EDITOR=vi
+fi
+
+if [ -x "`which lesspipe`" ]; then
+ eval `lesspipe`
+fi
+
+# Set COLORTERM for slang programs if this is a color terminal
+if [ "$TERM" = "xterm" -o "$TERM" = "linux" -o "$TERM" = "kitty" ]; then
+ export COLORTERM=y
+fi
+
+# Debian settings.
+export DEBEMAIL=rul@kalgan.cc
+export DEBFULLNAME="Raúl Benencia"
+
+# Use $HOME/tmp when possible, out of general paranoia.
+# So many programs have /tmp symlink races...
+TMPDIR=$HOME/tmp
+export TMPDIR
+
+TMP=$HOME/tmp
+export TMP
+
+export GOPATH=$HOME/src/go
+PATH="$GOPATH/bin:$PATH"
+
+GEM=~/.gem/ruby/2.3.0/bin/
+# set PATH so it includes user's private bin if it exists
+if [ -d "$GEM" ] ; then
+ PATH="$GEM:$PATH"
+fi
+
+PATH="$HOME/bin:$HOME/.local/bin:$PATH:/usr/sbin:/sbin"
nihil fit ex nihilo