-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
104 lines (79 loc) · 1.92 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
" ===============================================
"
" .vimrc
"
"
" ================================================
filetype on
filetype plugin on
filetype indent on
syntax on
set background=dark
colorscheme solarized
" Automatically update files when externally modified
set autoread
" Automatically break lines after 72 characters when writing
au BufRead /tmp/mutt-* set tw=72
" Otherwise break 78 characters
set tw=78
"set colorcolumn=+1
"hi ColorColumn ctermbg=darkgray
" When vimrc is edited, reload it
"autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc
" Writing to a file as su.
cmap w!! %!sudo tee > /dev/null %
set nocompatible
set number
set showcmd
set incsearch
set wildignore=*.o,*.obj,*.bak,*.exe
set wildmode=longest,list
" Disable the arrow keys:
inoremap <Left> <NOP>
inoremap <Right> <NOP>
inoremap <Up> <NOP>
inoremap <Down> <NOP>
" Disable backup et. al.
set nobackup
set nowb
set noswapfile
"Persistent undo
set undofile
set undodir=$HOME/.vim/undo
"Pathogen
call pathogen#infect()
call pathogen#helptags()
"========================================
" Appereance
"========================================
set enc=utf-8
set fillchars=vert:\
" Highlight trailing whitespace
hi ExtraWhitespace ctermbg=red
match ExtraWhitespace /\s\+$/
" Always show the statusline
set laststatus=2
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
set cursorline
"========================================
" Keybindings
"========================================
" Remove trailing whitespace
map <Leader>w :%s/\s\+$<CR>
" Toggle spelling
map <Leader>s :set invspell<CR>
map <F2> :NERDTreeToggle<CR>
map <F3> :TlistToggle<CR>
" Save and make
map <F7> :w<CR>:make <CR>
map <F9> :cprev<CR>
map <F10> :cnext<CR>
map <F11> :clist<CR>
"========================================
" Tabs and indention
"========================================
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent