Skip to content

Commit 9a17634

Browse files
committedSep 30, 2015
refactor for pre-release
1 parent ccf1dab commit 9a17634

File tree

3 files changed

+358
-424
lines changed

3 files changed

+358
-424
lines changed
 

‎vimrc

+50-424
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,47 @@
11
"==========================================
22
" Author: ruanyl
3-
" Version: 0.9.1
4-
" Email: ruanyl@gmail.com
5-
" BlogPost: http://blog.bigruan.com
6-
" ReadMe: README.md
7-
" Last_modify: 2014-05-15
8-
" Sections:
9-
" ->General Settings
10-
" ->Show:User Interface settings
11-
" ->File encode:encode for varied filetype
12-
" ->Others
13-
" ->Hot Key:Customized keys
14-
" ->Bundle:Plgin management and setting
15-
" ->Color&Theme
3+
" Version: 0.9.9
164
"==========================================
175

6+
set nocompatible
7+
8+
"Load plugins
9+
if filereadable(expand("~/.vim/vimrc.bundles"))
10+
source ~/.vim/vimrc.bundles
11+
endif
12+
1813
"==========================================
1914
" General Settings
2015
"==========================================
2116

22-
set nocompatible " Do not compatible with VI
17+
filetype plugin indent on
18+
syntax enable
19+
syntax on
2320

24-
set history=200 "history: number of command-lines remembered
21+
colorscheme solarized
22+
"colorscheme molokai
23+
"colorscheme desert
2524

25+
set background=dark
26+
set t_Co=256
27+
set history=200 "history: number of command-lines remembered
2628
set autoread " auto reload file after being modified
2729
set shortmess=atI " do not show initial page
28-
2930
set nobackup
3031
set noswapfile
31-
3232
set cursorcolumn " highlight current column
3333
set cursorline " highlight current line
34-
3534
set t_ti= t_te= " alway show the content on the screen after exist VIM
36-
" in case if i did some stupid deleting, and i can find them back
37-
3835
set mouse-=a " disable mouse
39-
4036
set selection=inclusive "set selection=exclusive
4137
set selectmode=mouse,key
42-
43-
" No annoying sound on errors
4438
set title " change the terminal's title
4539
set novisualbell " don't beep
4640
set noerrorbells " don't beep
4741
set t_vb=
4842
set tm=500
49-
5043
set nostartofline " keep cursor postion when switching between buffers
5144

52-
"==========================================
53-
" Show:User Interface settings
54-
"==========================================
55-
5645
set number " show line number
5746
set nowrap " disable wrap
5847

@@ -82,13 +71,36 @@ set smarttab
8271
set expandtab " when typing <Tab>, use <space> instead
8372
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
8473

85-
set showcmd " Show partial commands in status line and Selected characters/lines in visual mode
86-
8774
set hidden " A buffer becomes hidden when it is abandoned
8875
set wildmode=longest:full,full
8976
set ttyfast
9077

91-
set relativenumber " show relative line number
78+
set relativenumber " show relative line number
79+
set ruler " show the current line number and column number
80+
set showcmd " show the current typing command
81+
set noshowmode " Show current mode
82+
set scrolloff=7 " Set 7 lines to the cursor - when moving vertically using j/k
83+
84+
" File encode:encode for varied filetype
85+
set encoding=utf-8
86+
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
87+
set helplang=en
88+
set termencoding=utf-8
89+
90+
set ffs=unix,dos,mac " Use Unix as the standard file type
91+
set formatoptions+=m
92+
set formatoptions+=B " When joining lines, don't insert a space between two multi-byte characters.
93+
set completeopt=longest,menu " behaviour of insert mode completion
94+
set wildmenu " auto complete command
95+
set wildignore=**.o,*~,.swp,*.bak,*.pyc,*.class " Ignore compiled files
96+
97+
set viminfo^=% " Remember info about open buffers on close
98+
set magic " For regular expressions turn magic on
99+
100+
set backspace=eol,start,indent " Configure backspace so it acts as it should act
101+
set whichwrap+=<,>,h,l
102+
set pastetoggle=<F5> " when in insert mode, toggle between 'paste' and 'nopaste'
103+
92104
autocmd InsertEnter * :set norelativenumber " no relativenumber in insert mode
93105
autocmd InsertLeave * :set relativenumber " show relativenumber when leave insert mode
94106

@@ -100,10 +112,6 @@ if has('persistent_undo')
100112
set undodir=~/.undodir/
101113
endif
102114

103-
set ruler " show the current line number and column number
104-
set showcmd " show the current typing command
105-
set noshowmode " Show current mode
106-
set scrolloff=7 " Set 7 lines to the cursor - when moving vertically using j/k
107115

108116
if has('statusline')
109117
set laststatus=2
@@ -115,34 +123,11 @@ if has('statusline')
115123
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
116124
endif
117125

118-
"==========================================
119-
" File encode:encode for varied filetype
120-
"==========================================
121-
122-
set encoding=utf-8
123-
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
124-
set helplang=en
125-
set termencoding=utf-8
126-
127-
set ffs=unix,dos,mac " Use Unix as the standard file type
128-
set formatoptions+=m
129-
set formatoptions+=B " When joining lines, don't insert a space between two multi-byte characters.
130-
set completeopt=longest,menu " behaviour of insert mode completion
131-
set wildmenu " auto complete command
132-
set wildignore=**.o,*~,.swp,*.bak,*.pyc,*.class " Ignore compiled files
133126

134-
" if this not work ,make sure .viminfo is writable for you
135-
if has("autocmd") " remember the last cursor postion when reopen a file
127+
if has("autocmd")
136128
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
137129
endif
138-
set viminfo^=% " Remember info about open buffers on close
139-
set magic " For regular expressions turn magic on
140-
141-
set backspace=eol,start,indent " Configure backspace so it acts as it should act
142-
set whichwrap+=<,>,h,l
143-
set pastetoggle=<F5> " when in insert mode, toggle between 'paste' and 'nopaste'
144-
au InsertLeave * set nopaste " disbale paste mode when leaving insert mode
145-
autocmd! bufwritepost .vimrc source $MYVIMRC " auto load vimrc file after modify
130+
au InsertLeave * set nopaste
146131

147132
"close popup menu when leave insert mode
148133
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
@@ -154,11 +139,11 @@ inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
154139
autocmd FileType python set tabstop=4 shiftwidth=4 expandtab ai
155140
autocmd FileType javascript,json,css,scss,html set tabstop=2 shiftwidth=2 expandtab ai
156141

142+
autocmd BufReadPre * if getfsize(expand("%")) > 10000000 | syntax off | endif
143+
157144
"==========================================
158145
"Key Mappings:Customized keys
159146
"==========================================
160-
let mapleader = ','
161-
let g:mapleader = ','
162147

163148
command! W w !sudo tee % > /dev/null
164149

