/
.vimrc
136 lines (102 loc) · 2.79 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
" Disable vi compatibility (emulation of old bugs)
set nocompatible
filetype off
" Set the runtime path to include Vundle and initialize
set rtp+=/home/james/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
Plugin 'vim-airline/vim-airline'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'Shougo/unite.vim'
Plugin 'scrooloose/syntastic'
Plugin 'airblade/vim-gitgutter'
Plugin 'edkolev/tmuxline.vim'
Plugin 'vim-ctrlspace/vim-ctrlspace'
Plugin 'majutsushi/tagbar'
call vundle#end()
filetype plugin indent on
" Set airline variables
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#left_sep=''
let g:airline#extensions#tabline#right_sep=''
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline_left_alt_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols_branch = ''
let g:airline_symbols_readonly = ''
let g:airline_symbols_linenr = ''
" Set syntastic variables
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=1
" Set ctrlspace variables
set hidden
" Set UTF-8 Encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Allow backspacing
" Set UTF-8 Encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" Allow backspacing
set backspace=indent,eol,start
" Use indentation of previous line
set autoindent
" Use intelligent indentation for C(++)
set smartindent
" Configure tabwidth and insert spaces instead of tabs
set tabstop=4
set shiftwidth=4
set expandtab
" Wrap lines at 120 characters
set textwidth=120
" Turn syntax highlighting on
set t_Co=256
syntax on
" Set colorscheme and dark mode
colorscheme gruvbox
set background=dark
" Turn line relative line numbering on
set number
set rnu
" Highlight matching braces
set showmatch
" Highlight while searching
set incsearch
" Set scrolloff
set scrolloff=999
" Set autoread
set autoread
" Set the status bar and ruler
set laststatus=2
set ruler
set wildmenu
" Intelligent comments
set comments=sl:/*,mb:\*,elx:\*/
" In normal mode, F2 will save the file
nmap <F2> :w<CR>
" In insert mode, F2 will exit insert, save, re-enter insert
imap <F2> <ESC>:w<CR>i
" Switch between header and source files with F4
nnoremap <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
" Recreate tags file with F5
" map <F5> :!ctags -R -c++-kinds=+p -fields=+iaS -extra=+q .<CR>
" Create doxygen comment with F6
" map <F6> :Dox<CR>
" Build using makeprg with F7
" map <F7> :make<CR>
" Build using makeprg with Shift + F7
" map <S-F7> :make clean all<CR>
" Open tagbar with F8
nmap <F8> :TagbarToggle<CR>
" Goto definition with F12
" map <F12> <C-J>