daac086b |
1 | syntax on |
2 | filetype plugin on |
3 | |
4 | set tags=/usr/src/sys/arch/armv7/tags |
5 | set omnifunc=syntaxcomplete#Complete |
6 | |
7 | set mouse=a |
7fc9a145 |
8 | set incsearch |
daac086b |
9 | set shiftwidth=4 |
10 | set tabstop=8 |
7fc9a145 |
11 | set backspace=2 |
12 | set ruler |
13 | set smartcase |
14 | set showmatch |
7fc9a145 |
15 | set nu |
16 | set nocp |
7aad4edb |
17 | set nowrap |
daac086b |
18 | set statusline+=%F\ %l\:%c |
19 | set laststatus=2 |
068cdcea |
20 | cmap w!! w !sudo tee > /dev/null % |
21 | |
daac086b |
22 | map <C-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR> |
7aad4edb |
23 | |
daac086b |
24 | function! GenSdmmcTags() |
25 | TlistAddFilesRecursive ~/code/sdmmc/src/sys/arch/armv7 *.[c,h] |
26 | TlistAddFilesRecursive ~/code/sdmmc/src/sys/dev *.[c,h] |
27 | TlistAddFilesRecursive ~/code/sdmmc/src/sys/scsi *.[c,h] |
28 | TlistAddFilesRecursive ~/code/sdmmc/src/sys/kern *.[c,h] |
29 | TlistAddFilesRecursive ~/code/sdmmc/src/sys/lib *.[c,h] |
30 | endfunction |
31 | |
32 | function! SdmmcTags() |
33 | TlistSessionLoad /home/kremlin/sdmmc.tlist |
34 | endfunction |
35 | |
36 | |
37 | function! DoPrettyXML() |
38 | " save the filetype so we can restore it later |
39 | let l:origft = &ft |
40 | set ft= |
41 | " delete the xml header if it exists. This will |
42 | " permit us to surround the document with fake tags |
43 | " without creating invalid xml. |
44 | 1s/<?xml .*?>//e |
45 | " insert fake tags around the entire document. |
46 | " This will permit us to pretty-format excerpts of |
47 | " XML that may contain multiple top-level elements. |
48 | 0put ='<PrettyXML>' |
49 | $put ='</PrettyXML>' |
50 | silent %!xmllint --format - |
51 | " xmllint will insert an <?xml?> header. it's easy enough to delete |
52 | " if you don't want it. |
53 | " delete the fake tags |
54 | 2d |
55 | $d |
56 | " restore the 'normal' indentation, which is one extra level |
57 | " too deep due to the extra tags we wrapped around the document. |
58 | silent %< |
59 | " back to home |
60 | 1 |
61 | " restore the filetype |
62 | exe "set ft=" . l:origft |
63 | endfunction |
64 | command! PrettyXML call DoPrettyXML() |
7fc9a145 |
65 | |