Haskell tags for vim, weehee

d0c19f2816cabfcc4dbab42d7a1f5b2d8e5c4bb6
Alexis Sellier committed ago 1 parent 5059bd8a
.vimrc +6 -0
44 44
set nostartofline
45 45
set cmdheight=1
46 46
set matchtime=2                     " Shorter brace match time
47 47
set textwidth=80
48 48
set virtualedit=block
49 +
set tags+=.tags
49 50
50 51
if !has("nvim")
51 52
  set nocompatible                  " Don't try to be compatible with vi
52 53
endif
53 54
80 81
au FileType c,cpp       set       sw=4 noexpandtab
81 82
au FileType lua         set       sw=2 expandtab
82 83
au FileType sh          set       sw=2 expandtab
83 84
au FileType vim         set sts=2 sw=2 expandtab
84 85
86 +
if executable('haskell-tags')
87 +
  au BufWritePost *.hs  silent !haskell-tags % '.tags'
88 +
  au BufWritePost *.hsc silent !haskell-tags % '.tags'
89 +
endif
90 +
85 91
" Remove trailing whitespace on save
86 92
autocmd BufWritePre * call s:StripTrailing()
87 93
function! s:StripTrailing()
88 94
    let l = line(".")
89 95
    let c = col(".")
bin/haskell-tags added +7 -0
1 +
#!/bin/sh
2 +
3 +
if [ ! -f .tags ]; then
4 +
  exec fast-tags -o $2 `ag --haskell -g ""`
5 +
else
6 +
  exec fast-tags -o $2 $1
7 +
fi