-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
84 lines (67 loc) · 1.41 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
set history=700
set nu
filetype plugin on
filetype indent on
set autoread
set wildignore=*.o,*~,*.pyc
set ruler
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" Linebreak at 72 characters
set lbr
set textwidth=72
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" Search options
set ignorecase
set smartcase
set hlsearch
set incsearch
set lazyredraw
set magic
set showmatch
set mat=2
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
syntax enable
set background=light
set encoding=utf8
set ffs=unix,dos,mac
" Turn backup off, code should be in a repo!
set nobackup
set nowb
set noswapfile
" Use spaces instead of tabs
set expandtab
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
map <space> /
map <c-space> ?
" Always show the status line
set laststatus=2
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
" Returns true if paste mode enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction
" Delete trailing white space on save
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS()
syntax enable
set background=light