This repository has been archived by the owner on May 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
253 lines (194 loc) · 7.81 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
" ========================================================
" Vim Configuration file created by Patryk Gawroński
"
" License: GNU General Public License v3.0
" e-mail: [email protected]
" ========================================================
set t_Co=256
syntax on
set background=dark
set statusline=2
set cinkeys=0{,0},0),:,!^F,o,O,e
highlight ColorColumn ctermbg=gray
set colorcolumn=80
"au FocusLost * :set number
"au FocusGained * :set relativenumber
set nu
highlight Normal ctermbg=Black
syntax enable
"#highlight iCursor guifg=red guibg=steelblue
"#set guicursor=n-v-c:block-Cursor
"#set guicursor+=i:ver100-iCursor
"#set guicursor+=n-v-c:blinkon0
"#set guicursor+=i:blinkwait10
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set backspace=indent,eol,start
set guifont=Hack\ 9
"colorscheme darkblack
"colorscheme darkbone
colorscheme elflord
set laststatus=2
" -------------------------------------------------------
" Vundle Setup
" -------------------------------------------------------
set nocompatible " be iMproved, required
filetype off " required
" 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 'VundleVim/Vundle.vim'
"Plugin 'hari-rangarajan/CCTree'
Plugin 'git://github.com/majutsushi/tagbar'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'hari-rangarajan/CCTree'
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" 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)
" 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/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'https://github.com/Valloric/YouCompleteMe.git'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'https://github.com/vim-syntastic/syntastic.git'
Plugin 'https://github.com/ctrlpvim/ctrlp.vim.git'
Plugin 'https://github.com/tell-k/vim-autopep8.git'
Plugin 'https://github.com/alvan/vim-closetag.git'
Plugin 'https://github.com/lepture/vim-jinja.git'
Plugin 'https://github.com/scrooloose/nerdtree.git'
" 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 your non-Plugin stuff after this line
" ----------------------------------------------------------------
" Vim-airline config section
" -----------------------------------------------------------------
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='powerlineish'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"set statusline+=col\ %c
" -------------------------------------------------------------------------
" CCTree extension
" -------------------------------------------------------------------------
let g:CCTreeScopeDb = "cscope.db"
let g:CCTreeRecursiveDepth = 5
let g:CCTreeMinVisibleDepth = 5
let g:CCTreeOrientation = "leftabove"
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_check_on_w = 1
let g:syntastic_mode_map = {'mode':'passive'}
" -------------------------------------------------------------------------
" Vim YouComplete me config section
" -------------------------------------------------------------------------
let g:ycm_min_num_of_chars_for_completion = 1 " default YCM value is 2
let g:ycm_min_num_indentifier_candidate_chars = 0 " default YCM value
let g:ycm_auto_trigger = 1 " default YCM value
let g:ycm_show_diagnostics_ui = 0 " default YCM value is 1 this turns off YCM syntax checker
let g:ycm_error_symbol = '>>' " defualt YCM value
let g:ycm_warning_symbol = '>>' " default YCM value
let g:ycm_enable_diagnostic_signs = 1 " default YCM value
let g:ycm_enable_diagnostic_highlighting = 1 " default YCM value
let g:ycm_echo_current_diagnostic = 1 " default YCM value
let g:ycm_complete_in_comments = 1 " defualt YCM value is 0
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
let g:ycm_autoclose_preview_window_after_insertion = 1 "
let g:ycm_semantic_triggers = {
\ 'c' : ['->', '.','re![_a-zA-z0-9]'],
\ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
\ 're!\[.*\]\s'],
\ 'ocaml' : ['.', '#'],
\ 'cpp,objcpp' : ['->', '.', '::','re![_a-zA-Z0-9]'],
\ 'perl' : ['->'],
\ 'php' : ['->', '::'],
\ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
\ 'ruby' : ['.', '::'],
\ 'lua' : ['.', ':'],
\ 'erlang' : [':'],
\ }
let g:ctrlp_map = '<C-p>'
let g:ctrlp_map = 'CtrlP'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
autocmd FileType python noremap <buffer> <F9> :call Autopep8()<CR>
let g:autopep8_max_line_length=100
let g:autopep8_diff_type='vertical'
" filenames like *.xml, *.html, *.xhtml, ...
let g:closetag_filenames = "*.html,*.xhtml,*.phtml"
let g:closetag_emptyTags_caseSensitive = 1
nnoremap <C-p> : CtrlP<CR>
" -----------------------------------------------------------------------------------------------
" doxygen config
" -----------------------------------------------------------------------------------------------
"let g:load_doxygen_syntax=1
" set spell
" set spelllang=en
" -----------------------------------------------------------------------------------------------
" Custom key mapping
" -----------------------------------------------------------------------------------------------
nnoremap bn :bn <CR>
nnoremap bp :bp <CR>
nnoremap bc :bd <CR>
nnoremap bd :bd <CR>
nnoremap tt :NERDTreeToggle <CR>
nmap <F8> :TagbarToggle<CR>
nnoremap tn :tabn <CR>
nnoremap tp :tabp <CR>
"nmap <silent> <A-Up> :wincmd k<CR>
"nmap <silent> <A-Down> :wincmd j<CR>
"nmap <silent> <A-Left> :wincmd h<CR>
"nmap <silent> <A-Right> :wincmd l<CR>options.permit_passwords
"--------------------------------------------------------------------------
" Vim functions
"--------------------------------------------------------------------------
fun! ShowFuncName()
let lnum = line(".")
let col = col(".")
echohl ModeMsg
echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW'))
echohl None
call search("\\%" . lnum . "l" . "\\%" . col . "c")
endfun
map f :call ShowFuncName() <CR>