[UP] add some viki files, knowledge.
[arrow.git] / archlinux_conf / home / .vimrc
blob9eeb4316b0fc5858776de904aea71c7c0dbc5237
1 "Author:arrow, for archlinux
3 if v:progname =~? "evim"
4         finish
5 endif
6 "set paste              " this will reset some variables, so set before any
7 set nocompatible
8 set backupdir=~/.tmp,/tmp,./
9 set backup              " keep a backup file
10 set history=100         " keep 50 lines of command line history
11 set ruler               " show the cursor position all the time
12 set showcmd             " display incomplete commands
13 map Q gq
14 map t gt 
15 map T gT 
16 set encoding=UTF-8
17 set report=0
18 set ignorecase
19 set nowrap
20 set incsearch
21 filetype plugin indent on
22 set autoindent
23 set tabstop=8
24 set softtabstop=8
25 set shiftwidth=8
26 set cinoptions=>8,n-8,{8,^-8,:8,=8,g8,h8,p8,t8,+8,(8,u8,w1,m1 shiftwidth=8 tabstop=8
27 set noexpandtab
28 set cindent
29 set notagbsearch
30 set tagrelative
31 if &t_Co > 2 || has("gui_running")
32         syntax on
33         set hlsearch
34 endif
35 nmap <F11> :nohlsearch<CR>
36 "nmap <F3> :only<CR>
37 "nmap <F4> :set noscrollbind<CR>:set scrollopt=<CR>:set nowrap<CR>:set foldmethod=manual<CR>:set foldcolumn=0<CR>:only<CR>zR
38 "nmap <F5> :set tags-=/usr/include/tags<CR>
39 "nmap <F6> :set tags+=/usr/include/tags<CR>
40 "nmap <F7> :set tags+=/kernel/tags<CR>
41 "nmap <F8> :set tags-=/kernel/tags<CR>
42 set backspace=indent,eol,start
43 set nosmartindent
44 set formatoptions=croqlmM
45 set textwidth=80
46 set laststatus=2
47 set statusline=%((%1*%M%*%R%Y)%)%f%=%(\[%3l-%02c]%)[%03b/%02B]T9\ %P~%L
48 set tags=tags
49 if has("multi_byte")
50         set fileencoding=utf-8
51         set fileencodings=utf-8,chinese,ucs-bom
52         set ambiwidth=double
53 endif
55 if has("autocmd")
56         filetype plugin indent on
57         autocmd BufReadPost *
58         \ if line("'\"") > 0 && line("'\"") <= line("$") |
59         \   exe "normal g`\"" |
60         \ endif
61         set formatprg=fmt
62         au FileType c set formatprg=indent
63         au FileType cpp set formatprg=indent
64         if !exists("auto_arrow_c")
65         let auto_arrow_c=1
66                 au BufNewFile *.c 0r ~/.vim/files/c.skel
67                 "au BufNewFile *.c normal gnp 
68                 au BufNewFile ver.h 0r ~/.vim/files/ver.skel
69                 au BufNewFile *.h 0r ~/.vim/files/h.skel
70                 au BufNewFile *.sh 0r ~/.vim/files/sh.skel
71                 au BufNewFile *.txt 0r ~/.vim/files/txt.skel
72                 au BufNewFile Makefile 0r ~/.vim/files/makefile.skel
73                 au BufNewFile Rules.make 0r ~/.vim/files/Rules.make.skel
74                 ":%s/_filename_/\=bufname("%")
75                 :"%s/_datetime_/\=strftime("%c")
76                 map gse <ESC>:%s/_filename_/\=bufname("%")/<CR>:%s/_datetime_/\=strftime("%c")/<CR> 
77                 au BufNewFile *.[ch] normal gse
78                 au BufNewFile *.sh normal gse
79                 au BufRead ~/.tmp/mutt-* set tw=72
80                 "au BufNewFile *.txt normal gse
81         endif
82         au BufRead,BufNewFile *.viki set ft=viki
83 endif
84 if has("gui_running")
85         "set menu
86         :source $VIMRUNTIME/delmenu.vim
87         :source $VIMRUNTIME/lang/menu_en_gb.utf-8.vim
88         :source $VIMRUNTIME/menu.vim
89         set foldcolumn=0
90         set guioptions=aegilLtb
91         "colorscheme delek
92         set guifont=Courier\ 10
93 else
94         "colorscheme  default
95 endif
96 colorscheme  default
97 set mouse=a
98 :language time C
99 ":language ctype C
100 :language messages C
101 set showtabline=2
102 hi IncSearch term=reverse cterm=reverse gui=reverse
103 hi Search term=reverse ctermbg=darkmagenta ctermfg=white guibg=darkmagenta guifg=white
104 hi Cursor gui=reverse guifg=darkcyan guibg=white
106 let g:vikiUseParentSuffix=1
107 let g:vikiOpenUrlWith_mailto = 'mail %{URL}'
108 let g:vikiOpenFileWith_html  = "silent !firefox %{FILE}"
109 let g:vikiOpenFileWith_ANY   = "silent !ge top %{FILE}"
110 "fun! ConvertPDF()
111 "       if !exists("b:convertedPDF")
112 "               exec "cd ". expand("%:p:h")
113 "               exec "%!pdftotext ". expand("%:t") ." -"
114 "               :%!par 72w
115 "               cd -
116 "               setlocal noswapfile buftype=nowrite
117 "               let b:convertedPDF = 1
118 "       endif
119 "endf
120 "let g:vikiOpenFileWith_pdf = 'call VikiOpenLink("%{FILE}", "", 1)|silent call ConvertPDF()'
121 "let g:deplatePrg = "deplate -x -X "
122 "au FileType viki compiler deplate
123 "let g:vikiNameSuffix=".viki"
124 "autocmd! BufRead,BufNewFile *.viki set filetype=viki
125 "autocmd! BufRead,BufNewFile $HOME/viki/* set filetype=viki
126 "VikiDefine KERNEL_WIKI kernel .vik
128 set mousehide " Hide the mouse when typing text
129 set mousemodel=extend
130 set path=.,include,/usr/include,,
131 set wildmenu
132 set wildmode=list:full
133 let g:vimwiki_home = "~/wiki/"
134 set backupcopy=auto,breakhardlink
135 let g:SessionMgr_AutoManage = 0