-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
159 lines (130 loc) · 3.91 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
" Plug: {{{
" Auto-install plug {{{
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" }}}
call plug#begin('~/.vim/plugged')
" My Plugins: {{{
Plug 'altercation/vim-colors-solarized'
Plug 'godlygeek/tabular'
Plug 'scrooloose/nerdtree'
"Plug 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
Plug 'lukerandall/haskellmode-vim'
Plug 'vim-scripts/VimClojure'
Plug 'vim-scripts/indenthaskell.vim'
Plug 'pbrisbin/html-template-syntax'
Plug 'rodjek/vim-puppet'
Plug 'jnwhiteh/vim-golang'
Plug 'airblade/vim-gitgutter'
Plug 'jelera/vim-javascript-syntax'
Plug 'vim-scripts/ctrlp.vim'
Plug 'vim-scripts/Tabular'
Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/textobj-user'
Plug 'vim-scripts/textobj-entire'
Plug 'nosami/Omnisharp'
Plug 'tpope/vim-dispatch'
Plug 'scrooloose/syntastic'
Plug 'derekwyatt/vim-scala'
Plug 'jamessan/vim-gnupg'
Plug 'lambdatoast/elm.vim'
Plug 'eagletmt/ghcmod-vim'
Plug 'eagletmt/neco-ghc'
Plug 'tomtom/tlib_vim'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'garbas/vim-snipmate'
Plug 'scrooloose/nerdcommenter'
Plug 'ervandew/supertab'
Plug 'Shougo/neocomplete.vim'
Plug 'Shougo/vimproc.vim'
"}}}
call plug#end()
"}}}
" switch on syntax highlighting
syntax enable
set number
set relativenumber
nnoremap <F2> :set number! relativenumber!<CR>:set foldcolumn=0<CR>
colorscheme solarized
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$\| \+\ze\t/
" Highlight long lines {{{
function! HighlightLongLines()
let w:highlight_long_lines
\ = exists('w:highlight_long_lines') ?
\ ! w:highlight_long_lines : 1
if w:highlight_long_lines
let w:m1=matchadd('Search', '\%<77v.\%>73v', -1)
let w:m2=matchadd('ErrorMsg', '\%>76v.\+', -1)
else
call matchdelete(w:m1)
call matchdelete(w:m2)
endif
endfunction
" Enable it by default in all windows
"au BufWinEnter * call HighlightLongLines()
" Map it to <F3>
nnoremap <silent> <F3> :call HighlightLongLines()<CR>
"}}}
" Spell check highlighting colours
hi clear SpellBad
hi SpellBad term=reverse ctermfg=red
" Auto wrap text and comments
set fo=tcq
" Allow setting vim options from a comment at the end or tail of a file
set modeline
" Show me a ruler
set ruler
" Turn off search highlighting, I care not for it
set nohlsearch
" Turn on incremental search
set incsearch
set smartindent
set autoindent
set completeopt=menuone,menu,longest
set wildignore+=*\\tmp\\*,*.swp,*.swo,*.zip,*.git,.cabal-sandbox,.stack-work
set wildmode=longest,list,full
set wildmenu
set completeopt+=longest
highlight clear SignColumn
"{{{ Configure synatastic
map <Leader>s :SyntasticToggleMode<CR>
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
"}}}
"{{{ Configure ghc-mod
map <silent> tw :GhcModTypeInsert<CR>
map <silent> ts :GhcModSplitFunCase<CR>
map <silent> tq :GhcModType<CR>
map <silent> te :GhcModTypeClear<CR>
"}}}
"{{{ Configure supertab
let g:SuperTabDefaultCompletionType = '<c-x><c-o>'
if has("gui_running")
imap <c-space> <c-r>=SuperTabAlternateCompletion("\<lt>c-x>\<lt>c-o>")<cr>
else " no gui
if has("unix")
inoremap <Nul> <c-r>=SuperTabAlternateCompletion("\<lt>c-x>\<lt>c-o>")<cr>
endif
endif
"}}}
map <Leader>n :NERDTreeToggle<CR>
vmap a= :Tabularize /=<CR>
vmap a; :Tabularize /::<CR>
vmap a- :Tabularize /-><CR>
vmap a( :Tabularize /^[^(]*\zs(<CR>
set omnifunc=syntaxcomplete#Complete
let g:haskell_tabular = 1
let g:haskellmode_completion_ghc = 1
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
" Configure browser for haskell_doc.vim
let g:haddock_browser = "xdg-open"
" vim: set et ts=4 sw=4 fdm=marker: