/
vimrc
218 lines (167 loc) · 6.17 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
" :setlocal spell spelllang=en_us
set nojoinspaces
" Automatically run hpack to update cabal file after modifying package.yaml
"autocmd BufWritePost package.yaml silent !hpack --silent
" -----------------------------------------------------------------------------
" Vim-Latex - Sept-6-2017
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on
let mapleader = ","
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
"set shellslash
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a single file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
"filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
"let g:tex_flavor='latex'
" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set sw=2
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
" -----------------------------------------------------------------------------
" <Leader> keys is ','
let mapleader=","
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
" execute pathogen#infect()
" filetype plugin indent on
au BufRead *access.log* setf httplog
" Save swap files in tmp directories, not current directory:
"set directory=~/Private/tmp//,.,/var/tmp//,/tmp//
set directory=$HOME/tmp//
setlocal cm=blowfish2
set number
" http://vim.wikia.com/wiki/Restoring_indent_after_typing_hash :
"set smartindent
"set cindent
"set cinkeys-=0#
"set indentkeys-=0#
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
let g:haskell_indent_disable = 1
" ---------------------- Haskell vim proto --------------------
" http://www.stephendiehl.com/posts/vim_2016.html
set nocompatible
set nowrap
set showmode
set tw=80
set smartcase
set smarttab
set smartindent
set autoindent
set softtabstop=2
set incsearch
"set mouse=a
set clipboard=unnamedplus,autoselect
set completeopt=menuone,menu,longest
set wildignore+=*\\tmp\\*,*.swp,*.swo,*.zip,.git,.cabal-sandbox
set wildmode=longest,list,full
set wildmenu
set completeopt+=longest
set t_Co=256
set cmdheight=1
"execute pathogen#infect()
" == ghc-mod ==
"map <silent> tw :GhcModTypeInsert<CR>
"map <silent> ts :GhcModSplitFunCase<CR>
"map <silent> tq :GhcModType<CR>
"map <silent> te :GhcModTypeClear<CR>
" == 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
" == neco-ghc ==
"let g:haskellmode_completion_ghc = 1
" autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
" == nerd-tree ==
"map <Leader>n :NERDTreeToggle<CR>
" == tabular ==
"let g:haskell_tabular = 1
"vmap a= :Tabularize /=<CR>
"vmap a; :Tabularize /::<CR>
"vmap a- :Tabularize /-><CR>
"vmap a, :Tabularize /<-<CR>
"vmap al :Tabularize /[\[\\|,]<CR>
" == ctrl-p ==
"map <silent> <Leader>t :CtrlP()<CR>
"noremap <leader>b<space> :CtrlPBuffer<cr>
"let g:ctrlp_custom_ignore = '\v[\/]dist$'
" == syntastic ==
"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
" ---------------------- ------- -----------------------------
" Fix arrow keys in tmux
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" ---------------------- ------- -----------------------------
set tabstop=2
set shiftwidth=2
set expandtab
" highlight search, and colorcolor
set hlsearch
hi Search cterm=NONE ctermfg=white ctermbg=darkgreen
" GVIM settings:
"color slate
"set guifont=-b&h-monospace-medium-r-normal-*-*-140-*-*-m-*-iso8859-15
set background=dark "light "dark
syntax on
filetype plugin indent on
au BufRead,BufNewFile *.ic set filetype=scheme
au BufRead,BufNewFile *.pde set filetype=java
au BufRead,BufNewFile *.blog set filetype=blog
au BufRead,BufNewFile *.cup set filetype=cup
au BufRead,BufNewFile *.hs set filetype=haskell
au BufRead,BufNewFile makefile.rules set filetype=make
au BufRead,BufNewFile vimrc set filetype=vim
au BufRead,BufNewFile ghci set filetype=haskell
au BufRead,BufNewFile .ghci set filetype=haskell
au BufRead,BufNewFile *.job set filetype=cfg
autocmd FileType make setlocal noexpandtab
autocmd FileType python setlocal shiftwidth=2
autocmd FileType python setlocal tabstop=2
command W w
set title
"set mouse=a
":setlocal spell spelllang=en_us
set spelllang=en
set spellfile=$HOME/.vim/spell/en.utf-8.add
"set spell spelllang=en_us
"function! CommandCabbr(abbreviation, expansion)
" execute 'cabbr ' . a:abbreviation . ' <c-r>=getcmdpos() == 1 && getcmdtype() == ":" ? "' . a:expansion . '" : "' . a:abbreviation . '"<CR>'
"endfunction
"command! -nargs=+ CommandCabbr call CommandCabbr(<f-args>)
"" Use it on itself to define a simpler abbreviation for itself.
"CommandCabbr ccab CommandCabbr
"match ErrorMsg '\%>180v.\+'
set textwidth=0
set wrapmargin=0