-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
80 lines (62 loc) · 1.68 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
syntax on
filetype plugin indent on
set hlsearch
set incsearch
set ic
set showmatch
set nowrap
set nobackup
set nowritebackup
set noswapfile
set ai
set nosi
set noci
set tabstop=4
let &shiftwidth = &tabstop
let &softtabstop = &tabstop
set et
" Got tired of vim wrapping, but I still want the colorcolumn.
"let &textwidth=110
map <Space> <PageDown>
map <Backspace> <PageUp>
set ruler
let mapleader = ","
hi ColorColumn guibg=#444444
hi ColorColumn ctermbg=7
" Toggle colorcolumn
function! ToggleColorColumn()
if &colorcolumn == 0
" Draw the color column wherever textwidth is set
let &colorcolumn = 120 "&textwidth
else
let &colorcolumn = 0
endif
endfunction
command! ToggleColorColumn call ToggleColorColumn()
noremap <leader>l :ToggleColorColumn<cr>
let &colorcolumn = 120 "&textwidth
" Show trailing whitespace
hi TrailingWhitespace guibg=#CCCCCC
hi TrailingWhitespace ctermbg=1
match TrailingWhitespace /\s\+$/
autocmd BufWinEnter * match TrailingWhitespace /\s\+$/
autocmd InsertEnter * match TrailingWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match TrailingWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
function! StripTrailingWhitespace()
%s/\s\+$//
endfunction
command! StripTrailingWhitespace call StripTrailingWhitespace()
noremap <leader>w :StripTrailingWhitespace<cr>
set path=.,**
set wildmenu
set wildignore+=*.class,*.pyc
" This needs vim7.4 (or at least some high version of 7.3)
set wildignorecase
" Backspace over whitespace intelligently
set backspace=indent,eol,start
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
" Don't double indent for python
let g:pyindent_open_paren=shiftwidth()