-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
63 lines (55 loc) · 1.24 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
set nocompatible
" essential settings
set visualbell t_vb=
set number
set hlsearch
set incsearch
set hidden
set ts=2 sts=2 sw=2 expandtab
set laststatus=2
set backspace=2
set nobackup
set noswapfile
set showcmd
function! KataFolds()
if match(getline(v:lnum), "^solution$") >= 0
return ">1"
else
return "="
endif
endfunction
function! KataFoldText()
let title = "SOLUTION"
return "" . title
endfunction
function! KataQuickfix()
let addressFile = expand('%:p:h').'/addresses.toc'
if filereadable(addressFile)
execute ":cgetfile ".addressFile
endif
endfunction
if has("autocmd")
autocmd BufNewFile,BufRead build/*/*/*.{tut,exe} setfiletype kata
autocmd FileType kata let @/=''
autocmd FileType kata setlocal autoindent
autocmd FileType kata setlocal foldmethod=expr
autocmd FileType kata setlocal foldexpr=KataFolds()
endif
" [a and ]a to move between arguments
nmap ]a :next!<CR>
nmap [a :Next!<CR>
nmap ]A :last!<CR>
nmap [A :first!<CR>
" quickfix list helpers
nmap <left> :cprev!<CR>
nmap <right> :cnext!<CR>
nmap <up> :cpfile!<CR>
nmap <down> :cnfile!<CR>
nmap [q :cprev!<CR>
nmap ]q :cnext!<CR>
nmap [Q :cfirst!<CR>
nmap ]Q :clast!<CR>
nmap Q <Nop>
" Table of Contents
let &errorformat="%f|%l col %c|%m"
call KataQuickfix()