-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
168 lines (140 loc) · 4.56 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
set nocompatible " 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'
Plugin 'klen/python-mode.git'
Plugin 'maksimr/vim-jsbeautify'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'nvie/vim-flake8'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Bundle 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'kien/rainbow_parentheses.vim'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Set Python beautiful script
let python_highlight_all=1
syntax on
" Set Encoding
set encoding=utf-8
set nu
" Auto reload .vimrc file
autocmd! bufwritepost .vimrc source %
" Enable folding
set foldmethod=indent
set foldlevel=99
syntax enable
" Colors
set background=dark
colorscheme solarized
let g:solarized_termcolors=256
" Pymode customization
let g:pymode=1
let g:pymode_rope=0
let g:pymode_syntax=1
let g:pymode_syntax_all=0
let g:pymode_lint_ignore='W0401, W0611'
let g:pymode_lint_sort=['E', 'C', 'I']
let g:pymode_rope_lookup_project=0
" Parathesis awesomeness
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound "()
au Syntax * RainbowParenthesesLoadSquare "()
au Syntax * RainbowParenthesesLoadBraces "()
au Syntax * RainbowParenthesesLoadChevrons "()
autocmd FileType javascript noremap <buffer> <c-f> :call JsBeautify()<cr>
" for json
autocmd FileType json noremap <buffer> <c-f> :call JsonBeautify()<cr>
"" for jsx
autocmd FileType jsx noremap <buffer> <c-f> :call JsxBeautify()<cr>
" for html
autocmd FileType html noremap <buffer> <c-f> :call HtmlBeautify()<cr>
" for css or scss
autocmd FileType css noremap <buffer> <c-f> :call CSSBeautify()<cr>
" Leader map
let mapleader=" "
" tabfix
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set nowrap
set cindent
set ruler
set wildmenu
" Python Indentations
" au BufNewFile,BufRead *.py
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" \ set textwidth=79
" \ set expandtab
" \ set autoindent
" \ set fileformat=unix
" Highlight unwanted white spaces
" au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Configuring Auto Complete plugin
" let g:ycm_autoclose_preview_window_after_completion=1
" map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"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
" Setting up nerd tree
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
" Activate and configure powerline
" call vam#ActivateAddons(['powerline'])
" python from powerline.vim import setup as powerline_setup
" python powerline_setup()
" python del powerline_setup
set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256
" colours)
" colorscheme zenburn
set t_Co=256
"Color schemes for vim
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
call togglebg#map("<F5>")
" Configuring autocomplete
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
" let g:ycm_key_list_select_completion=[]
" let g:ycm_key_list_previous_completion=[]
" Configuring autocomplete
" autocmd FileType python set omnifunc=pythoncomplete#Complete
" autocmd FileType python set noexpandtab
" autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
" autocmd FileType css set omnifunc=csscomplete#CompleteCSS
" autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
" autocmd FileType php set omnifunc=phpcomplete#CompletePHP
" autocmd FileType c set omnifunc=ccomplete#Complete
" au BufRead *.less set filetype=css
" Window pane shortcuts
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l