-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
140 lines (113 loc) · 2.84 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
136
137
138
139
140
"插件管理
call plug#begin('~/.vim/plugged')
Plug 'Valloric/YouCompleteMe'
Plug 'morhetz/gruvbox'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'itchyny/lightline.vim'
Plug 'joshdick/onedark.vim'
Plug 'sheerun/vim-polyglot'
Plug 'nanotech/jellybeans.vim'
call plug#end()
"事件
autocmd TextChanged * silent! wa
autocmd InsertLeave * silent! wa
autocmd FileType * set fo-=c fo-=r fo-=o
"vim 设置相关
set encoding=utf-8
scriptencoding utf-8
set nocompatible
set fillchars=vert:\
set backspace=2
set number
set cursorline
"set cursorcolumn
set nospell
set clipboard=unnamed
set noexpandtab
set ignorecase
set incsearch
set nowrap
set nostartofline
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set scrolloff=3
set noshowmode
set laststatus=2
set nobackup
set noswapfile
set showcmd
set signcolumn=yes
set background=dark
set shortmess+=I
set termguicolors
set completeopt-=preview
set guicursor=
set mouse=a
set showtabline=0
set wildignore=*.o,*.obj,*.dll,*.exe,*.deb,*.png
"按键相关
inoremap jk <esc>
map <C-b> <Nop>
map <C-f> <Nop>
map t <Nop>
map T <Nop>
map W <Nop>
map B <Nop>
map E <Nop>
map P <Nop>
map H 0
map L $
map K <Nop>
map J <Nop>
map <C-h> <C-W>h
map <C-l> <C-W>l
map <C-j> <C-W>j
map <C-k> <C-W>k
map U <C-u>
map D <C-d>
nmap ; :
vmap ; :
nnoremap <F2> :YcmCompleter GoToDefinition<CR>
nnoremap <F4> :YcmCompleter GoToDeclaration<CR>
map <leader>f :pyf /usr/local/Cellar/clang-format/2017-03-17/share/clang/clang-format.py<cr>
imap <leader>f :pyf /usr/local/Cellar/clang-format/2017-03-17/share/clang/clang-format.py<cr>
map . <Plug>Sneak_;
map , <Plug>Sneak_,
"界面相关
colorscheme gruvbox
"highlight NonText cterm=NONE ctermbg=bg ctermfg=bg guibg=NONE guifg=NONE
"highlight VertSplit ctermbg=bg ctermfg=DarkGrey
"highlight CursorLine ctermbg=235
highlight EndOfBuffer ctermfg=bg guifg=bg
highlight CursorLineNr ctermbg=bg guibg=bg
set guifont=Monaco:h13
"插件设置
let g:ctrlp_map = 'P'
let g:ctrlp_working_path_mode = '0'
let g:ctrlp_types = ['fil']
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll|deb|png|jpg)$'
\ }
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
let g:ycm_show_diagnostics_ui = 1
let g:ycm_complete_in_strings = 1
let g:ycm_complete_in_comments = 0
let g:ycm_enable_diagnostic_highlighting = 0
let g:ycm_confirm_extra_conf=0
let g:ycm_use_ultisnips_completer = 0
let g:ycm_key_invoke_completion = '<leader>c'
let g:sneak#use_ic_scs = 1
let g:lightline = {
\ 'colorscheme': 'onedark',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'absolutepath' ] ],
\ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'inactive': {
\ 'left': [ [ 'mode', 'paste' ], [ 'absolutepath' ] ],
\ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ }