-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
98 lines (80 loc) · 2.35 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
" Set up the Pathogen bundle manager.
let g:pathogen_disabled = ['vim-go']
call pathogen#infect()
call pathogen#helptags()
" Set minimal=1 in ~/.vimlocal to reduce CPU hit on low-spec systems.
let minimal = 0
" I've got fed up with autocomment lately; turning it off for now.
let g:autocomment_disabled = 1
" Source ~/.vimrclocal to allow per-system overrides.
if filereadable(expand("~/.vimlocal"))
source ~/.vimlocal
endif
" Color scheme
color molokai
:set t_Co=256
" Map ; to : to save the poor shift key.
nmap ; :
filetype on
filetype plugin on
filetype indent on
" Tweaks for coding.
syntax on
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
" Apparently necessary to make go-vim work.
syntax enable
filetype plugin on
" Don't expand tabs for makefiles.
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
" Strip trailing whitespace
fun! StripTrailingWhitespace()
" Only strip if the b:noStripeWhitespace variable isn't set
if exists('b:noStripWhitespace')
return
endif
%s/\s\+$//e
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
autocmd FileType markdown let b:noStripWhitespace=1
autocmd FileType asm set ft=nasm
" Show line numbers, with a black background.
if minimal != 1
set relativenumber
endif
highlight LineNr ctermfg=white ctermbg=bg guifg=white guibg=bg
" Fugitive status line
set laststatus=2
set statusline=%1*%{fugitive#statusline()}%*%=%2*%-20.(Column\ %c%)%*
"hi StatusLine ctermfg=bg guifg=bg
"hi User1 ctermfg=green guifg=green
"hi User2 ctermfg=white guifg=green
" ---- Airline config
" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'
" END airline config ---- "
" Syntastic config
let g:syntastic_check_on_open = 1
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_python_flake8_args ='--ignore="E501,E221,E241,E251"'
set <F12>=<C-v><F12>
map <F12> :SyntasticToggleMode<CR>
" Ctrl-p key remap
let g:ctrlp_map = '<c-p>'
nnoremap <leader>. :CtrlPTag<cr>
" ---- Buffer stuff:
set hidden
nmap <leader>t :enew<CR>
nmap <leader>l :bnext<CR>
nmap <leader>h :bprevious<CR>
nmap <leader>q :bp <BAR> bd #<CR>
nmap <leader>bl :ls<CR>
" END buffer stuff ----"
" Re-source ~/.vimlocal so it takes precedence over other config.
if filereadable(expand("~/.vimlocal"))
source ~/.vimlocal
endif