-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
167 lines (136 loc) · 5.22 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
set nocompatible
filetype off
set fileencodings=ucs-bom,utf-8,gbk
set background=dark " Assume a dark background
syntax on
colorscheme evening
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'mileszs/ack.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'scrooloose/syntastic'
Plugin 'plasticboy/vim-markdown'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'taglist.vim'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
" Plugin 'user/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put non-Plugin stuff after this line
" set file types
au BufNewFile,BufRead *.lbi set filetype=php
au BufNewFile,BufRead *.dwt set filetype=php
let mapleader = ","
" PHP code autocomplete
au FileType php set omnifunc=phpcomplete#CompletePHP
"""""""""""""""""""""""""""""""""
" PHP syntax settings
"""""""""""""""""""""""""""""""""
let php_sql_query=1 " enable SQL syntax highlighting inside Strings
let php_htmlInStrings=1 " enable HTML syntax highlighting inside strings
let php_folding=0 " enable folding for classes and functions
let php_parent_error_close=1 " highlighting parent error ] or )
let php_parent_error_open=1 " highlighting if there exists an open ( or [ without a closing one
" PHP parser check (CTRL-L)
autocmd FileType php noremap <C-L> :!/usr/bin/php -l %<CR>
" do syntax checks when buffers are first loaded as
" well as on saving
let g:syntastic_check_on_open=1
" automatically open or close error window
let g:syntastic_auto_loc_list=1
let g:syntastic_phpcs_disable=1
"set tab width to 4, coding standard to CodeIgniter
"let g:syntastic_phpcs_conf = "--tab-width=4 --standard=CodeIgniter"
" PHPDOC support
function! PhpDocLoad()
so ~/.vim/doc/php-doc.vim
inoremap <leader>pd <ESC>:call PhpDocSingle()<CR>i
nnoremap <leader>pd :call PhpDocSingle()<CR>
vnoremap <leader>pd :call PhpDocRange()<CR>
endfunction
autocmd BufNewFile,BufRead *.php call PhpDocLoad()
set tabstop=4 " how many columns a tab counts for
set shiftwidth=4 " how many columns an indent counts for
set expandtab " insert spaces when hitting Tab in insert mode
set number " show line number
set pastetoggle=<F2> " pastetoggle (sane indentation on pastes)
set incsearch " find as you type search
set hlsearch " highlight search terms
set list " show invisible characters
set listchars=tab:▸\ ,trail:.,precedes:<,extends:>,eol:¬
"Invisible character colors
highlight NonText ctermfg=darkgray
highlight SpecialKey ctermfg=darkgray
" o Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode.
" r Automatically insert the current comment leader after hitting <Enter> in Insert mode.
set formatoptions+=or
" C-style indent
set cindent
" Wrap lines
set wrap
" TagList options
nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Use_Right_Window = 1
let Tlist_Compact_Format = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_File_Fild_Auto_Close = 1
let Tlist_Inc_Winwidth = 0
let Tlist_Close_On_Select = 1
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Display_Tag_Scope = 1
let tlist_php_settings = 'php;c:class;f:function'
" NERDTree options
let NERDChristmasTree=1
let NERDTreeCaseSensitiveSort=1
let NERDTreeChDirMode=2
let NERDTreeBookmarksFile = "~/.vim/NERDTreeBookmarks"
let NERDTreeShowBookmarks=1
let NERDTreeShowHidden=1
let NERDTreeQuitOnOpen=1
"map <Leader>n :NERDTree<CR>
map <Leader>n :NERDTreeToggle<CR>
"map <F10> :NERDTreeToggle<CR>
" fold codes
set foldmethod=syntax
set foldlevel=100
:nnoremap <F5> "=strftime("@since %Y-%m-%d %H:%M:%S")<CR>P
:inoremap <F5> <C-R>=strftime("@since %Y-%m-%d %H:%M:%S")<CR>
" code fold settings
set foldmethod=indent
set foldignore=
" search settings
set incsearch
set ignorecase
set smartcase