-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
146 lines (126 loc) · 3.11 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
" Vim 配置文件
"
" author: feelinglucky<[email protected]>
" website: http://www.gracecode.com
" date: 2008-06-05
set tags=D:\Dev\src\jdk\tags,D:\Dev\src\hsqldb\tags
set linebreak
set textwidth=80
set nocompatible
set history=400
set ruler
set number
set hlsearch
set noincsearch
set expandtab
set noerrorbells
set novisualbell
set t_vb= "close visual bell
set foldmethod=marker
set tabstop=4
set shiftwidth=4
set nobackup
set nowritebackup
"set noswapfile
set smarttab
set smartindent
set autoindent
set cindent
set wrap
set autoread
set cmdheight=1
set showtabline=2
"set clipboard+=unnamed
set tabpagemax=20
set laststatus=2
function! CurrectDir()
let curdir = substitute(getcwd(), "", "", "g")
return curdir
endfunction
set statusline=\ [File]\ %F%m%r%h\ %w\ \ [PWD]\ %r%{CurrectDir()}%h\ \ %=[Line]\ %l,%c\ %=\ %P
if has("multi_byte")
set encoding=utf-8
set termencoding=utf-8
set formatoptions+=mM
set fencs=utf-8,gbk
if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
set ambiwidth=double
endif
if has("win32")
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
endif
if has("win32")
set guifont=Courier_New:h14:cANSI
" set guifontwide=YouYuan:h10:cGB2312
" set guifontwide=YaHei\ Consolas\ Hybrid:h10
au GUIEnter * simalt ~x
elseif has("unix")
set guifont=
set guifontwide=
elseif has("mac") || has("macunix")
set guifont=
set guifontwide=
endif
if has("autocmd")
filetype plugin indent on
augroup vimrcEx
au!
autocmd FileType text setlocal textwidth=78
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
function! AutoClose()
:inoremap ( ()<ESC>i
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
:inoremap { {}<ESC>i
:inoremap [ []<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap ] <c-r>=ClosePair(']')<CR>
endf
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
"auto close for PHP and Javascript script
au FileType php,c,python,javascript exe AutoClose()
endif
" key stock
map tn :tabnext<cr>
map tp :tabprevious<cr>
"map td :tabnew .<cr>
"map td :NERDTree <cr>
nnoremap <silent> <F3> :NERDTreeToggle<cr>
nnoremap <silent> <F4> :Calendar<cr>
map te :tabedit
map tc :tabclose<cr>
map cs :!php -l %<cr>
map bf :BufExplorer<cr>
" 日历控件配置参数
let g:calendar_diary = 'd:\Calendar'
"map ca :Calendar<cr>
if has("gui_running")
"colorscheme desert
"colorscheme slate
colorscheme molokai
set guioptions=
set guioptions+=r
set cursorline
else
colorscheme dark
endif
" 配置 VimWiki 路径
let g:vimwiki_home = "d:/vimwiki/"
syntax on
" vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8