blob: fd0d8d9b8cf3d91d3e1fa964b37b447341d02be6 (
plain)
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
|
"""""""""""""""""""""""""""""""""""""
" Miguel's .vimrc "
" Author: m.i@gmx.at "
" Last Update: 2019-05-25 "
"""""""""""""""""""""""""""""""""""""
" {{{ NOTES
" THIS LOOSE NOTES REQUIRE REVIEW!
" external links to browser
" https://wiki.haskell.org/99_questions/Solutions/34
" http://www.stephendiehl.com/posts/vim_2016.html
" https://github.com/lukerandall/haskellmode-vim
" :h compiler-plugin
" :help equalprg
" 15:15:33 gagbo | and then you can map it on key like nnoremap │ aauren
" | <F7> :compiler clang-tidy<CR>:make and nnoremap │ abbec
" | <F8> :compiler clang<CR>:make in like │ Accord
" | ~/.vim/after/ftplugin/cpp.vim for example
" https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/
" https://mendo.zone/fun/neovim-setup-haskell/
" https://github.com/aloiscochard/codex
" https://github.com/haskell/haskell-ide-engine#using-hie-with-vim-or-neovim ?
" ghc-mod, hlint (haskell)
" https://wiki.haskell.org/Vim
" http://www.alexeyshmalko.com/2014/using-vim-as-c-cpp-ide/
" https://github.com/vim-airline/vim-airline
" https://github.com/spf13/spf13-vim
" http://antjanus.com/blog/thoughts-and-opinions/use-vim/
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/
" http://derekingrouville.com/2012/vim-is-my-ide/
" https://github.com/VundleVim/Vundle.vim
" draculatheme.com
" learnvimscriptthehardway.stevelosh.com "
" autocomplete
" jump to defintion / list calls / ctags shortcuts?
" spellcheck / translate / thesaurus / dict
" change mappings to more specific mappings and use noremap!
" toggle 'cursorline' via hotkey for nicer reading experience.
" ft=c.doxygen etc.
" include dependancies as git submodules (wherever possible?? seriously?) (licenses?)
" :help complete-functions
" quickfix
" compiler/debugger invocation
" release vim-colortune plugin
" load layout automatically on start (pff)
" ConqueGDB Resize
" Do something about startup lag (because of YouCompleteMe)
" Do something about the input problems in ConqueGDB/Term (YouCompl?)
" implement a plugin for fast-reading (check if one exists first ;))
" plugins on vim.org etc.
" syntastic! https://github.com/vim-syntastic/syntastic
" vimproc! https://github.com/Shougo/vimproc.vim
" pathogen / vundle DONE
" NerdTree DONE
" minibufexpl DONE
" fugitive DONE
" vim-sensible DONE
" taglist.vim
" snipMate
" c.vim
" autocomplpop
" surround
" perl-support
" matchit
" vimspell
" conqueshell
" fuzzyfinder
" Nerd Commenter
" tSkeleton
" grep
" cppcomplete
" colortest
" colour sampler pack
" gundo
" CScope / CCTree
" inline reference/ (stlrefvim?)
" emmet.io (webdev)
" }}}
" {{{ VUNDLE
" as required by https://github.com/VundleVim/Vundle.vim
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'altercation/vim-colors-solarized'
Plugin 'fholgado/minibufexpl.vim'
Plugin 'majutsushi/tagbar'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-sensible'
" Plugin 'Shougo/vimproc.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
" Plugin 'vim-scripts/Conque-GDB'
" Plugin 'dracula/vim'
" Plugin 'git://ex40.softwarefools.com/vim-potion.git'
" Plugin 'git://ex40.softwarefools.com/vim-colortune.git'
call vundle#end()
filetype plugin indent on
" }}}
"{{{ DISABLED
" limited .vimrc in current dir
" set exrc
" set secure
" let g:ConqueGdb_Leader = '\'
" let g:ConqueTerm_CloseOnEnd = 1
" let g:potion_command = "/home/miguel/int/dev/potion/bin/potion"
" set wrap
" set showbreak=>_
" move line under the cursor up and down.
" nnoremap <leader>- ddp
" nnoremap <leader>_ kddpk
" abbreviations and typo correction
" iabbrev teh the
" }}}
" {{{ BASICS
" {{{ spelling OFF
" set spell
" }}}
" {{{ mapleaders
" use <space> but remap to _ so it is visible for 'showcmd'
nmap <space> _
let mapleader="\_"
let maplocalleader="\_"
" }}}
" {{{ misc
set nocompatible
set foldmethod=marker
set nowrap
set backspace=2
" set ruler
set showcmd
set number
set hidden
"set cursorcolumn
set cursorline
" save before making etc.
set autowrite
" some nice candy
set laststatus=2 "always show status line on last window
set wildmenu
" indent
" set autoindent
" set cindent
" mouse support in xterm
set mouse=a
"other
set previewheight=25
" http://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally
" set splitbelow
" set splitright
" easy move between windows
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" }}}
" {{{ statusline
set statusline=%f " Path to the file
set statusline+=%= " Switch to the right side
set statusline+=%l,%c " Current line,column
set statusline+=\ (%L,%P) " Percentage
"set statusline& " reset
" }}}
" {{{ terminal width / colocolumn
" http://richarddingwall.name/2008/05/31/is-the-80-character-line-limit-still-relevant/
"
" set tw=80
" set tw=72
" set tw=78 (for instance vims :help)
set tw=0
set colorcolumn=73
" }}}
" {{{ tabs
set listchars=tab:>.
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
set shiftround
" }}}
" {{{ folding
set foldcolumn=5
set foldlevelstart=0
" }}}
" {{{ colorscheme / syntax highlight
syntax enable
if has('gui_running')
set background=light
else
set background=dark
endif
set background=dark
colorscheme solarized
hi SpellBad ctermfg=white
hi SpellBad ctermbg=red
syntax sync fromstart
" }}}
" {{{ minimal gui
" set guioptions=
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
set guifont=Monospace\ 9
" }}}
" {{{ search
set hlsearch
set incsearch
" }}}
" {{{ match brackets
set showmatch
set matchtime=5
" }}}
" }}}
" {{{ KEY BINDINGS
" temporary mappings, to get rid of bad habits.
" inoremap <esc> <nop>
" inoremap <Up> <nop>
" inoremap <Down> <nop>
" inoremap <Left> <nop>
" inoremap <Right> <nop>
"map <F5> :silent make \| copen \| redraw!<CR>
"map <F5> :silent make \| redraw!<CR>
"map <F5> :make<CR>
"nnoremap <C-]> <C-]>:tselect<CR>
"nnoremap <leader>cc :call Colortune_fill()<cr>
" activate 'very magic' for searches automatically
nnoremap / /\v
nnoremap ? ?\v
" alt esc in insert mode
inoremap jk <esc>
" retab
" map <leader>rt :retab!<CR>
" toggle tabs visibility
noremap <leader>t :set invlist<CR>
" easy editing and sourcing of vimrc
" nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <leader>ev :e $MYVIMRC<cr>
" turn off search highlight
nnoremap <leader>h :nohlsearch<cr>
" toggle visibility of trailing whitespaces
nnoremap <leader>w :match ErrorMsg /\v +$/<cr>
nnoremap <leader>W :match<cr>
" toggle and navigate quickfix window
nnoremap <leader>cn :cnext<cr>
nnoremap <leader>cp :cprevious<cr>
nnoremap <leader>cc :cc<cr>
" buffer navigaion
nnoremap <leader>bn :MBEbn<cr>
nnoremap <leader>bp :MBEbp<cr>
nnoremap <leader>bd :MBEbd<cr>
" make
" nnoremap <leader>mm :silent make!<cr>
" nnoremap <leader>mc :silent make! clean<cr>
" nnoremap <leader>mn :silent make! new<cr>
" nnoremap <leader>mr :silent make!<cr>:call system("make run &")<cr>
" nnoremap <leader>md :silent make!<cr>:call system("make debug &")<cr>
" nnoremap <leader>ms :silent make! stop<cr>
" nnoremap <leader>mf :silent make! %:r<cr>:redraw! <cr>
" nnoremap <leader>mx :silent make! %:r <bar> !./%:r<cr>
" session handling
" nnoremap <leader>ss :call Session_save()<cr>
" nnoremap <leader>sl :call Session_load()<cr>
" layout
nnoremap <leader>ln :NERDTreeToggle<cr>
nnoremap <leader>lt :TagbarToggle<cr>
"nnoremap <leader>lg :ConqueGdb<cr>
nnoremap <leader>lm :MBEToggle<cr>
nnoremap <leader>lq :copen<cr>
" }}}
" {{{ FILETYPES
" {{{ custom highlight
augroup filetype_custom_highlight
autocmd!
au BufRead,BufNewFile *.twig set filetype=htmljinja
augroup END
" }}}
" {{{ markdown
augroup filetype_markdown
autocmd!
autocmd FileType markdown setlocal spell
" autocmd FileType markdown setlocal spell
" autocmd FileType markdown setlocal list
augroup END
" }}}
" {{{ cpp
augroup filetype_cpp
autocmd!
autocmd FileType cpp nnoremap <buffer> <localleader>c I//<esc>
autocmd FileType cpp :iabbrev <buffer> iff if () <cr>{<cr>}jkF
autocmd FileType cpp nnoremap <buffer> <leader>bo :r ~/_int/dev/misc/c++/template/template.cpp<cr>
augroup END
" }}}
" {{{ haskell
augroup filetype_haskell
autocmd!
" autocmd FileType haskell setlocal foldmethod=marker
" autocmd Filetype haskell map <F5> :w<ENTER>:term cabal -- exec runghc %<ENTER>
" autocmd Filetype haskell map <F5> :w<ENTER>:term make<ENTER>
" autocmd Filetype haskell map <F5> :w<ENTER>:term make<ENTER>
" autocmd FileType haskell setlocal expandtab
augroup END
" }}}
" }}}
|