Skip to content

Instantly share code, notes, and snippets.

@everaldo
Last active June 30, 2019 15:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everaldo/7183298 to your computer and use it in GitHub Desktop.
Save everaldo/7183298 to your computer and use it in GitHub Desktop.
fugitive.vim (vim-fugitive): a git wrapper ctags: index and navegation of source files References: http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html https://github.com/tpope/vim-fugitive
# Put the content of this file in: .git_template/hooks/ctags and give execution permission
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
trap "rm -f .git/tags.$$" EXIT
ctags --tag-relative -Rf.git/tags.$$ --exclude=.git --languages=-javascript,sql
mv .git/tags.$$ .git/tags
# Pathogen.vim must be installed before those commands
# https://github.com/tpope/vim-pathogen
cd ~/.vim/bundle
git clone git://github.com/tpope/vim-fugitive.git
# post-commit, post-merge, and post-checkout
# remember to mark them as executable
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
# For Linux
sudo apt-get install exuberant-ctags
# For Mac
brew install ctags
# Git will use this template when creating or cloning a repository
git config --global init.templatedir '~/.git_template'
mkdir -p ~/.git_template/hooks
git config --global alias.ctags '!.git/hooks/ctags'
#!/bin/sh
case "$1" in
rebase) exec .git/hooks/post-merge ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment