Skip to content

Vim distribution mainly aimed for Rubyists with the best tools to use ctags

Notifications You must be signed in to change notification settings

lcapillera/vinimum

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vinimum

A minimal vim config file and plugins distribution.

The project aims to provide the minimum useful set of plugins avoid that ones which discourages using vim the way it is.

Installation

  1. Basic package installation

    git clone https://github.com/spastorino/vinimum.git .vim
    ln -s .vim/vimrc .vimrc
    cd .vim
    git submodule init
    git submodule update
  2. Install ctags related things

    brew install ctags (or use the package manager you like/have)
    gem install gem-browse
    gem install gem-ctags
    gem ctags
  3. Generate ctags for Ruby stdlib

    These are the right directories for rbenv
    cd ~/.rubies/2.0.0/lib/ruby/site_ruby/2.0.0
    ctags -R *
    cd ~/.rubies/2.0.0/lib/ruby/2.0.0
    ctags -R *
  4. Create git hooks to automatically generate ctags on your projects

    cd ~
    mkdir -p .git/hooks

    create ctags file with the following content

    #!/bin/sh
    IGNORE=("/usr" "${HOME}/.gem" "${HOME}/.rbenv");
    for dir in "${IGNORE[@]}"
    do
      case "$PWD" in
        ${dir}*) exit 0;;
      esac
    done
    
    mkdir .git/tags_lock 2>/dev/null || exit 0
    trap "rmdir .git/tags_lock; rm .git/tags.$$" EXIT
    
    git ls-files | ctags --tag-relative -f .git/tags.$$ --languages=-sql -L -
    mv .git/tags.$$ .git/tags

    create post-commit file with the following content

    #!/bin/sh
    .git/hooks/ctags >/dev/null 2>&1 &

    generate post-checkout and post-merge with the same content

    cp post-commit post-checkout
    cp post-commit post-merge

    create post-rewrite file with the following content

    #!/bin/sh
    case "$1" in
     rebase) exec .git/hooks/post-merge ;;
    esac

    make the files executable

    chmod +x *

    config the templatedir and ctags alias

    git config --global init.templatedir '~/.git'
    git config --global alias.ctags '!.git/hooks/ctags'

    Use ‘git init` in existing repositories to copy these hooks in.

About

Vim distribution mainly aimed for Rubyists with the best tools to use ctags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%