-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
81 lines (64 loc) · 2.07 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
" Maintainer: Vincent Zhao
" Last change: 5/29/2018
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
endif
if &t_Co > 2 || has("gui_running")
" Switch on highlighting the last used search pattern.
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
if has('syntax') && has('eval')
packadd matchit
endif
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
" Powerline setup
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
set laststatus=2
set noshowmode
set t_Co=256
" Enable Pathogen
execute pathogen#infect()
" Set Ctrl-N to toggle NERD Tree
map <C-n> :NERDTreeToggle<CR>
" Enable filetype plugins
filetype plugin indent on
" Move backup, undo, and swap files
set undodir=~/.vim/.undo//
set backupdir=~/.vim/.backup//
set directory=~/.vim/.swp//
" Personal settings
set number
set ic
set smartcase
highlight LineNr ctermfg=lightblue ctermbg=black " Sets line number styling
set tabstop=4 shiftwidth=4 backspace=2 " Adjusts tab size and backspace behavior
set background=dark " Changes text color to stand out against dark backgrounds
syntax on
set mouse=a
set cc=110 " Add right margin
set ttimeoutlen=50 " Set keycode detection to 50ms for fast Esc response
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_global_ycm_extra_conf.py' " Set YCM C and C++ compile flags