-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot-vimrc
139 lines (120 loc) · 3.66 KB
/
dot-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
set belloff=all
set number
set mouse=a
set nocompatible
set autoindent
set expandtab
set smarttab
set shiftwidth=2
set softtabstop=2
set incsearch
set hlsearch
set ignorecase
set smartcase
set confirm
set showcmd
set nostartofline
set ruler
set laststatus=2
set showtabline=1
set noshowmode
set statusline+=%F
set conceallevel=0
set directory=~/.vim/tmp
set ttymouse=sgr
set clipboard=unnamedplus
set shortmess=I
set mat=5
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
" coc-tsserver coc-json coc-html coc-css coc-pyright
" coc-git coc-cmake coc-highlight coc-tabnine
" coc-emoji coc-prettier coc-word coc-explorer coc-eslint
Plug 'vim-airline/vim-airline'
Plug 'chrisbra/csv.vim'
Plug 'google/vim-searchindex'
Plug 'airblade/vim-gitgutter'
" Generate code screenshots with :Silicon or :SiliconHighlight
Plug 'segeljakt/vim-silicon'
Plug 'fcpg/vim-farout'
Plug 'aklt/plantuml-syntax'
if has('nvim')
" Neovim specific commands
else
" Standard vim specific commands
endif
call plug#end()
set t_Co=256
set background=dark
set t_ut=
colorscheme farout
" CoC recommendations
set hidden
set cmdheight=2
set nobackup
set nowritebackup
set encoding=utf-8
set updatetime=300
set shortmess+=c
set signcolumn=yes
" :PlugInstall
" :PlugUpdate
" :PlugClean
" :PlugSnapshot
autocmd CursorHold * silent call CocActionAsync('highlight')
":nmap <space>e <Cmd>CocCommand explorer<CR>
":nmap <space>p <Cmd>CocCommand prettier.formatFile<CR>
":nmap <space>h <Cmd>call CocActionAsync('doHover')<CR>
":nmap <space>, <Plug>(coc-diagnostic-prev)
":nmap <space>. <Plug>(coc-diagnostic-next)
":nmap <space>d <Plug>(coc-definition)
":nmap <space>t <Plug>(coc-type-definition)
":nmap <space>i <Plug>(coc-implementation)
":nmap <space>r <Plug>(coc-references)
command! -nargs=0 Prettier :CocCommand prettier.formatFile
inoremap <silent><expr> <NUL> coc#refresh()
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
inoremap <silent><expr> <C-x><C-z> coc#pum#visible() ? coc#pum#stop() : "\<C-x>\<C-z>"
" remap for complete to use tab and <cr>
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1):
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
inoremap <silent><expr> <c-space> coc#refresh()
hi CocSearch ctermfg=12 guifg=#18A3FF
hi CocMenuSel ctermbg=109 guibg=#13354A
autocmd BufWritePre, *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.graphql,*.md,*.vue Prettier
let g:vim_json_syntax_conceal = 0
let g:airline_powerline_fonts = 1
syntax enable
filetype on
filetype plugin on
filetype indent on
filetype plugin indent on
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
autocmd Filetype c set ts=2 sw=2 expandtab
autocmd Filetype cpp set ts=2 sw=2 expandtab
autocmd Filetype gitcommit set spell textwidth=72
autocmd Filetype json set ts=2 sw=2 expandtab
autocmd Filetype python set ts=4 sw=4 expandtab textWidth=79
autocmd BufNewFile,BufRead *.hbs set syntax=html
autocmd BufNewFile,BufRead *.scss set syntax=css
" Highlight lines that exceed 120 characters in length
" execute "set cc=".join(range(81,300), ',')
hi ColorColumn cterm=bold ctermbg=233
hi SpellBad ctermbg=052
hi SpellCap ctermbg=052
hi SignColumn ctermbg=232
" No beeping
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
" Automatically render puml diagrams
" autocmd BufWritePost *.puml !plantuml -checkonly %:p && plantuml %:p && kitty +kitten icat "%:p:r.png"
" Italic comments
let &t_ZH="\e[3m"
let &t_ZR="\e[23m"
highlight Comment cterm=italic