update vimrc & xmonad
[dotfiles.git] / .vimrc
CommitLineData
daac086b 1syntax on
2filetype plugin on
3
4set tags=/usr/src/sys/arch/armv7/tags
5set omnifunc=syntaxcomplete#Complete
6
7set mouse=a
7fc9a145 8set incsearch
daac086b 9set shiftwidth=4
10set tabstop=8
7fc9a145 11set backspace=2
12set ruler
13set smartcase
14set showmatch
7fc9a145 15set nu
16set nocp
7aad4edb 17set nowrap
daac086b 18set statusline+=%F\ %l\:%c
19set laststatus=2
068cdcea 20cmap w!! w !sudo tee > /dev/null %
21
daac086b 22map <C-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
7aad4edb 23
daac086b 24function! 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]
30endfunction
31
32function! SdmmcTags()
33 TlistSessionLoad /home/kremlin/sdmmc.tlist
34endfunction
35
36
37function! 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
63endfunction
64command! PrettyXML call DoPrettyXML()
7fc9a145 65