summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-05-04 12:38:10 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-05-04 12:38:10 +0100
commit9b8c4db81cc090e516efaa37c3a61fb38eacc0b3 (patch)
tree7b4b95df737d1d4d79748687a0a16bf6081387d3
parented33b82654d2c5099d73394a806cb31e53cec4ce (diff)
Added git hooks for ctags
-rw-r--r--.gitignore1
-rwxr-xr-xgit_template/hooks/ctags8
-rwxr-xr-xgit_template/hooks/post-checkout2
-rwxr-xr-xgit_template/hooks/post-commit2
-rwxr-xr-xgit_template/hooks/post-merge2
-rwxr-xr-xgit_template/hooks/post-rewrite4
-rw-r--r--gitconfig4
-rwxr-xr-xmake4
-rw-r--r--vimrc7
9 files changed, 28 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 43fa848..8719276 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
mutt/cache/
mutt/mailboxes/
+vim/vimundo/*
vim/bundle/
vifm/Trash
vifm/vimfiles
diff --git a/git_template/hooks/ctags b/git_template/hooks/ctags
new file mode 100755
index 0000000..a9a2150
--- /dev/null
+++ b/git_template/hooks/ctags
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+PATH="/usr/local/bin:$PATH"
+dir="`git rev-parse --git-dir`"
+trap 'rm -f "$dir/$$.tags"' EXIT
+git ls-files | ctags --tag-relative -L - -f"$dir/$$.tags" --languages=-javascript,sql
+mv "$dir/$$.tags" "$dir/tags"
+
diff --git a/git_template/hooks/post-checkout b/git_template/hooks/post-checkout
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-checkout
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-commit b/git_template/hooks/post-commit
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-merge b/git_template/hooks/post-merge
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-merge
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-rewrite b/git_template/hooks/post-rewrite
new file mode 100755
index 0000000..fe8972d
--- /dev/null
+++ b/git_template/hooks/post-rewrite
@@ -0,0 +1,4 @@
+#!/bin/sh
+case "$1" in
+ rebase) exec .git/hooks/post-merge ;;
+esac
diff --git a/gitconfig b/gitconfig
index 76de2f6..4cf00e0 100644
--- a/gitconfig
+++ b/gitconfig
@@ -1,3 +1,7 @@
[user]
name = Urbain Vaes
email = u.vaes13@imperial.ac.uk
+[init]
+ templatedir = ~/.git_template
+[alias]
+ ctags = !.git/hooks/ctags
diff --git a/make b/make
index 1f464de..30891b3 100755
--- a/make
+++ b/make
@@ -4,7 +4,7 @@ dir=~/dotfiles
olddir=~/dotfiles_old
# Files to sync
-files="vim vimrc mutt passwords vifm msmtprc bashrc zshrc xmodmap mynotes tmux.conf zathurarc offlineimaprc offlineimap.py inputrc latexmkrc crontab gitconfig tmuxlinerc"
+files="vim vimrc mutt passwords vifm msmtprc bashrc zshrc xmodmap mynotes tmux.conf zathurarc offlineimaprc offlineimap.py inputrc latexmkrc crontab gitconfig git_template tmuxlinerc"
rm -rf $olddir
mkdir -p $olddir
@@ -41,7 +41,7 @@ cd mutt
mkdir temp
# Tmux
-cd
+cd
rm -rf .tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
tmux source-file ~/.tmux.conf
diff --git a/vimrc b/vimrc
index f434f28..c205630 100644
--- a/vimrc
+++ b/vimrc
@@ -136,22 +136,21 @@ set nowrap
set linebreak
set textwidth=0
set conceallevel=2
+set formatprg=par\ w70
set guifont=Monaco\ 11
-set lazyredraw
-highlight diffAdded guifg=#00bf00
-highlight diffRemoved guifg=#bf0000
" Case and spell
set nospell
set smartcase
set ignorecase
-" General
+" Misc
set noautochdir
set cpoptions+=I
set encoding=utf-8
set mouse=a
set clipboard=unnamedplus
+set lazyredraw
" Leader-maps