forked from spf13/spf13-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.fork
163 lines (139 loc) · 4.93 KB
/
.vimrc.fork
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
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
"
" Matt Mikitka's fork of spf13's Vim configuration: https://github.com/spf13/spf13-vim
"
" Clone the fork at https://github.com/mmikitka/spf13-vim
" }
" Vim UI {
if !exists('g:override_spf13_bundles') && filereadable(g:spf13_vundle_dir . '/vim-colors-solarized/colors/solarized.vim')
let g:solarized_termcolors=16
colorscheme solarized
endif
set novisualbell " No blinking
set noerrorbells " No noise.
set vb t_vb= " Disable any beeps or flashes on error"
set nocursorline " Incurs a significant performance penalty when drawn over
" syntax-highlighted lines, which is almost everything
" }
" Formatting {
set fo+=o " Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode.
set fo-=r " Do not automatically insert a comment leader after an enter
set fo-=t " Do no auto-wrap text using textwidth (does not apply to comments)"
set wrap
" }
" Filetype Detection {
augroup filetypedetect
" Detect .txt as 'text'
autocmd! BufNewFile,BufRead *.txt setfiletype text
augroup END
" }
" File-specific settings {
autocmd FileType javascript setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType php setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType python setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType text setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType xhtml,html,xml setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType scss setlocal shiftwidth=2 tabstop=2 softtabstop=2
" }
" Syntastic {
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_aggregate_errors = 0
let g:syntastic_enable_balloons = 0
" Passive checking by default
let g:syntastic_mode_map = { 'mode': 'passive',
\ 'active_filetypes': [],
\ 'passive_filetypes': [] }
" }
" Ctrl-P {
let g:ctrlp_switch_buffer = 'Et'
let g:ctrlp_open_new_file = 'h'
" }
" PHP {
let php_folding = 0
" Folding incurs a significant performance hit
" See https://github.com/spf13/PIV/issues/24
let g:DisableAutoPHPFolding = 1
let g:syntastic_phpcs_conf = '--standard=PEAR'
" NOTE: I downgraded the doc.vim file in PIV to the latest php-doc.vim
" since I do not like the Vim folding tag inserts
let g:pdv_cfg_Category = "Category"
let g:pdv_cfg_Package = "Package"
let g:pdv_cfg_Version = "Release: 1.0"
let g:pdv_cfg_License = "None""
" }
" Vdebug {
let g:vdebug_options = {
\ "port" : 9000,
\ "server" : 'localhost',
\ "timeout" : 20,
\ "on_close" : 'detach',
\ "ide_key" : '1',
\}
" Adjust the max depth of XDebug
let g:vdebug_features = {
\ "max_depth" : 5,
\ "max_children" : 64,
\ "max_data" : 128,
\}
" Map the key bindings to Firebug
let g:vdebug_keymap = {
\ "run_to_cursor" : "<F1>",
\ "set_breakpoint" : "<F4>",
\ "run" : "<F5>",
\ "close" : "<F6>",
\ "detach" : "<F7>",
\ "get_context" : "<F8>",
\ "eval_under_cursor" : "<F9>",
\ "step_over" : "<F10>",
\ "step_into" : "<F11>",
\ "step_out" : "<S-F11>",
\}
" }
" vim-test {
nmap <silent> <leader>tn :TestNearest<CR>
nmap <silent> <leader>tf :TestFile<CR>
nmap <silent> <leader>ts :TestSuite<CR>
nmap <silent> <leader>tl :TestLast<CR>
nmap <silent> <leader>tv :TestVisit<CR>
" My Pull Request was not accepted, so I'm overriding the vim-test
" functions. See https://github.com/janko-m/vim-test/pull/99
function! s:search_local_executable(dir) abort
" Look for phpunit in Composer's vendor/bin and Symfony's bin directories
echo a:dir
if filereadable(a:dir . '/vendor/bin/phpunit')
return a:dir . '/vendor/bin/phpunit'
elseif filereadable(a:dir . '/bin/phpunit')
return a:dir . '/bin/phpunit'
else
return ''
endif
endfunction
function! test#php#phpunit#executable() abort
let phpunit_path = ''
let search_count = 0
let search_base_dir = expand("%:p:h")
while search_count < g:test#executable_search_depth
let phpunit_path = s:search_local_executable(search_base_dir)
if phpunit_path != ''
break
endif
let search_base_dir = search_base_dir . '/..'
let search_count = search_count + 1
endwhile
if filereadable(phpunit_path)
return phpunit_path
else
return 'phpunit'
endif
endfunction
" Use absolute file paths
let test#filename_modifier = ':p'
" Maximum search depth while searching up the directories for the
" testrunner executable.
let g:test#executable_search_depth = 5
" }
" make {
nmap <silent> <leader>m :make<CR>
" }