forked from matthewmccullough/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
269 lines (227 loc) · 6.87 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
" vimrc
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 'gmarik/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
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)
"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'}
" Airline
Plugin 'bling/vim-airline'
" Airline Config
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
" NerdTree
Plugin 'scrooloose/nerdtree'
" Autoload NerdTree
autocmd VimEnter * NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:sdt_in") | NERDTree | endif
autocmd VimEnter * wincmd p
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let g:NERDTreeWinPos = "left"
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
"
"let g:nerdtree_tabs_open_on_console_startup=1
"map <F2> <Esc>:NERDTreeTabsOpen<CR>
"map <F3> <Esc>:NERDTreeTabsClose<CR>
map <C-b> :NERDTreeToggle<CR> "CTRL+b to NERDTree
" Syntastic
Plugin 'scrooloose/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
"Vim-colors-solarized
Plugin 'altercation/vim-colors-solarized'
Plugin 'jnurmine/Zenburn'
" AutoClose
Plugin 'AutoClose'
" Ctrlp
Plugin 'kien/ctrlp.vim'
" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
"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
nnoremap <leader>. :CtrlPTag<cr>
" TagList
Plugin 'taglist.vim'
" ShowFunc
Plugin 'ShowFunc.vim'
" Ansible plugins
Plugin 'chase/vim-ansible-yaml'
" Manage NERDTree tab
Plugin 'jistr/vim-nerdtree-tabs'
" Bettre Number
Plugin 'myusuf3/numbers.vim'
" Zoom Management
"Plugin 'ZoomWin'
" Window manager
"Plugin 'spolu/dwm.vim'
" Indent Guide
Plugin 'nathanaelkane/vim-indent-guides'
" Other Indent
Plugin 'yggdroot/indentLine'
" Identline
let g:indentLine_enabled = 0
"let g:indentLine_char = '︙'
" Vim webdevicons
Plugin 'ryanoasis/vim-webdevicons'
Plugin 'Xuyuanp/nerdtree-git-plugin'
" PowerShell
Plugin 'PProvost/vim-ps1'
Plugin 'tmhedberg/SimpylFold'
let g:SimpyFold_docstring_preview=1
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe'
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
Plugin 'nvie/vim-flake8'
" 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
" Enable Airline
set laststatus=2
syntax enable
" Theme
set background=dark
let g:solarized_termcolors=256
let g:solarized_visibility="high"
let g:solarized_contrast="high"
"if has('gui_running')
"set background=dark
colorscheme solarized
"else
"colorscheme Zenburn
"endif
"call togglebg#map("<F5>")
" Tab Navigation
map <S-LEFT> <Esc>:tabprevious<CR>
map <S-RIGHT> <Esc>:tabnext<CR>
" Enable/disable mouse integration
" Variable d'enregistrement de l'état de la gestion de la souris
let s:mouseActivation = 1
" Fonction permettant l'activation/désactivation de la gestion de la souris
function! ToggleMouseActivation()
if (s:mouseActivation)
let s:mouseActivation = 0
set mouse=n
set paste
else
let s:mouseActivation = 1
set mouse=a
set nopaste
endif
endfunction
map <F6> <Esc>:call ToggleMouseActivation()<CR>
" Auto indent
set autoindent
set smartindent
" Tabs definition
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
" Print line number
set number
set clipboard=unnamed
set helplang=fr
set hlsearch "high light search.
set mouse=a "Mouse
set nopaste
set ruler " line/col... CTRL+g
set termencoding=utf-8 " force encoding pour le terminal
set encoding=utf8
set ofu=syntaxcomplete#Complete "Utilisation de la complexion OFU pour tout
set splitbelow
set splitright
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
"nnoremap <silent> <leader>b :TagbarToggle<CR>
map <F7> <Plug>ShowFunc
map! <F7> <Plug>ShowFunc
map <F8> <Esc>:TlistToggle<CR>
" Better Number
nnoremap <F4> :NumbersToggle<CR>
nnoremap <F5> :NumbersOnOff<CR>
" Ident Guide
"let g:indent_guides_auto_colors = 0
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=black
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=darkgrey
" Enable modeline
set modeline
" PEP8 Indentation
"u BufNewFile,BufRead *.py
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" \ set textwidth=79
" \ set expandtab
" \ set autoindent
" \ set fileformat=unix
"
"u BufNewFile,BufRead *.js, *.html, *.css
" \ set tabstop=2
" \ set softtabstop=2
" \ set shiftwidth=2
"
" Flagging Unnecessary Whitespace
"u BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
"python with virtualenv support
py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
let python_highlight_all=1