Skip to content

Commit

Permalink
Initial creation of dotfiles repository
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information
hxw committed Dec 22, 2009
0 parents commit a18342f
Show file tree
Hide file tree
Showing 6 changed files with 521 additions and 0 deletions.
53 changes: 53 additions & 0 deletions bash_aliases
@@ -0,0 +1,53 @@
# .bash_aliases

alias ll='ls -l'
alias la='ls -A'
alias lc='ls -CF'

# gnu diff does not have DIFFOPTIONS like FreeBSD so:
alias diff='diff -u'

alias reb='find . -name \*~ -print -delete'

export LESS="-iR"

if which eie > /dev/null 2>&1
then
alias edit="eie --no-frame"
alias ed="eie --no-wait"
export EDITOR="eie"
elif which jove > /dev/null 2>&1
then
alias edit="jove"
alias ed="jove"
export EDITOR="jove"
fi

# give lynx a custom configuration
alias lynx='lynx -nopause'

mkcd()
{
local dir
dir="$1"; shift

if [ -z "${dir}" ]
then
pwd
elif [ -d "${dir}" ]
then
cd "${dir}"
elif [ -f "${dir}" ]
then
echo A file of that name already exists
return 1
else
mkdir -p "${dir}"
cd "${dir}"
fi
return 0
}

if [ -f ~/.bash_aliases_extra ]; then
. ~/.bash_aliases_extra
fi
15 changes: 15 additions & 0 deletions git-global-ignore
@@ -0,0 +1,15 @@
# .git-global-ignore

# ignore emacs backups
*~

# object files
*.o

# library files
*.so
*.a

# other repositories
CVS
.svn
109 changes: 109 additions & 0 deletions gitconfig
@@ -0,0 +1,109 @@
# .gitconfig

[user]
email = @EMAIL@
name = @NAME@

[alias]
ci = commit --signoff
co = checkout
st = status
br = branch
praise = blame
sa = stash apply
sc = stash clear
ss = stash save

l1 = !git --no-pager log --max-count=1 HEAD
l3 = !git --no-pager log --max-count=3 HEAD
l5 = log --max-count=5 HEAD

# git-svn commands
# ================

up = svn rebase
dc = svn dcommit

# handling a local transient branch
# =================================

# the intended sequence is:
# git co master # if not already there
# git pull # update
# git today # create local today branch
# while work
# edit ${file}
# git add ${file}
# git ci
# gitk # see the state
# git fetch
# git rebase master
# git tidy # more than once
# git done

today = checkout -b today
tidy = rebase -i master
done = rebase today master

# rewrite history
# ===============

last10 = rebase -i HEAD~10
last5 = rebase -i HEAD~5
last2 = rebase -i HEAD~2
last1 = rebase -i HEAD

# and the last 10 commits will appear in your favourite $EDITOR. A sample excerpt:
# pick 5c6eb73 Added repo.or.cz link
# pick a311a64 Reordered analogies in "Work How You Want"
# pick 100834f Added push target to Makefile

# Then:
# Remove commits by deleting lines.
# Reorder commits by reordering lines.
# Replace "pick" with "edit" to mark a commit for amending.
# Replace "pick" with "squash" to merge a commit with the previous one.

# If you marked a commit for editing, then run:
amend = commit --amend

# otherwise, run:
cont = rebase --continue


# sending patches
# ===============

fp = format-patch -C
# sm = send-email --compose --no-chain-reply-to --suppress-from --to list@project.tld 00*.patch
sm = send-email --compose --no-chain-reply-to --suppress-from --bcc @EMAIL@


[sendemail]
# identity
# aliasesfile
# aliasfiletype
# to = devel@lists.openmoko.org
# cccmd
bcc = @EMAIL@
chainreplyto = false
# smtpserver = <smtp>
# smtpuser = <user>
# smtppass = <password>
smtpssl = false

[apply]
whitespace = strip

[diff]
color = auto
rename = copy

[pager]
color = true

[status]
color = auto

[core]
excludesfile = @HOME@.git-global-ignore
72 changes: 72 additions & 0 deletions install.sh
@@ -0,0 +1,72 @@
#!/bin/sh

list_sed=''
list_copy=''

SED()
{
list_sed="${list_sed} $*"
}

COPY()
{
list_copy="${list_copy} $*"
}

# list the files to install
# SED substitutes @NAME@ type of entries
# COPY just copies the file

SED gitconfig

COPY bashrc
COPY joverc
COPY tcshrc


# end of list
# ===========

ERROR()
{
echo error: $* 1>&2
exit 1
}

# get a string escaping / & for later sed substitution
# usage: var=$(get prompt message here) || exit 1
# note: need the exit as the ERROR only terminates the $() sub-shell
get()
{
local prompt data
read -p "$*: " -r data
[ -z "${data}" ] && ERROR field cannot be blank
printf '%s' "${data}" | sed 's/\\/\\\\/g;s,/,\\/,g;s,&,\\\&,g'
}


# main
# ====

echo this will install the files to: ${HOME}
echo Ctrl-C to abort


echo Enter some data for substitutions

name=$(get Enter full name) || exit 1
email=$(get Enter email address) || exit 1

for f in ${list_sed}
do
d="${HOME}/.${f}"
echo Substitute ${f} to ${d}
sed "s,@HOME@,${HOME}/,g;s/@EMAIL@/${email}/g;s/@NAME@/${name}/g;" "${f}" Z "${d}"
done

for f in ${list_copy}
do
d="${HOME}/.${f}"
echo Copy ${f} to ${d}
cp -p "${f}" "${d}"
done
21 changes: 21 additions & 0 deletions joverc
@@ -0,0 +1,21 @@
# .joverc

bind-to-key beginning-of-line ^[OH
bind-to-key beginning-of-line ^[[1~
bind-to-key end-of-line ^[OF
bind-to-key end-of-line ^[[4~

bind-to-key delete-next-character ^[[3~
bind-to-key save-file ^[OQ
bind-to-key save-file ^[[[B
bind-to-key delete-buffer ^[OR
bind-to-key delete-buffer ^[[[C
bind-to-key exit-jove ^[[23~
bind-to-key execute-kbd-macro ^[[19~

bind-to-key query-replace-string ^[%

bind-to-key previous-page ^[[5~
bind-to-key next-page ^[[6~

set case-ignore-search on

0 comments on commit a18342f

Please sign in to comment.