-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·159 lines (138 loc) · 4.38 KB
/
vimrc
File metadata and controls
executable file
·159 lines (138 loc) · 4.38 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
" Load pathogen to manage plugins
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
call pathogen#infect()
" enable filetype dectection and ft specific plugin/indent
"filetype on
"filetype plugin on
filetype plugin indent on
" enable syntax hightlight and completion
syntax enable
syntax on
" 插入匹配括号
inoremap ( ()<LEFT>
inoremap [ []<LEFT>
inoremap { {}<LEFT>
inoremap < <><LEFT>
inoremap " ""<LEFT>
inoremap ' ''<LEFT>
"
" color theme
color bensday
" highlight current line
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
set cursorline cursorcolumn"
" search operations
set incsearch
"set highlight " conflict with highlight current line
set ignorecase
set smartcase
" paste codes
set nopaste
set pastetoggle=<F10>
set history=1000
set nocompatible
set t_Co=256 " Explicitly tell vim that the terminal has 256 colors"
set number " show linenumber
set confirm " prompt when existing from an unsaved file
"set ruler
set showcmd " Show (partial) command in status line
set mouse=a " use mouse in all modes
set report=0 " always report number of lines changed"
set backspace=indent,eol,start " More powerful backspacing
" Default Indentation
set autoindent
set smartindent " indent when
set tabstop=8 " tab width
set softtabstop=4 " backspace &
set shiftwidth=4 " indent width
"set textwidth=79
set expandtab " expand tab to space
autocmd FileType html,haml,sass,scss,ruby,javascript,php,css,java,c,c++
set tabstop=4 shiftwidth=2 softtabstop=2
" javascript
" nmap <silent> <leader>js :call g:Jsbeautify()<cr>
nnoremap <F4> :call g:Jsbeautify()<CR>
let mapleader=","
"pythoncomplete
autocmd FileType python set textwidth=0
autocmd FileType python set omnifunc=pythoncomplete#Complete
" JQuery syntax support
autocmd Syntax javascript set syntax=jquery
au BufRead,BufNewFile *.js set syntax=jquery
"设置字典 ~/.vim/dict/javascript.dict是字典文件的路径
autocmd FileType <span class="hilite">javascript</span> set dictionary=~/.<span class="hilite">vim</span>/dict/javascript.dict
"
" Keybindings for plugin toggle
"nmap <F4> :IndentGuidesToggle<cr>
nmap <F5> :TagbarToggle<cr>
nmap <F6> :NERDTreeToggle<cr>
" easier navigation between split windows
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" Tagbar
let g:tagbar_left=1
let g:tagbar_width=30
let g:tagbar_autofocus = 1
let g:tagbar_sort = 0
" Nerd Tree
let NERDChristmasTree=0
let NERDTreeWinSize=30
let NERDTreeChDirMode=2
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$', '\.swp$']
let NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\~$']
let NERDTreeShowBookmarks=1
let NERDTreeWinPos = "left"
" ZenCoding
let g:user_zen_expandabbr_key='<C-j>'
" Indent guides (default toggle key is <leader>ig)
"let g:indent_guides_auto_colors=0
"let g:indent_guides_start_level=2
"let g:indent_guides_guide_size=1
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=239
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=242
" NeoComplCache
set completeopt=longest,menu
let g:neocomplcache_enable_at_startup=1
"let g:neoComplcache_disableautocomplete=1
let g:neocomplcache_enable_smart_case=1
let g:neocomplcache_min_syntax_length = 3
imap <C-k> <Plug>(neocomplcache_snippets_force_expand)
smap <C-k> <Plug>(neocomplcache_snippets_force_expand)
"imap <C-l> <Plug>(neocomplcache_snippets_expand)
"smap <C-l> <Plug>(neocomplcache_snippets_expand)
"imap <C-t> <Plug>(neocomplcache_snippets_jump)
"smap <C-t> <Plug>(neocomplcache_snippets_jump)
imap <C-l> <Plug>(neocomplcache_snippets_force_jump)
smap <C-l> <Plug>(neocomplcache_snippets_force_jump)
" SuperTab
let g:SuperTabDefaultCompletionType="<c-n>"
"let g:SuperTabDefaultCompletionType="<C-X><C-U>"
"let g:SuperTabDefaultCompletionType="context"
"
set laststatus=2 " Always show the statusline"
" eggcache vim
:command W w
:command WQ wq
:command Wq wq
:command Q q
:command Qa qa
:command QA qa
" show syntax highlighting groups for word under cursor
nmap <C-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
"javacomplete
if has("autocmd")
autocmd Filetype java setlocal omnifunc=javacomplete#Complete
endif
setlocal completefunc=javacomplete#CompleteParamsInfo
inoremap<buffer> <C-X><C-U> <C-X><C-U><C-P>
inoremap <buffer> <C-S-Space> <C-X><C-U><C-P>