-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·74 lines (65 loc) · 2.75 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
do_install() {
local basefile="$1"
local rccmd="$2"
[ -z "$rccmd" ] && rccmd="source ~/.dotfiles/$basefile"
local sysfile=~/.${basefile}
local dotfile="~/.dotfiles/${basefile}"
echo -n "Installing ${dotfile} to ${sysfile} ... "
if [ -e $sysfile ] && grep -F -q "$rccmd" $sysfile; then
echo already installed.
else
echo ${rccmd} >> ${sysfile}
echo ok.
fi
}
install_link() {
local src="$1"
local dest="$2"
if [ -L "$dest" ]; then
ln -f -v -s "$src" "$dest"
elif [ ! -e "$dest" ]; then
ln -v -s "$src" "$dest"
else
echo $dest already exists, but is not a symbolic link
fi
}
do_install bashrc
do_install vimrc
do_install gvimrc
do_install tmux.conf
do_install sqliterc ".read $HOME/.dotfiles/sqliterc"
install_link ~/.dotfiles/colordiffrc ~/.colordiffrc
echo -n "Updating git config ... "
git config --global alias.cf 'commit -m FIXME'
git config --global alias.blaame 'blame -w -C -C -C'
git config --global alias.branch-name 'rev-parse --abbrev-ref HEAD'
git config --global alias.ca 'commit -v --amend'
git config --global alias.co 'checkout'
git config --global alias.cv 'commit -v'
git config --global alias.dc 'diff --cached'
git config --global alias.ds 'diff --stat'
git config --global alias.dsc 'diff --stat --cached'
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
git config --global alias.lf 'log --date=local --stat'
git config --global alias.mff 'merge --ff-only'
git config --global alias.pushf 'push --force-with-lease'
git config --global alias.recent-branches "for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(authorname) %(refname:short)'"
git config --global alias.st 'status -s'
git config --global alias.stashed "stash list --pretty=format:'%gd: %Cred%h%Creset %Cgreen[%ar]%Creset %s'"
git config --global alias.steve 'tag -f steve-was-here'
git config --global alias.toplevel 'rev-parse --show-toplevel'
git config --global color.ui true
git config --global core.excludesfile ~/.dotfiles/gitignore
git config --global diff.renames true
git config --global diff.tool console
git config --global difftool.console.cmd 'colordiff -y -W $( tput cols ) $LOCAL $REMOTE'
git config --global gpg.format ssh
git config --global gpg.ssh.allowedsignersfile ~/.ssh/allowed_signers
git config --global gpg.ssh.defaultKeyCommand ~/.dotfiles/bin/git-signing-key
git config --global includeif.gitdir:~/projects/work/.path ~/.dotfiles/git/config.work
git config --global init.defaultBranch main
git config --global pull.ff only
git config --global push.autoSetupRemote true
git config --global user.name 'Stephen Thirlwall'
echo ok.