Repository navigation
Expand file tree
/
Copy path.vimrc
More file actions
185 lines (158 loc) · 5.53 KB
/
Copy path.vimrc
File metadata and controls
185 lines (158 loc) · 5.53 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
scriptencoding utf-8
" ============================================================================
" Author: LongFeida
" Version: v1.0.0.1
" Update Time: 2018-04-29
" ============================================================================
" Vundle initialization
" Avoid modify this section, unless you are very sure of what you are doing
" no vi-compatible
set nocompatible
" Setting up Vundle - the best vim plugin manager
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle..."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle
let iCanHazVundle=0
endif
" need reset filetype on after plugin installed
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Plugins
Plugin 'gmarik/vundle'
" ============================================================================
" Active plugins
" You can disable or add new ones here:
"Plugins from github repos:
"Better file browser
Plugin 'scrooloose/nerdtree'
" Better autocompletion
Plugin 'Shougo/neocomplcache.vim'
" Class/module browser
Plugin 'majutsushi/tagbar'
" Code and files fuzzy finder
Plugin 'kien/ctrlp.vim'
" Airline
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" awesome colorscheme
Plugin 'tomasr/molokai'
" Python and other languages code checker
Plugin 'scrooloose/syntastic'
" ============================================================================
" Install plugins the first time vim runs
if iCanHazVundle == 0
echo "Installing Plugins, please ignore key map error messages"
echo ""
:PluginInstall
endif
" ============================================================================
" Vim settings and mappings
" You can edit them as you wish
filetype plugin indent on
" Default Setting
set history=1000
set fileencodings=ucs-bom,utf-8,gbk2312,gbk,cp936
set backspace=2
filetype on
" UserInterface
syntax on
set nu
set ruler
" Format Setting
set autoindent
set cindent
set tabstop=4
set shiftwidth=4
" Search
set showmatch
set hlsearch
set incsearch
set matchtime=5
" ============================================================================
" Vundle settings and mappings
" You can edit them as you wish
" NerdTree
nmap <F5> :NERDTreeToggle<cr>
" Molokai
set t_Co=256
colorscheme molokai
" Airline
"set laststatus=2
"let g:airline_theme='simple'
"打开tabline功能,方便查看Buffer和切换,这个功能比较不错"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
"设置切换Buffer快捷键 ctrl + N/P"
nnoremap <C-N> :bn<CR>
"nnoremap <C-P> :bp<CR>
" Tagbar
nmap <F9> :TagbarToggle<CR>
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:tagbar_autofocus = 1 "tagbar打开,光标即在tagbar页面内,默认在vim打开的文件内
" NeoComplCache ------------------------------
" most of them not documented because I'm not sure how they work
" (docs aren't good, had to do a lot of trial and error to make
" it play nice)
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_ignore_case = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_enable_auto_select = 1
let g:neocomplcache_enable_fuzzy_completion = 1
let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_fuzzy_completion_start_length = 1
let g:neocomplcache_auto_completion_start_length = 1
let g:neocomplcache_manual_completion_start_length = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_keyword_length = 1
let g:neocomplcache_min_syntax_length = 1
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
" complete with workds from any opened file
let g:neocomplcache_same_filetype_lists = {}
let g:neocomplcache_same_filetype_lists._ = '_'
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" Syntastic ------------------------------
" show list of errors and warnings on the current file
nmap <leader>e :Errors<CR>
" turn to next or previous errors, after open errors list
nmap <leader>n :lnext<CR>
nmap <leader>p :lprevious<CR>
" check also when just opened the file
let g:syntastic_check_on_open = 1
" syntastic checker for javascript.
" eslint is the only tool support JSX.
" If you don't need write JSX, you can use jshint.
" And eslint is slow, but not a hindrance
" let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_javascript_checkers = ['eslint']
" don't put icons on the sign column (it hides the vcs status icons of signify)
let g:syntastic_enable_signs = 0
" custom icons (enable them if you use a patched font, and enable the previous
" setting)
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_style_error_symbol = '✗'
let g:syntastic_style_warning_symbol = '⚠'