-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
311 lines (255 loc) · 8.35 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
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 'tpope/vim-eunuch'
Plugin 'ycm-core/YouCompleteMe'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'scrooloose/nerdtree.git'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'scrooloose/syntastic.git'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'tpope/vim-surround'
Plugin 'vim-scripts/taglist.vim'
Bundle 'rstacruz/sparkup'
Plugin 'tComment'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'edkolev/tmuxline.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'michalliu/sourcebeautify.vim'
" Plugin 'klen/python-mode'
Plugin 'vim-scripts/Efficient-python-folding'
Plugin 'davidhalter/jedi-vim'
Plugin 'jmcantrell/vim-virtualenv'
Plugin 'joonty/vim-phpqa.git'
Plugin 'StanAngeloff/php.vim'
Plugin 'ekalinin/Dockerfile.vim'
" 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
" Anass Modifications <[email protected]>
" Airline font symboles
let g:airline_powerline_fonts = 1
" Enable mouse in VIM
set mouse=a
" Enable Clipboard
" you should use +clipboard or +xterm_clipboard enabled VIM (GVIM for example).
set clipboard=unnamedplus
" Reselect visual block after indent/outdent
vnoremap < <gv
vnoremap > >gv
" Easy split navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Force saving files which require root permission
cmap w!! %!sudo tee > /dev/null %
" automatically reload vimrc when it's saved
au BufWritePost .vimrc source ~/.vimrc
" Remap <leader> key
let mapleader = ","
" Quicksave command
noremap <C-Z> :update<CR>
vnoremap <C-Z> <C-C>:update<CR>
inoremap <C-Z> <C-O>:update<CR>
" Quick quit command
noremap <Leader>e :quit<CR> " Quit current window
noremap <Leader>E :qa<CR> " Quit all windows
" Quick Tab Moviing
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
" map sort function to a key
vnoremap <Leader>s :sort<CR>
" Show whitespace
" MUST be inserted before the colorescheme command
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
au InsertLeave * match ExtraWhitespace /\s\+$/
" Undo History
set history=700
set undolevels=700
" Undo works after restarting vim
if exists("+undofile")
" undofile - This allows you to use undos after exiting and restarting
" This, like swap and backups, uses .vim-undo first, then ~/.vim/undo
" :help undo-persistence
" This is only present in 7.3+
if isdirectory($HOME . '/.vim/undo') == 0
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
endif
set undodir=./.vim-undo//
set undodir+=~/.vim/undo//
set undofile
endif
" Set Numbers
set number
" Highlight text
syntax on
filetype plugin indent on
" Set default tab width and behavior
set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround
set smarttab
set expandtab
set smartindent
" Set tab width for Python, PHP, JS, and YML files
" au BufNewFile,BufRead *.py, *.php, *.js*, *.yml
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" Set default text width in screen then take a new line
set textwidth=79
" View the line number, column number and relative position as percentage
" In the right side of status line
set ruler
" Make line numbers relative to the current line
" set relativenumber
" Scroll through terminal lines faster
set ttyfast
" Automatically re-read the file if it's changed outside VIM
set autoread
" more-like listing per page
set more
" Highlight current line
set cursorline!
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Make Search ignore case-sensitive and smart
set ignorecase
set smartcase
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set matchtime=2
set laststatus=2
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
set wildignore+=*vim/backups*
set wildignore+=*sass-cache*
set wildignore+=*DS_Store*
set wildignore+=vendor/rails/**
set wildignore+=vendor/cache/**
set wildignore+=*.gem
set wildignore+=log/**
set wildignore+=tmp/**
set wildignore+=*.png,*.jpg,*.gif
set wildignore+=*node_modules*
set wildignore+=*_build/*
set wildignore+=*/coverage/*
set wildignore+=*.pyc,*.pyo
" Detect JSON
au BufRead,BufNewFile *.json setf json
" ======================================
" Third Party Plugins Settings
" ======================================
" YouCompleteMe Settings
" let g:ycm_key_list_select_completion = ['<TAB>', '<Down>', '<CR>']
let g:ycm_register_as_syntastic_checker = 1
let g:ycm_collect_identifiers_from_tags_files = 1
" let g:ycm_path_to_python_interpreter = '/usr/bin/python3'
" Trigger configuration of UltiSnips. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<c-t>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"
" Solarized custom options
set t_Co=256
let g:solarized_termcolors=256
let g:solarized_termtrans=1
set background=dark
colorscheme solarized
" Syntastic Recommended Settings
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 = 1
let g:syntastic_aggregate_errors = 1
let g:syntastic_python_checker_args = '--max-line-length=79'
" let g:syntastic_python_checkers = ['python', 'flake8', 'pep8', 'pylint']
" PYTHON 3 PATH - Switch when you work on it
" let g:syntastic_python_python_exec = '/home/anass/.virtualenvs/odoo11/bin/python3'
" ================================================
" Python Specific Plugin Settings
" ================================================
" Pyhton Mode Settings
" map <Leader>g :call RopoGotoDefinition()<CR>
" let ropevim_enable_shortcuts = 1
" let g:pymode_rope_goto_def_newein = "vnew"
" let g:pymode_rope_extended_complete = 1
" let g:pymode_breakpoint = 0
" let g:pymode_syntax = 1
" let g:pymode_syntax_builtin_objs = 0
" let g:pymode_syntax_builtin_funcs = 0
" let g:pymode_virtualenv = 1
" let g:pymode_motion = 1
" map <Leader>b Oimport ipdb; ipdb.set_trace() #BREAKPOINT<C-c>
" Virtualenv Integration
" if has("python") && !empty($VIRTUAL_ENV)
" python << EOF
" import os
" import sys
" a = os.environ['VIRTUAL_ENV'] + '/bin/activate_this.py'
" execfile(a, dict(__file__ = a))
" if 'PYTHONPATH' not in os.environ:
" os.environ['PYTHONPATH'] = ''
" os.environ['PYTHONPATH'] += os.getcwd()+":"
" os.environ['PYTHONPATH'] += ":".join(sys.path)
" EOF
" endif
" Odoo Integration
if has("python") && !empty($OPENERP_SERVER)
python <<EOF
try:
import openerp
openerp.tools.config.parse_config()
except ImportError:
pass
EOF
endif
" Settings for jedi-vim
let g:jedi#usages_command = "<leader>z"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
map <Leader>b Oimport pdb; pdb.set_trace() # BREAKPOINT<C-c>
map <Leader>i Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
" Python Folding
set nofoldenable