summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2019-01-29 03:36:34 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2019-01-30 16:25:39 (GMT)
commit534da3e211edc7cc69161acc6626111edbe9711f (patch)
treecdb0e24a2d9179414d9aff84c68845fe86663b5f
downloaddotfiles-534da3e211edc7cc69161acc6626111edbe9711f.zip
dotfiles-534da3e211edc7cc69161acc6626111edbe9711f.tar.gz
dotfiles-534da3e211edc7cc69161acc6626111edbe9711f.tar.bz2
Import to new dotfiles repository
-rw-r--r--.bash_profile12
-rw-r--r--.bashrc112
-rw-r--r--.gitconfig73
-rw-r--r--.inputrc26
-rwxr-xr-x.xprofile3
5 files changed, 226 insertions, 0 deletions
diff --git a/.bash_profile b/.bash_profile
new file mode 100644
index 0000000..27c5b17
--- /dev/null
+++ b/.bash_profile
@@ -0,0 +1,12 @@
+# .bash_profile
+
+# Get the aliases and functions
+if [ -f ~/.bashrc ]; then
+ . ~/.bashrc
+fi
+
+# User specific environment and startup programs
+
+PATH=$PATH:$HOME/.local/bin:$HOME/bin
+
+export PATH
diff --git a/.bashrc b/.bashrc
new file mode 100644
index 0000000..bd5c920
--- /dev/null
+++ b/.bashrc
@@ -0,0 +1,112 @@
+# .bashrc
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+ . /etc/bashrc
+fi
+
+# Shell control
+export HISTCONTROL=ignorespace:erasedups
+export HISTSIZE=100000
+export HISTFILESIZE=100000
+shopt -s histappend
+shopt -s checkwinsize
+
+# User specific aliases and functions
+alias rm='rm -i'
+alias l='less -N'
+alias dotgit='/usr/bin/git --git-dir=$HOME/code/dotfiles.git --work-tree=$HOME'
+
+# Emacs tramp wants a simple prompt that it can recognize
+if [[ "$TERM" = "dumb" ]]; then
+ export PS1="> "
+fi
+
+# Change to the correct sibling of a parent directory
+cd_parent_sibling ()
+{
+ local sibling_name="$2";
+ local curname="";
+ local curtop="$PWD";
+ local finaltop=""
+ while [ ! "$curtop" = "/" ]; do
+ if [ -d $(dirname $curtop)/$sibling_name ]; then
+ finaltop=$(dirname $curtop)/$sibling_name;
+ break;
+ fi
+ curname=$(basename $curtop)/$curname;
+ curtop=$(dirname $curtop);
+ done
+ if [ ! -z "$finaltop" ]; then
+ if [ ! -z "$3" ]; then
+ if [ ! -d $finaltop/$curname ]; then
+ echo "$finaltop found but $finaltop/$curname not found";
+ fi
+ finaltop=$finaltop/$curname;
+ fi
+ if [ -d $finaltop ]; then
+ echo "$1 $finaltop"
+ $1 $finaltop
+ fi
+ else
+ echo "parent directory with sibling $sibling_name not found"
+ fi
+}
+
+# Change to build directory
+cdb ()
+{
+ if [ -z "$1" ]; then
+ cd_parent_sibling cd build t;
+ else
+ cd_parent_sibling cd "$1" t;
+ fi
+}
+
+# Change to source directory
+cds ()
+{
+ if [ -z "$1" ]; then
+ cd_parent_sibling cd source t;
+ else
+ cd_parent_sibling cd "$1" t;
+ fi
+}
+
+# Push to top of build directory
+cdbt ()
+{
+ if [ -z "$1" ]; then
+ cd_parent_sibling pushd build;
+ else
+ cd_parent_sibling pushd "$1";
+ fi
+}
+
+# Push to top of source directory
+cdst ()
+{
+ if [ -z "$1" ]; then
+ cd_parent_sibling pushd source;
+ else
+ cd_parent_sibling pushd "$1";
+ fi
+}
+
+# An emacs 'alias' with the ability to read from stdin; example:
+# echo "hello world" | ef -
+ef()
+{
+ # If the argument is - then write stdin to a tempfile and open the
+ # tempfile.
+ if [[ "$1" == "-" ]]; then
+ tempfile=$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)
+ cat - > $tempfile
+ emacsclient -n -c -e "(progn (find-file \"$tempfile\")
+ (set-visited-file-name nil)
+ (rename-buffer \"*stdin*\" t))
+ " 2>&1 > /dev/null
+ else
+ emacsclient -n -c "$@"
+ fi
+}
diff --git a/.gitconfig b/.gitconfig
new file mode 100644
index 0000000..be8aad9
--- /dev/null
+++ b/.gitconfig
@@ -0,0 +1,73 @@
+# Most of the configuration stolen from here:
+# https://github.com/arrelid/preferences/blob/master/dotfiles/gitconfig
+
+[alias]
+ ap = add --patch
+ br = branch
+ ci = commit
+ cia = commit --amend
+ co = checkout
+ df = diff
+ dfc = diff --cached
+ st = status
+
+ # When cherry-picking, put the original commit hash in the commit message.
+ cp = cherry-pick -x
+
+ # Tips and tricks for how to make logging prettier
+ # http://robey.lag.net/2008/07/13/git-for-the-real-world.html
+ # http://www.jukie.net/~bart/blog/pimping-out-git-log
+ lg = log --graph --topo-order --abbrev-commit --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cred<%an>%Creset'
+
+ # git will outsmart you and try to fast-forward when you merge, i.e. history wont
+ # show that you've worked on a branch. This is just fine in most cases, but it's
+ # not the right thing for feature branches, and hence you need to tell git not
+ # to fast-forward when merging in these cases.
+ mgnf = merge --no-ff
+
+ # When stashing, keep the stuff you've already added to the index in there. In
+ # other words, stash whatever git diff tells you differs.
+ stu = stash --keep-index
+
+ # For those times when you just want to rewind time...
+ uncommit = reset --soft HEAD^
+ unstage = reset HEAD
+
+[branch]
+ autosetuprebase = always
+
+[color]
+ ui = auto
+
+[core]
+ autocrlf = input
+ safecrlf = true
+ whitespace = trailing-space,space-before-tab
+ excludesfile = ~/.gitignore
+ quotepath = false
+
+[gc]
+ # Perform GC automagically, when needed
+ auto = 1
+
+[merge]
+ # Show common ancestor when merge fails
+ # http://psung.blogspot.com/2011/02/reducing-merge-headaches-git-meets.html
+ conflictstyle = diff3
+
+ # The default merge commit message is fairly meaningless, so lets include
+ # a summary of what the merge includes
+ summary = true
+
+[push]
+ # Only push the current branch you're on
+ default = tracking
+
+[rerere]
+ # Reuse previously recorded merge solution
+ # http://psung.blogspot.com/2011/02/reducing-merge-headaches-git-meets.html
+ enabled = 1
+
+[user]
+ name = Ravi R Kiran
+ email = aine.marina@gmail.com
diff --git a/.inputrc b/.inputrc
new file mode 100644
index 0000000..a6c393c
--- /dev/null
+++ b/.inputrc
@@ -0,0 +1,26 @@
+# Swap history search keys
+
+"\e[5~": previous-history
+"\eOA": history-search-backward
+"\e[A": history-search-backward
+
+"\e[6~": next-history
+"\eOB": history-search-forward
+"\e[B": history-search-forward
+
+set completion-ignore-case on
+set completion-prefix-display-length 2
+$if term=dumb
+# Nothing to do
+$else
+Control-j: menu-complete
+Control-l: menu-complete-backward
+$endif
+
+set show-all-if-ambiguous on
+set show-all-if-unmodified on
+set completion-map-case on
+
+"\e[C": forward-char
+"\e[D": backward-char
+
diff --git a/.xprofile b/.xprofile
new file mode 100755
index 0000000..84a8224
--- /dev/null
+++ b/.xprofile
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+xkbcomp ~/code/rewrite.emacs.d/xkb/ergodox.xkb $DISPLAY