-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
72 lines (57 loc) · 1.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
call pathogen#infect()
syntax on " syntax highlighing
set background=dark " adapt colors for background
colorscheme molokai
set nocompatible " use vim defaults
set number
set expandtab
set ts=2
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set numberwidth=4 " line numbering takes up 5 spaces
set shiftwidth=2 " numbers of spaces to (auto)indent
set title
set hlsearch " highlight searches
set incsearch " do incremental searching
set ignorecase
set smartindent
set sm
set wildignore=*.o,*.obj,*.bak,*.exe,*.pyc,*.png,*.jpg,*.gif,*.DS_Store,*.egg-info/**,*.db,**/_build/**,**/external/**,**/CACHE/**,**/node_modules/**,**/bower_components/**,**/build/**,*.tar.gz,*.tar.bz2
let g:syntastic_python_flake8_args="--ignore=E501"
" make it possible to easily create new files in the same directories as
" " existing files
cabbr <expr> %% expand('%:p:h')
if &term =~ "xterm"
"256 color --
let &t_Co=256
" restore screen after quitting
" set t_ti=ESC7ESC[rESC[?47h t_te=ESC[?47lESC8
if has("terminfo")
let &t_Sf="\ESC[3%p1%dm"
let &t_Sb="\ESC[4%p1%dm"
else
let &t_Sf="\ESC[3%dm"
let &t_Sb="\ESC[4%dm"
endif
endif
" Commands
let mapleader = ","
nmap <silent> <leader>* :nohl<cr>
nnoremap <leader>s :%s/\<<C-r><C-w>\>//g<Left><Left>
nmap <leader>p :CtrlP<cr>
nmap <leader>b :CtrlPBuffer<cr>
nmap <leader>w :w<cr>
nnoremap <leader><leader> <c-^>
" Splits
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>
set splitbelow
set splitright
" highlight trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()