-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·195 lines (148 loc) · 4.21 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
" Vundle
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 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
" git interface
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/Pydiction'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
" Python snytax checker
Plugin 'nvie/vim-flake8'
" Auto-completion
Plugin 'Valloric/YouCompleteMe'
Plugin 'klen/rope-vim'
" Plugin 'ervandew/supertab'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
" Commenting
Plugin 'scrooloose/nerdcommenter'
" Surround
Plugin 'tpope/vim-surround'
" colors
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
" latex
Plugin 'lervag/vimtex'
" tabularize
Plugin 'godlygeek/tabular'
call vundle#end()
" Display line numbers
set number
" au WinEnter * setlocal number
" au WinLeave * setlocal nonumber
" Highlight last column
set colorcolumn=80
set tabstop=4
set softtabstop=4
set shiftwidth=4
" Improve the display of warped lines
set showbreak=↪
" Indentation
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
" au BufNewFile,BufRead *.js, *.html, *.css, *.tex, *.bib
" \ set tabstop=4 |
" \ set softtabstop=4 |
" \ set shiftwidth=4 |
" Use the below highlight group when displaying bad whitespace is desired.
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad.
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Make trailing whitespace be flagged as bad.
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Wrap text after a certain number of characters
au BufRead,BufNewFile *.py,*.pyw, set textwidth=100
" Options for YouCompleteMe
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
let python_highlight_all=1
syntax on
" Colorschemes
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
" Change background using F5 key
call togglebg#map("<F5>")
" Hide .pyc files in NERDTree list
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
" Always display the tabline, even if there is only one tab
set showtabline=4
" Hide the default mode text (e.g. -- INSERT -- below the statusline)
set noshowmode
" Search options
set incsearch
set hlsearch
" Search keyword blinks
" function! HLNext (blinktime)
" let [bufnum, lnum, col, off] = getpos('.')
set ignorecase
" Highlight machting braces
set showmatch
" Easier navigation for split windows
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>
" Open new splits to the right and bottom
set splitbelow
set splitright
" 256 Colors
set t_Co=256
if &t_Co != 256 && ! has("gui_running")
echomsg ""
echomsg "err: please use GUI or a 256-color terminal (so that t_Co=256 could be set)"
echomsg ""
finish
endif
" Font encoding
set encoding=utf-8
" Higlight cursor line
set cursorline
" enable mouse because why not
if has('mouse')
set mouse=a
endif
" Hide mouse pointer while typing
" set mousehide
" Disable updating display while executing the macros
set lazyredraw
" Don't show the current command in the lower right corner. In OSX, if this is
" set and lazyredraw is set then it's slow as molasses, so we unset this
"set showcmd
" Latex indentation
let g:tex_flavor='latex'
" Line at the end of the column
" Re-map semicolon
nnoremap ; :
nnoremap : ;
" Use system clipboard
set clipboard=unnamed
" no swap files
set noswapfile