Skip to content

Instantly share code, notes, and snippets.

@mariogarcia
Created October 2, 2013 10:24
Show Gist options
  • Save mariogarcia/6791684 to your computer and use it in GitHub Desktop.
Save mariogarcia/6791684 to your computer and use it in GitHub Desktop.
File patterns to enable ctags on Vim
--langdef=groovy
--langmap=groovy:.groovy
--regex-groovy=/^[ \t]*[(private|public|protected) ( \t)]*[A-Za-z0-9_<>]+[ \t]+([A-Za-z0-9_]+)[ \t]*\(.*\)[ \t]*\{/\1/f,function,functions/
--regex-groovy=/^[ \t]*def[ \t]+([A-Za-z0-9_]+)[ \t]*\=[ \t]*\{/\1/f,function,functions/
--regex-groovy=/^[ \t]*private def[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/v,private,private variables/
--regex-groovy=/^[ \t]*def[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/u,public,public variables/
--regex-groovy=/^[ \t]*[abstract ( \t)]*[(private|public) ( \t)]*class[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class,classes/
--regex-groovy=/^[ \t]*[abstract ( \t)]*[(private|public) ( \t)]*enum[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class,classes/
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'kien/ctrlp.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'msanders/snipmate.vim'
Bundle 'Raimondi/delimitMate'
Bundle 'vim-scripts/VimClojure'
Bundle 'mattn/emmet-vim'
Bundle 'docunext/closetag.vim'
Bundle 'majutsushi/tagbar'
Bundle 'godlygeek/tabular'
set nu
syntax on
colorscheme peachpuff
set laststatus=2
set nowrap
set wildignore+=*/tmp/*,*.class,
set cursorline
set nobackup
set nowritebackup
set noswapfile
set expandtab " I don't want tabs, just spaces
set shiftwidth=4 " How many spaces to use when autoindenting
set tabstop=4 " How many spaces to write on TAB
set smarttab " Use my shiftwidth when using tab
set textwidth=100 " Max char count in a line before doing a hard break
set autoindent " Keep indentation of previous line on new line
set smartindent " autoindent some structures (like lines after {, etc)
filetype plugin indent on
map <silent> Q :ccl<CR>
map <S-w> :NERDTreeToggle<CR>
:imap jk <Esc>
" Tagbar
let g:tagbar_ctags_bin='/usr/bin/ctags'
nmap <F8> :TagbarToggle<CR>
let g:tagbar_type_groovy = {
\ 'ctagstype' : 'groovy',
\ 'kinds' : [
\ 'p:package',
\ 'c:class',
\ 'i:interface',
\ 'f:function',
\ 'v:variables',
\ ]
\ }
au BufNewFile,BufRead *.gradle set filetype=groovy
au BufNewFile,BufRead *.coffee set filetype=groovy
au BufNewFile,BufRead *.scala set filetype=java
au BufNewFile,BufRead *.clj set filetype=clojure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment