-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
99 lines (87 loc) · 2.09 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
" Joe's .vimrc
"================
set nocompatible
filetype indent plugin on
" Vundle Plugins
" ===============
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'Junegunn/Goyo.vim'
Plugin 'Scrooloose/Nerdtree'
Plugin 'scrooloose/vim-statline'
"Plugin 'Vim-syntastic/Syntastic'
Plugin 'majutsushi/tagbar'
call vundle#end()
" Syntastic
" ===============
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" A line to make YCM and Syntastics work
" together on C/C++/ObjC language files:
let g:ycm_show_diagnostics_ui = 0
" Plugin Usage
" ===============
map <C-n> :NERDTreeToggle<CR>
map <F8> :TagbarToggle<CR>
" Colors
"================
colorscheme mydante
syntax on
" Tabs and spaces
"================
set tabstop=4
set expandtab
"" But TABs are needed in Makefiles
au BufNewFile,BufReadPost Makefile se noexpandtab
"au FileType java se tabstop=2
"au FileType java se noexpandtab
" UI
"================
set number
set omnifunc=syntaxcomplete#Complete
set sw=2
"" Cycle through proposals with tab
set wildmenu
set showmatch
"" Search while entering
set incsearch
set hlsearch
set foldenable
set foldlevelstart=20
set foldmethod=indent
set showmode
set gfn=Hack\ 10
"" Disable opaque background
hi Normal guibg=NONE ctermbg=NONE
" Usage
"================
"" Toggle between .h and .cpp with F4.
function! ToggleBetweenHeaderAndSourceFile()
let bufname = bufname("%")
let ext = fnamemodify(bufname, ":e")
if ext == "h"
let ext = "cpp"
elseif ext == "cpp"
let ext = "h"
else
return
endif
let bufname_new = fnamemodify(bufname, ":r") . "." . ext
let bufname_alt = bufname("#")
if bufname_new == bufname_alt
execute ":e#"
else
execute ":e " . bufname_new
endif
endfunction
"" Key mappings
map <silent> <F4> :call ToggleBetweenHeaderAndSourceFile()<CR>
"" Keep the horizontal cursor position when moving vertically.
set nostartofline