@@ -175,10 +160,6 @@ vnoremap <C-c> "*y
175160
" use <C-V> to paste yanked content
176161
inoremap <C-V> <C-R>"
177162
178-
" Quickly edit/reload the vimrc file
179-
nmap <silent> <leader>ev :e $MYVIMRC<CR>
180-
nmap <silent> <leader>sv :so $MYVIMRC<CR>
181-
182163
"Treat long lines as break lines (useful when moving around in them)
183164
map j gj
184165
map k gk
@@ -216,12 +197,6 @@ noremap <F1> <Esc>"
216197
nnoremap ; :
217198
nnoremap ' :b
218199
219-
nnoremap <leader>v V`}
220-
221-
"Use sane regexes !not used!
222-
nnoremap / /\v
223-
vnoremap / /\v
224-
225200
"Keep search pattern at the center of the screen."
226201
nnoremap <silent> n nzz
227202
nnoremap <silent> N Nzz
@@ -239,11 +214,6 @@ nnoremap U <C-r>
239214
" select all
240215
map <Leader>sa ggVG"
241216
242-
cnoremap %% <C-R>=expand('%:h').'/'<cr>
243-
map <leader>ew :e %%
244-
map <leader>es :sp %%
245-
map <leader>ev :vsp %%
246-
247217
nnoremap dp :diffput<CR>
248218
nnoremap dg :diffget<CR>
249219
@@ -264,351 +234,7 @@ if has('macunix')
264234
vmap <C-c> :w !pbcopy<CR><CR>
265235
endif
266236

267-
"==========================================
268-
" Bundle:Plgin management and setting
269-
"==========================================
270-
"package dependent: ctags
271-
"awesome javascript autocomplete dependent: nodejs
272-
273-
call plug#begin('~/.vim/bundle')
274-
275-
"################### Plugins Management ###################"
276-
277-
" vim plugin bundle control, command model
278-
" :PlugInstall install
279-
" :PlugInstall! update
280-
" :PlugClean remove plugin not in list
281-
282-
"################### Navigation ###################"
283-
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
284-
map <leader>e :NERDTreeToggle<CR>
285-
let NERDTreeHighlightCursorline=1
286-
let NERDTreeQuitOnOpen=1
287-
let NERDTreeIgnore=[ '\.pyc$', '\.pyo$', '\.obj$', '\.o$', '\.so$', '\.egg$', '^\.git$', '^\.svn$', '^\.hg$' ]
288-
let g:netrw_home='~/bak'
289-
"close vim if the only window left open is a NERDTree
290-
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | end
291-
292-
Plug 'majutsushi/tagbar'
293-
nmap <F9> :TagbarToggle<CR>
294-
let g:tagbar_autofocus = 1
295-
let g:tagbar_width = 50
296-
297-
Plug 'ctrlpvim/ctrlp.vim'
298-
map <leader>m :CtrlPMRU<CR>
299-
map <leader>b :CtrlPBuffer<CR>
300-
map <leader>f :CtrlPMixed<CR>
301-
let g:ctrlp_custom_ignore = {
302-
\ 'dir': '\v[\/](node_modules|target|dist)|\.(git|hg|svn|rvm)$',
303-
\ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
304-
\ }
305-
let g:ctrlp_follow_symlinks=1
306-
307-
" CtrlP extensions, go to defination
308-
" Mapping: <Leader>fu
309-
Plug 'tacahiroy/ctrlp-funky'
310-
let g:ctrlp_funky_matchtype = 'path'
311-
nnoremap <Leader>fu :CtrlPFunky<Cr>
312-
313-
Plug 'sgur/ctrlp-extensions.vim'
314-
nnoremap <Leader>cy :CtrlPYankring<Cr>
315-
316-
Plug 'dyng/ctrlsf.vim', {'on': 'CtrlSFVwordExec'}
317-
vmap <Leader>s <Plug>CtrlSFVwordExec
318-
319-
Plug 'rking/ag.vim'
320-
nnoremap <Leader><Leader>a :Ag!<space>
321-
let g:ag_working_path_mode='r'
322-
323-
324-
"################### Display Enhancements ###################"
325-
let g:netrw_liststyle=3
326-
"Enhances status bar
327-
Plug 'bling/vim-airline'
328-
let g:airline_powerline_fonts = 1
329-
let g:airline#extensions#tabline#enabled = 1
330-
let g:airline#extensions#tabline#formatter = 'unique_tail'
331-
let g:airline#extensions#tabline#buffer_nr_show = 1
332-
333-
" css/less/sass/html color preview
334-
Plug 'gorodinskiy/vim-coloresque'
335-
336-
"show whitespaces not used and call :FixWhitespace to remove them
337-
" Mapping: <leader><space>
338-
Plug 'bronson/vim-trailing-whitespace'
339-
map <leader><space> :FixWhitespace<cr>
340-
341-
"Plug 'ruanyl/trailing-tab.vim'
342-
"let g:extra_tab_ignored_filetypes = ['php']
343-
344-
" auto save views when exist vim
345-
" auto open views when open vim
346-
" this will create a `session` dir in your `.vim` dir
347-
Plug 'tpope/vim-obsession'
348-
Plug 'dhruvasagar/vim-prosession'
349-
350-
Plug 'MattesGroeger/vim-bookmarks'
351-
nmap <Leader><Leader>m <Plug>BookmarkToggle
352-
nmap <Leader>i <Plug>BookmarkAnnotate
353-
nmap <Leader>a <Plug>BookmarkShowAll
354-
nmap <Leader>j <Plug>BookmarkNext
355-
nmap <Leader>k <Plug>BookmarkPrev
356-
nmap <Leader>c <Plug>BookmarkClear
357-
nmap <Leader>x <Plug>BookmarkClearAll
358-
359-
" highlights the enclosing html/xml tags
360-
Plug 'Valloric/MatchTagAlways'
361-
362-
" Maximize split window
363-
Plug 'szw/vim-maximizer'
364-
nnoremap <tab> :MaximizerToggle<CR>
365-
366-
"################### Themes ###################"
367-
368-
"theme solarized
369-
Plug 'altercation/vim-colors-solarized'
370-
let g:solarized_termcolors=16
371-
let g:solarized_termtrans=1
372-
let g:solarized_contrast="high"
373-
let g:solarized_visibility="high"
374-
375-
"theme molokai
376-
Plug 'tomasr/molokai'
377-
"let g:molokai_original = 1
378-
379-
380-
"################### fast move ###################"
381-
382-
" Move to anywhere
383-
" Mapping: s
384-
Plug 'Lokaltog/vim-easymotion'
385-
map <space> <Plug>(easymotion-s2)
386-
map / <Plug>(easymotion-sn)
387-
omap / <Plug>(easymotion-tn)
388-
let g:EasyMotion_smartcase = 1
389-
390-
" extended % matching for HTML, LaTeX, and many other languages
391-
Plug 'vim-scripts/matchit.zip'
392-
393-
"################### auto complete and fast edit ###################"
394-
" Select blocks quickly
395-
" Mapping: <Enter>
396-
Plug 'gcmt/wildfire.vim'
397-
let g:wildfire_objects = {
398-
\ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"],
399-
\ "html,xml" : ["at"],
400-
\ }
401-
let g:wildfire_fuel_map = "<ENTER>"
402-
let g:wildfire_water_map = "<BS>"
403-
404-
" auto close html tag when press >
405-
Plug 'alvan/vim-closetag'
406-
407-
Plug 'Valloric/YouCompleteMe'
408-
let g:ycm_autoclose_preview_window_after_completion = 1
409-
"let g:ycm_complete_in_strings = 1
410-
let g:ycm_complete_in_comments = 1
411-
let g:ycm_key_list_select_completion = ['<Tab>', '<C-n>', '<Down>']
412-
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
413-
let g:ycm_semantic_triggers = {
414-
\ 'c' : ['->', '.'],
415-
\ 'objc' : ['->', '.'],
416-
\ 'ocaml' : ['.', '#'],
417-
\ 'cpp,objcpp' : ['->', '.', '::'],
418-
\ 'perl' : ['->'],
419-
\ 'php' : ['->', '::', '(', 'use ', 'namespace ', '\'],
420-
\ 'cs,java,typescript,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'],
421-
\ 'html': ['<', '"', '</', ' '],
422-
\ 'vim' : ['re![_a-za-z]+[_\w]*\.'],
423-
\ 'ruby' : ['.', '::'],
424-
\ 'lua' : ['.', ':'],
425-
\ 'erlang' : [':'],
426-
\ 'haskell' : ['.', 're!.'],
427-
\ 'css': [ 're!^\s{2,4}', 're!:\s+' ],
428-
\ }
429-
430-
"powerful snippets plugin, ctrl+\ to trigger
431-
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
432-
let g:UltiSnipsExpandTrigger="<c-\\>"
433-
let g:UltiSnipsJumpForwardTrigger="<c-b>"
434-
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
435-
436-
"add comment quickly
437-
Plug 'scrooloose/nerdcommenter'
438-
439-
"add surround character quickly
440-
" Mappings:
441-
" surround with: ysiw
442-
" unsurround with: ds
443-
Plug 'tpope/vim-surround'
444-
445-
"for repeat -> enhance surround.vim, . to repeat command
446-
Plug 'tpope/vim-repeat'
447-
448-
Plug 'Raimondi/delimitMate'
449-
let delimitMate_matchpairs = "(:),[:],{:}"
450-
451-
"for code alignment
452-
Plug 'godlygeek/tabular'
453-
nmap <Leader>a= :Tabularize /=<CR>
454-
vmap <Leader>a= :Tabularize /=<CR>
455-
nmap <Leader>a: :Tabularize /:<CR>
456-
vmap <Leader>a: :Tabularize /:<CR>
457-
nmap <Leader>a" :Tabularize /"<CR>
458-
vmap <Leader>a" :Tabularize /"<CR>
459-
460-
"for mutil cursor
461-
Plug 'terryma/vim-multiple-cursors'
462-
463-
Plug 'mattn/emmet-vim'
464-
465-
Plug 'Ioannis-Kapoulas/vim-autoprefixer'
466-
467-
"################# syntax check ###############
468-
469-
Plug 'scrooloose/syntastic'
470-
let g:syntastic_error_symbol=''
471-
let g:syntastic_warning_symbol=''
472-
let g:syntastic_style_error_symbol='~'
473-
let g:syntastic_style_warning_symbol=''
474-
let g:syntastic_check_on_open=1
475-
let g:syntastic_enable_highlighting = 0
476-
let g:syntastic_javascript_checkers = ['eslint']
477-
"################# Highlight ###############
478-
479-
"highlight for css3
480-
Plug 'hail2u/vim-css3-syntax'
481-
482-
" for markdown
483-
Plug 'plasticboy/vim-markdown'
484-
let g:vim_markdown_folding_disabled=1
485-
let g:vim_markdown_no_default_key_mappings=1
486-
let g:vim_markdown_frontmatter=1
487-
488-
" for javascript
489-
Plug 'pangloss/vim-javascript', {'branch': 'develop'}
490-
491-
Plug 'ruanyl/vim-fixmyjs', {'on': 'Fixmyjs'}
492-
493-
Plug 'kchmck/vim-coffee-script', {'for': 'coffee'}
494-
495-
"Syntax for JavaScript libraries
496-
Plug 'othree/javascript-libraries-syntax.vim'
497-
498-
"AngularJS with Vim
499-
Plug 'burnettk/vim-angular'
500-
501-
" ReactJS
502-
Plug 'mxw/vim-jsx'
503-
let g:jsx_ext_required = 0 " Allow JSX in normal JS files"
504-
505-
"################## Language Specific ##################
506-
"generate javascript doc
507-
Plug 'heavenshell/vim-jsdoc'
508-
let g:jsdoc_default_mapping = 0
509-
autocmd FileType javascript nnoremap <Leader><Leader>d :JsDoc<CR>
510-
511-
" Provides Tern-based JavaScript editing support. Require Nodejs installed
512-
Plug 'marijnh/tern_for_vim'
513-
let tern_show_signature_in_pum = 1
514-
autocmd FileType javascript nnoremap <leader>d :TernDef<CR>
515-
autocmd FileType javascript setlocal omnifunc=tern#Complete
516-
517-
" Up to date PHP syntax
518-
Plug 'StanAngeloff/php.vim', {'for': 'php'}
519-
520-
" improved PHP omnicompletion
521-
Plug 'shawncplus/phpcomplete.vim', {'for': 'php'}
522-
523-
Plug 'ruanyl/vim-php-manual', {'for': 'php'}
524-
let g:php_manual_enable_online_search = 0
525-
526-
" composer project php auto completion
527-
" Generate Index: :call padawan#GenerateIndex()
528-
" Start Server: :call padawan#StartServer()
529-
" Stop Server: :call padawan#StopServer()
530-
" Restart Server: :call padawan#RestartServer()
531-
" cd ~/.vim/bundle/padawan.vim/padawan.php && composer install
532-
Plug 'mkusher/padawan.vim', {'for': 'php'}
533-
534-
Plug 'ruanyl/vim-caniuse', {'on': 'Caniuse'}
535-
536-
"################### Others ###################"
537-
538-
"edit history, historical edit tree
539-
Plug 'sjl/gundo.vim', {'on': 'GundoToggle'}
540-
nnoremap <leader>h :GundoToggle<CR>
541-
let g:gundo_auto_preview = 0
542-
543-
"format js, html, css files
544-
"require: npm install -g js-beautify
545-
Plug 'Chiel92/vim-autoformat', {'on': 'Autoformat'}
546-
autocmd FileType javascript,json,html,css,scss noremap <buffer> <leader><leader>f :Autoformat<cr>
547-
548-
" quick run current buffer or selected code
549-
" Command: :QuickRun or :QuickRun {language}
550-
Plug 'thinca/vim-quickrun'
551-
"autocmd FileType go noremap <buffer> <leader>r :!go run %<cr>
552-
553-
Plug 'mattn/webapi-vim'
554-
555-
Plug 'tpope/vim-fugitive'
556-
557-
" delete current buffer
558-
Plug 'moll/vim-bbye'
559-
nnoremap qq :Bdelete<cr>
560-
561-
" delete all buffers except current one.
562-
" call :BufOnly
563-
Plug 'vim-scripts/BufOnly.vim'
564-
nnoremap <silent> qo :BufOnly<CR>
565-
566-
Plug 'editorconfig/editorconfig-vim'
567-
568-
call plug#end()
569-
570-
"==========================================
571-
" Color&Theme
572-
"==========================================
573-
574-
filetype plugin indent on
575-
576-
syntax enable
577-
syntax on
578-
579-
" Set extra options when running in GUI mode
580-
if has("gui_running")
581-
set guifont=Monaco:h14
582-
set guioptions-=T
583-
set guioptions+=e
584-
set guioptions-=r
585-
set guioptions-=L
586-
set guitablabel=%M\ %t
587-
set showtabline=1
588-
set linespace=2
589-
set noimd
590-
set t_Co=256
237+
"Load plugins
238+
if filereadable(expand("~/.vim/vimrc.local"))
239+
source ~/.vim/vimrc.local
591240
endif
592-
593-
set background=dark
594-
set t_Co=256
595-
596-
colorscheme solarized
597-
"colorscheme molokai
598-
"colorscheme desert
599-
600-
hi! link SignColumn LineNr
601-
hi! link ShowMarksHLl DiffAdd
602-
hi! link ShowMarksHLu DiffChange
603-
604-
" for error highlight
605-
highlight clear SpellBad
606-
highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline
607-
highlight clear SpellCap
608-
highlight SpellCap term=underline cterm=underline
609-
highlight clear SpellRare
610-
highlight SpellRare term=underline cterm=underline
611-
highlight clear SpellLocal
612-
highlight SpellLocal term=underline cterm=underline
613-
614-
autocmd BufReadPre * if getfsize(expand("%")) > 10000000 | syntax off | endif

‎vimrc.bundles

+305
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
"==========================================
2+
" Vim-Plug:Plgin management and setting
3+
"==========================================
4+
"package dependent: ctags
5+
"awesome javascript autocomplete dependent: nodejs
6+
7+
call plug#begin('~/.vim/bundle')
8+
9+
let mapleader = ','
10+
let g:mapleader = ','
11+
12+
"################### Plugins Management ###################"
13+
14+
" vim plugin bundle control, command model
15+
" :PlugInstall install
16+
" :PlugInstall! update
17+
" :PlugClean remove plugin not in list
18+
19+
"################### Navigation ###################"
20+
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
21+
map <leader>e :NERDTreeToggle<CR>
22+
let NERDTreeHighlightCursorline=1
23+
let NERDTreeQuitOnOpen=1
24+
let NERDTreeIgnore=[ '\.pyc$', '\.pyo$', '\.obj$', '\.o$', '\.so$', '\.egg$', '^\.git$', '^\.svn$', '^\.hg$' ]
25+
let g:netrw_home='~/bak'
26+
"close vim if the only window left open is a NERDTree
27+
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | end
28+
29+
Plug 'majutsushi/tagbar'
30+
nmap <F9> :TagbarToggle<CR>
31+
let g:tagbar_autofocus = 1
32+
let g:tagbar_width = 50
33+
34+
Plug 'ctrlpvim/ctrlp.vim'
35+
map <leader>m :CtrlPMRU<CR>
36+
map <leader>b :CtrlPBuffer<CR>
37+
map <leader>f :CtrlPMixed<CR>
38+
let g:ctrlp_custom_ignore = {
39+
\ 'dir': '\v[\/](node_modules|target|dist)|\.(git|hg|svn|rvm)$',
40+
\ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
41+
\ }
42+
let g:ctrlp_follow_symlinks=1
43+
44+
" CtrlP extensions, go to defination
45+
" Mapping: <Leader>fu
46+
Plug 'tacahiroy/ctrlp-funky'
47+
let g:ctrlp_funky_matchtype = 'path'
48+
nnoremap <Leader>fu :CtrlPFunky<Cr>
49+
50+
Plug 'sgur/ctrlp-extensions.vim'
51+
nnoremap <Leader>cy :CtrlPYankring<Cr>
52+
53+
Plug 'dyng/ctrlsf.vim', {'on': 'CtrlSFVwordExec'}
54+
vmap <Leader>s <Plug>CtrlSFVwordExec
55+
56+
Plug 'rking/ag.vim'
57+
nnoremap <Leader><Leader>a :Ag!<space>
58+
let g:ag_working_path_mode='r'
59+
60+
61+
"################### Display Enhancements ###################"
62+
let g:netrw_liststyle=3
63+
"Enhances status bar
64+
Plug 'bling/vim-airline'
65+
let g:airline_powerline_fonts = 1
66+
let g:airline#extensions#tabline#enabled = 1
67+
let g:airline#extensions#tabline#formatter = 'unique_tail'
68+
let g:airline#extensions#tabline#buffer_nr_show = 1
69+
70+
" css/less/sass/html color preview
71+
Plug 'gorodinskiy/vim-coloresque'
72+
73+
"show whitespaces not used and call :FixWhitespace to remove them
74+
" Mapping: <leader><space>
75+
Plug 'bronson/vim-trailing-whitespace'
76+
map <leader><space> :FixWhitespace<cr>
77+
78+
"Plug 'ruanyl/trailing-tab.vim'
79+
"let g:extra_tab_ignored_filetypes = ['php']
80+
81+
" auto save views when exist vim
82+
" auto open views when open vim
83+
" this will create a `session` dir in your `.vim` dir
84+
Plug 'tpope/vim-obsession'
85+
Plug 'dhruvasagar/vim-prosession'
86+
87+
Plug 'MattesGroeger/vim-bookmarks'
88+
nmap <Leader><Leader>m <Plug>BookmarkToggle
89+
nmap <Leader>i <Plug>BookmarkAnnotate
90+
nmap <Leader>a <Plug>BookmarkShowAll
91+
nmap <Leader>j <Plug>BookmarkNext
92+
nmap <Leader>k <Plug>BookmarkPrev
93+
nmap <Leader>c <Plug>BookmarkClear
94+
nmap <Leader>x <Plug>BookmarkClearAll
95+
96+
" highlights the enclosing html/xml tags
97+
Plug 'Valloric/MatchTagAlways'
98+
99+
" Maximize split window
100+
Plug 'szw/vim-maximizer'
101+
nnoremap <tab> :MaximizerToggle<CR>
102+
103+
"################### Themes ###################"
104+
105+
"theme solarized
106+
Plug 'altercation/vim-colors-solarized'
107+
let g:solarized_termcolors=16
108+
let g:solarized_termtrans=1
109+
let g:solarized_contrast="high"
110+
let g:solarized_visibility="high"
111+
112+
"theme molokai
113+
Plug 'tomasr/molokai'
114+
"let g:molokai_original = 1
115+
116+
117+
"################### fast move ###################"
118+
119+
" Move to anywhere
120+
" Mapping: s
121+
Plug 'Lokaltog/vim-easymotion'
122+
map <space> <Plug>(easymotion-s2)
123+
map / <Plug>(easymotion-sn)
124+
omap / <Plug>(easymotion-tn)
125+
let g:EasyMotion_smartcase = 1
126+
127+
" extended % matching for HTML, LaTeX, and many other languages
128+
Plug 'vim-scripts/matchit.zip'
129+
130+
"################### auto complete and fast edit ###################"
131+
" Select blocks quickly
132+
" Mapping: <Enter>
133+
Plug 'gcmt/wildfire.vim'
134+
let g:wildfire_objects = {
135+
\ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"],
136+
\ "html,xml" : ["at"],
137+
\ }
138+
let g:wildfire_fuel_map = "<ENTER>"
139+
let g:wildfire_water_map = "<BS>"
140+
141+
" auto close html tag when press >
142+
Plug 'alvan/vim-closetag'
143+
144+
Plug 'Valloric/YouCompleteMe'
145+
let g:ycm_autoclose_preview_window_after_completion = 1
146+
"let g:ycm_complete_in_strings = 1
147+
let g:ycm_complete_in_comments = 1
148+
let g:ycm_key_list_select_completion = ['<Tab>', '<C-n>', '<Down>']
149+
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
150+
let g:ycm_semantic_triggers = {
151+
\ 'c' : ['->', '.'],
152+
\ 'objc' : ['->', '.'],
153+
\ 'ocaml' : ['.', '#'],
154+
\ 'cpp,objcpp' : ['->', '.', '::'],
155+
\ 'perl' : ['->'],
156+
\ 'php' : ['->', '::', '(', 'use ', 'namespace ', '\'],
157+
\ 'cs,java,typescript,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'],
158+
\ 'html': ['<', '"', '</', ' '],
159+
\ 'vim' : ['re![_a-za-z]+[_\w]*\.'],
160+
\ 'ruby' : ['.', '::'],
161+
\ 'lua' : ['.', ':'],
162+
\ 'erlang' : [':'],
163+
\ 'haskell' : ['.', 're!.'],
164+
\ 'css': [ 're!^\s{2,4}', 're!:\s+' ],
165+
\ }
166+
167+
"powerful snippets plugin, ctrl+\ to trigger
168+
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
169+
let g:UltiSnipsExpandTrigger="<c-\\>"
170+
let g:UltiSnipsJumpForwardTrigger="<c-b>"
171+
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
172+
173+
"add comment quickly
174+
Plug 'scrooloose/nerdcommenter'
175+
176+
"add surround character quickly
177+
" Mappings:
178+
" surround with: ysiw
179+
" unsurround with: ds
180+
Plug 'tpope/vim-surround'
181+
182+
"for repeat -> enhance surround.vim, . to repeat command
183+
Plug 'tpope/vim-repeat'
184+
185+
Plug 'Raimondi/delimitMate'
186+
let delimitMate_matchpairs = "(:),[:],{:}"
187+
188+
"for code alignment
189+
Plug 'godlygeek/tabular'
190+
nmap <Leader>a= :Tabularize /=<CR>
191+
vmap <Leader>a= :Tabularize /=<CR>
192+
nmap <Leader>a: :Tabularize /:<CR>
193+
vmap <Leader>a: :Tabularize /:<CR>
194+
nmap <Leader>a" :Tabularize /"<CR>
195+
vmap <Leader>a" :Tabularize /"<CR>
196+
197+
"for mutil cursor
198+
Plug 'terryma/vim-multiple-cursors'
199+
200+
Plug 'mattn/emmet-vim'
201+
202+
Plug 'Ioannis-Kapoulas/vim-autoprefixer'
203+
204+
"################# syntax check ###############
205+
206+
Plug 'scrooloose/syntastic'
207+
let g:syntastic_error_symbol='✗'
208+
let g:syntastic_warning_symbol='⚠'
209+
let g:syntastic_style_error_symbol='~'
210+
let g:syntastic_style_warning_symbol='⚠'
211+
let g:syntastic_check_on_open=1
212+
let g:syntastic_enable_highlighting = 0
213+
let g:syntastic_javascript_checkers = ['eslint']
214+
"################# Highlight ###############
215+
216+
"highlight for css3
217+
Plug 'hail2u/vim-css3-syntax'
218+
219+
" for markdown
220+
Plug 'plasticboy/vim-markdown'
221+
let g:vim_markdown_folding_disabled=1
222+
let g:vim_markdown_no_default_key_mappings=1
223+
let g:vim_markdown_frontmatter=1
224+
225+
" for javascript
226+
Plug 'pangloss/vim-javascript', {'branch': 'develop'}
227+
228+
Plug 'ruanyl/vim-fixmyjs', {'on': 'Fixmyjs'}
229+
230+
Plug 'kchmck/vim-coffee-script', {'for': 'coffee'}
231+
232+
"Syntax for JavaScript libraries
233+
Plug 'othree/javascript-libraries-syntax.vim'
234+
235+
"AngularJS with Vim
236+
Plug 'burnettk/vim-angular'
237+
238+
" ReactJS
239+
Plug 'mxw/vim-jsx'
240+
let g:jsx_ext_required = 0 " Allow JSX in normal JS files"
241+
242+
"################## Language Specific ##################
243+
"generate javascript doc
244+
Plug 'heavenshell/vim-jsdoc'
245+
let g:jsdoc_default_mapping = 0
246+
autocmd FileType javascript nnoremap <Leader><Leader>d :JsDoc<CR>
247+
248+
" Provides Tern-based JavaScript editing support. Require Nodejs installed
249+
Plug 'marijnh/tern_for_vim'
250+
let tern_show_signature_in_pum = 1
251+
autocmd FileType javascript nnoremap <leader>d :TernDef<CR>
252+
autocmd FileType javascript setlocal omnifunc=tern#Complete
253+
254+
" Up to date PHP syntax
255+
Plug 'StanAngeloff/php.vim', {'for': 'php'}
256+
257+
" improved PHP omnicompletion
258+
Plug 'shawncplus/phpcomplete.vim', {'for': 'php'}
259+
260+
Plug 'ruanyl/vim-php-manual', {'for': 'php'}
261+
let g:php_manual_enable_online_search = 0
262+
263+
" composer project php auto completion
264+
" Generate Index: :call padawan#GenerateIndex()
265+
" Start Server: :call padawan#StartServer()
266+
" Stop Server: :call padawan#StopServer()
267+
" Restart Server: :call padawan#RestartServer()
268+
" cd ~/.vim/bundle/padawan.vim/padawan.php && composer install
269+
Plug 'mkusher/padawan.vim', {'for': 'php'}
270+
271+
Plug 'ruanyl/vim-caniuse', {'on': 'Caniuse'}
272+
273+
"################### Others ###################"
274+
275+
"edit history, historical edit tree
276+
Plug 'sjl/gundo.vim', {'on': 'GundoToggle'}
277+
nnoremap <leader>h :GundoToggle<CR>
278+
let g:gundo_auto_preview = 0
279+
280+
"format js, html, css files
281+
"require: npm install -g js-beautify
282+
Plug 'Chiel92/vim-autoformat', {'on': 'Autoformat'}
283+
autocmd FileType javascript,json,html,css,scss noremap <buffer> <leader><leader>f :Autoformat<cr>
284+
285+
" quick run current buffer or selected code
286+
" Command: :QuickRun or :QuickRun {language}
287+
Plug 'thinca/vim-quickrun'
288+
"autocmd FileType go noremap <buffer> <leader>r :!go run %<cr>
289+
290+
Plug 'mattn/webapi-vim'
291+
292+
Plug 'tpope/vim-fugitive'
293+
294+
" delete current buffer
295+
Plug 'moll/vim-bbye'
296+
nnoremap qq :Bdelete<cr>
297+
298+
" delete all buffers except current one.
299+
" call :BufOnly
300+
Plug 'vim-scripts/BufOnly.vim'
301+
nnoremap <silent> qo :BufOnly<CR>
302+
303+
Plug 'editorconfig/editorconfig-vim'
304+
305+
call plug#end()

‎vimrc.local.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
" in order to make your local setting works
2+
" copy this file and rename it as vimrc.local
3+
" add your vimrc configurations here

0 commit comments

Comments
 (0)
Please sign in to comment.