-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
108 lines (87 loc) · 3.18 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
call plug#begin('~/.vim/plugged')
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'rust-lang/rust.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'suy/vim-context-commentstring'
Plug 'peitalin/vim-jsx-typescript'
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'neoclide/coc-tsserver', { 'do': 'yarn install --frozen-lockfile' }
Plug 'neoclide/coc-eslint'
Plug 'yaegassy/coc-volar', { 'do': 'yarn install --frozen-lockfile' }
Plug 'posva/vim-vue'
Plug 'nvim-lua/plenary.nvim'
Plug 'lewis6991/gitsigns.nvim'
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npm install' }
call plug#end()
let g:prettier#autoformat = 0
set clipboard=unnamedplus
:set autochdir
set number
set smartindent
set mouse=a
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set ruler
syntax on
filetype plugin indent on
let g:lightline = {'colorscheme': 'tokio'}
let g:coc_global_extensions = [ 'coc-eslint','coc-tsserver', 'coc-prettier' ]
nmap <leader>qf <Plug>(coc-fix-current)
nmap <leader>ac <Plug>(coc-codeaction)
nmap <silent>gd <Plug>(coc-definition)
nmap <silent>gy <Plug>(coc-type-definition)
nmap <silent>gi <Plug>(cocimplementation)
nmap <silent>gr <Plug>(coc-references)
nmap <F2> <Plug>(coc-rename)
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
nmap <silent>fo :Files<CR>
nmap <silent>ff :Rg<CR>
nmap <silent>fb :Buffers<CR>
nmap <silent>ts :tab split<CR>
set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50\,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor\,sm:block-blinkwait175-blinkoff150-blinkon175
" https://github.com/neoclide/coc.nvim/issues/869#issuecomment-501323697
nnoremap <silent>K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocActionAsync('doHover')
endif
endfunction
autocmd CursorHold * silent call CocActionAsync('highlight')
function! SyntaxItem()
return synIDattr(synID(line("."),col(".")1),"name")
endfunction
function GetClock()
return strftime('%H:%M')
endfunction
set termguicolors
set noshowmode
hi CocFloating guibg=#232530
hi Statement gui=NONE
"let s:palette = g:lightline#colorscheme#horizon#palette
"let s:palette.tabline.left = [['#6c6f93', '#1c1e26', 242, 233]]
"let s:palette.tabline.tabsel = [['#09f7a0', '2e303e', 209, 235, 'bold']]
" call timer_start(1000, {->execute('redrawstatus')}, {'repeat': -1})
" Go to last active tab
au TabLeave * let g:lasttab = tabpagenr()
nnoremap <silent>gb :exe "tabn ".g:lasttab<cr>
vnoremap <silent>gb :exe "tabn ".g:lasttab<cr>
" force load of context/commentstring.vim and set vue_typescript
:runtime autoload/context/commentstring.vim
let g:context#commentstring#table['vue']['vue_typescript'] = '// %s'
" Use <Tab> and <S-Tab> to navigate the completion list:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>",
inoremap <silent><expr> <TAB> pumvisible() ? coc#select_confirm() : "\<C-g>u\<TAB>"