-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
82 lines (65 loc) · 2.01 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
" Personal vim configuration of Sebastian Albert
" with a couple of relicts from Learn[ing] Vimscript the Hard Way:
" https://learnvimscriptthehardway.stevelosh.com/
:set shiftround
:set number
:filetype plugin indent on
:set wildmenu
:inoremap <Leader>u <Esc>gUawea
:nnoremap <Leader>.e :vsp $MYVIMRC<CR>
:nnoremap <Leader>.s :source $MYVIMRC<CR>
:inoremap jk <Esc>
:nnoremap <Leader>; :cprevious<CR>
:nnoremap <Leader>' :cnext<CR>
:nnoremap <Leader>: :cfirst<CR>
:nnoremap <Leader>" :clast<CR>
highlight LineNr ctermbg=LightCyan ctermfg=black
highlight Folded cterm=bold ctermbg=White ctermfg=DarkGrey
" Highlight trailing whitespace and characters beyond column 79 {{{
function s:GeneralHighlights()
highlight longer_than_79 ctermbg=lightred guibg=#ff9999
:let w:mll = matchadd("longer_than_79", '\%>79v.\+')
highlight bad_whitespace ctermbg=red
:let w:mbw = matchadd("bad_whitespace", '\s\+$\| \+\ze\t')
endfunction
function s:GeneralHighlightsAllWindows()
for wi in getwininfo()
call win_execute(wi.winid, 'call s:GeneralHighlights()')
endfor
endfunction
augroup highlights
autocmd!
autocmd WinNew * call s:GeneralHighlights()
autocmd VimEnter * call s:GeneralHighlightsAllWindows()
augroup END
" }}}
" Vimscript file settings {{{
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
" Haskell file settings {{{
augroup filetype_haskell
autocmd!
autocmd FileType haskell setlocal et
augroup END
" }}}
" operator pending mappings {{{
onoremap in( :<C-u>normal! f(vi(<CR>
onoremap il( :<C-u>normal! F)vi(<CR>
onoremap an( :<C-u>normal! f(va(<CR>
onoremap al( :<C-u>normal! F)va(<CR>
onoremap in{ :<C-u>normal! f{vi{<CR>
onoremap il{ :<C-u>normal! F}vi{<CR>
onoremap an{ :<C-u>normal! f{va{<CR>
onoremap al{ :<C-u>normal! F}va{<CR>
onoremap in[ :<C-u>normal! f[vi[<CR>
onoremap il[ :<C-u>normal! F]vi[<CR>
onoremap an[ :<C-u>normal! f[va[<CR>
onoremap al[ :<C-u>normal! F]va[<CR>
" }}}
nnoremap <Leader>c :call <SID>QuickfixToggle()<CR>
function! s:QuickfixToggle()
copen
endfunction