/
.vimrc
206 lines (177 loc) · 5.18 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
"execute pathogen#infect()
let g:molokai_original = 1
let g:SimpylFold_docstring_preview=1
let g:ycm_autoclose_preview_window_after_completion=1
let g:nerdtree_tabs_open_on_console_startup = 1
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
let mapleader=","
"autocmd vimenter * NERDTree
map <C-n> :NERDTreeToggle<CR>
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" 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'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
"Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
"Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Bundle 'chase/vim-ansible-yaml'
"Plugin 'elixir-lang/vim-elixir'
" All of your Plugins must be added before the following line
call vundle#end() " required
"if has('gui_running')
" set background=dark
" colorscheme solarized
"else
" colorscheme zenburn
"endif
set guifont=Source\ Code\ Pro\ for\ Powerline "make sure to escape the spaces in the name properly
set splitright
set splitbelow
set clipboard=unnamed
"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
"au BufNewFile,BufRead *.py
" \ set tabstop=4
" \ set softtabstop=4
" \ set shiftwidth=4
" \ set textwidth=79
" \ set noexpandtab
" \ set autoindent
" \ set fileformat=unix
au BufNewFile *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
set encoding=UTF-8
"python with virtualenv support
"python << 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
" move upwards if tags not found
:se tags=tags,~/tags;/
" not working due to python indentation, commenting
"if (v:version >= 600)
" filetype plugin indent on
" nmap <F13> :call BE()<CR>
" highlight! link Folded StatusLine
"
" function BE()
" if ! exists('b:folding')
" syntax region myFold start='{' end='}' transparent fold
" syntax sync fromstart
" set foldmethod=syntax
" set foldlevel=1
" normal zR
" endif
" endfunction
"endif
set nocompatible " dont be compatible with vi-mode
set noautoindent
set backspace=2 " standardize on backspace key
set nobackup " backup is not necessary
set cinkeys-=o,O
set cinoptions+=:0g0
set comments+=nb:>
set cpoptions-=B
set noequalalways
"set expandtab
set guifont=ProggyCleanTT\ 12
set guioptions-=T
set hlsearch
set ignorecase
set incsearch
set infercase
set nojoinspaces
set laststatus=2
set list
set listchars=tab:>\ ,trail:+
set matchpairs+=<:>
set nrformats-=octal,hex
set scrolloff=1
set shiftround
set shiftwidth=4
set showcmd
set showmatch
set smartcase
"set smarttab
set softtabstop=4
set tabstop=4
set splitbelow
set statusline=%f\ %y%r%1*%m%*%=%<x%02B%4vv%4cc%7l\ %P
highlight! link User1 ErrorMsg
set timeoutlen=100
set title
set wildignore+=*.o,*.obj,*.cmi,*.cmo,*.cma,*.cmx,*.a,*.cmxa,*.rem
set wildignore+=*.aux,*.blg,*.dvi,*.log,*.pdf,*.ps
set nowritebackup
autocmd BufEnter * let &titlestring = hostname() . ':' . expand('%f')
autocmd FileType help nmap <C-m> <C-]>
autocmd FileType html setlocal indentkeys-=o,O,*<Return>,<>>,<bs>
autocmd FileType mail setlocal textwidth=76
autocmd FileType yaml syntax off
autocmd BufRead *.*html* setlocal filetype=html
autocmd BufRead *.css* setlocal filetype=css
"autocmd BufRead *.js* setlocal filetype=html
autocmd BufRead *.txt* setlocal textwidth=76
map ' :
noremap ,, \'
nmap Y y$
nmap <M-j> <C-w>w
nmap <M-k> <C-w>W
nmap <F1> :write<CR>
map! <F1> <C-v>u
nmap <F21> :write!<CR>
nmap <F2> :make<CR>
nmap <F22> :copen<CR><C-g>
nmap <F3> :shell<CR>
nmap <F4> :quit<CR>
nmap <F14> :qall<CR>
nmap <F5> :set hlsearch!<CR>
nmap <F15> :set ignorecase!<CR>
nmap <F16> :set makeprg=nn\ %<CR>
nmap <F17> :set makeprg=gg\ %<CR>
nmap <F8> <C-w>w
let python_highlight_all=1
syntax on
set synmaxcol=120
set secure
set t_co=256
" set iskeyword+=^_
map mn :tabnext<CR>
map mb :tabprev<CR>
set cursorline
set pastetoggle=<F7>
highlight CursorLine cterm=underline
highlight Visual cterm=reverse term=reverse
set tabstop=4
set noexpandtab
" zM : close all folds, zR : open all folds
set mouse=a " enable mouse
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
set tabpagemax=50