-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
109 lines (85 loc) · 2.4 KB
/
Copy pathvimrc
File metadata and controls
109 lines (85 loc) · 2.4 KB
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
call plug#begin('$HOME/.vim/plugged')
Plug 'ryanoasis/vim-devicons'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-airline/vim-airline'
Plug 'tomasiser/vim-code-dark'
Plug 'liuchengxu/vista.vim'
Plug 'jackguo380/vim-lsp-cxx-highlight'
call plug#end()
syntax on
set autoindent
set cindent
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set cmdheight=2
set updatetime=300
colorscheme codedark
let s:uname = "unknown"
if has("unix")
let s:uname = system("uname -s")
endif
if s:uname == "Darwin\n"
set backspace=indent,eol,start
set clipboard=unnamed
elseif s:uname == "Linux\n"
set clipboard=unnamedplus
endif
" coc.nvim configurations
let g:coc_global_extensions = [
\'coc-clangd',
\'coc-pairs',
\'coc-lists',
\'coc-highlight',
\'coc-pyright',
\'coc-json'
\]
set hidden
set shortmess+=c
if has("patch-8.1.1564")
set signcolumn=number
else
set signcolumn=yes
endif
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <silent><expr> <c-@> coc#refresh()
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim', 'help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
autocmd CursorHold * silent call CocActionAsync('highlight')
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
nmap <leader>rn <Plug>(coc-rename)
set tagfunc=CocTagFunc
" vista.vim
let g:vista_default_executive = 'coc'
" vim-airline
let g:airline_theme = 'codedark'
"vim-lsp-cxx-highlight
let g:lsp_cxx_hl_use_text_props = 1
filetype plugin indent on