-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
97 lines (79 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
set number norelativenumber
set expandtab
set tabstop=2
autocmd FileType python setlocal tabstop=2
set softtabstop=2
set shiftwidth=2
set splitbelow
set splitright
set syntax=on
set lazyredraw
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]
let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0
set completeopt-=preview
set cursorline
set ignorecase
highlight CursorLine cterm=none ctermbg=237
highlight YcmErrorSection ctermbg=237
" Apply YCM FixIt
map <F9> :YcmCompleter FixIt<CR>
" CRTL-P
let g:ctrlp_working_path_mode = 'ra'
" CamelCase to snake_case
nnoremap _ :s#\(\<\u\l\+\<bar>\l\+\)\(\u\)#\l\1_\l\2#g<CR>
" NERDTree
nmap <silent> <F2> :NERDTreeToggle<CR>
nmap <silent> <F3> :NERDTreeFind<CR>
" clang format options
let g:clang_format#command = 'clang-format'
let g:clang_format#detect_style_file = 1
let g:clang_format#code_style = 'file'
autocmd FileType c,cpp setlocal equalprg=clang-format-6.0
" autocmd FileType c,cpp,objc map = <Plug>(operator-clang-format)
" disable auto folding for rvim plugin
set nofoldenable
let g:riv_fold_auto_update = 0
" RST Shortcuts for inserting code
" nnoremap <leader>c i:code:``<ESC>i
nnoremap <leader>C o<CR>.. code-block:: bash<CR><CR>
" Use Markdown compatible table corners
let g:table_mode_corner='|'
call plug#begin('~/.vim/plugged')
" Plug 'https://github.com/taketwo/vim-ros.git'
Plug 'https://github.com/gu-fan/riv.vim.git'
Plug 'https://github.com/jiangmiao/auto-pairs.git'
Plug 'https://github.com/Valloric/YouCompleteMe.git'
Plug 'https://github.com/rhysd/vim-clang-format.git'
Plug 'https://github.com/tpope/vim-surround.git'
Plug 'https://github.com/scrooloose/nerdtree.git'
Plug 'https://github.com/ctrlpvim/ctrlp.vim.git'
Plug 'https://github.com/kana/vim-operator-user.git'
Plug 'https://github.com/vim-scripts/DoxygenToolkit.vim'
Plug 'dhruvasagar/vim-table-mode'
call plug#end()
autocmd BufEnter * let &titlestring = ' %F'
set title
" temp fix for clang undo problem
function! SafeUndo()
let s:pos = getpos( '. ' )
let s:view = winsaveview()
undo
call setpos( '.', s:pos )
call winrestview( s:view )
endfunc
function! SafeRedo()
let s:pos = getpos( '.' )
let s:view = winsaveview()
redo
call setpos( '.', s:pos )
call winrestview( s:view )
endfunc
" nnoremap u :call SafeUndo() <CR>
" nnoremap <C-r> :call SafeRedo() <CR>
" VimDiff color scheme
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red