-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
133 lines (111 loc) · 3.17 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
"Keep this to prevent from possible system bugs
set nocompatible
"Vundle settings
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'easymotion/vim-easymotion'
"Plugin 'chriskempson/base16-vim'
source ~/.vim/vim-dev-lang/vimrc.plugin
call vundle#end()
filetype plugin indent on
"Leader key
let mapleader = ","
"UTF8 support
set encoding=utf-8
"Syntax
"colorscheme Tomorrow-Night
set background=light
set laststatus=2
set nonu
set ruler
set cursorline
set cursorcolumn
"colorscheme base16-default-dark
syntax on
"let base16colorspace=256
"Search
set smartcase
set showmatch
set hlsearch
set incsearch
"Indent
set tabstop=2
set shiftwidth=2
set expandtab
"Keyboard control
set backspace=2
set scrolloff=5
"split window control
set splitbelow
set splitright
"Key maps
" - navigate
nnoremap <C-H> gT
nnoremap <C-L> gt
nnoremap ; :nohlsearch<CR>
nnoremap 00 <C-$>
" - mode switch
inoremap jk <Esc>
" - copy to clipboard
vnoremap cy "+y
" - comment
autocmd FileType c,cpp,java,javascript,scala,glsl,comp let b:comment_leader = '// '
autocmd FileType scss,sass let b:comment_leader = '// '
autocmd FileType sh,ruby,python let b:comment_leader = '# '
autocmd FileType conf,fstab let b:comment_leader = '# '
autocmd FileType dockerfile let b:comment_leader = '# '
autocmd FileType yaml let b:comment_leader = '# '
autocmd FileType tex let b:comment_leader = '% '
autocmd FileType mail let b:comment_leader = '> '
autocmd FileType vim let b:comment_leader = '" '
noremap <silent> ,cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>
"NERDTree
let NERDTreeChDirMode=1
let NERDTreeIgnore=['\.pyc$', '\.swp$']
let NERDTreeQuitOnOpen=1
let NERDTreeMinimalUI=1
let NERDTreeShowBookmarks=1
let NERDTreeShowHidden=1
map <C-n> :NERDTreeToggle<CR>
"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 = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++17 -stdlib=libc++'
let g:syntastic_cpp_checkers = []
let g:syntastic_c_checkers = []
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': ['py'],
\ 'passive_filetypes': ['java', 'cpp'] }
"Markdown
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_new_list_item_indent = 2
let g:vim_markdown_math = 1
"GitGutter
set updatetime=250
"Backup
set backup
set backupdir=/tmp
set directory=/tmp
"Font
set guifont=Sauce\ Code\ Pro\ Powerline:h18
"Lightline
source ~/.vim/.lightline.vim
"Language specific
source ~/.vim/vim-dev-lang/vimrc
"GLSL
au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
" if isdirectory("/Users/brucechou/projects/mediapipe_ios")
" set path+=/Users/brucechou/projects/mediapipe_ios
" endif