extract go snippets
This commit is contained in:
parent
095b5798f2
commit
83b74423da
2 changed files with 567 additions and 36 deletions
565
.vim/usnips/go.snippets
Normal file
565
.vim/usnips/go.snippets
Normal file
File diff suppressed because it is too large
Load diff
38
.vimrc
38
.vimrc
|
|
@ -249,41 +249,6 @@ syntax enable
|
||||||
"autocmd BufEnter * call ncm2#enable_for_buffer()
|
"autocmd BufEnter * call ncm2#enable_for_buffer()
|
||||||
|
|
||||||
|
|
||||||
" **** CoC bindings
|
|
||||||
"nmap <silent> gd <Plug>(coc-definition)
|
|
||||||
"nmap <silent> gy <Plug>(coc-type-definition)
|
|
||||||
"nmap <silent> gi <Plug>(coc-implementation)
|
|
||||||
"nmap <silent> gr <Plug>(coc-references)
|
|
||||||
"imap <Leader>l <Plug>(coc-codeaction)
|
|
||||||
"imap <Leader>, <Plug>(coc-snippets-expand)
|
|
||||||
"imap <Leader>ff <Plug>(coc-fix-current)
|
|
||||||
"nmap <Leader>ff <Plug>(coc-fix-current)
|
|
||||||
"" Use `[g` and `]g` to navigate diagnostics
|
|
||||||
"" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
|
||||||
"nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
|
||||||
"nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
|
||||||
|
|
||||||
"" Use K to show documentation in preview window
|
|
||||||
"nnoremap <silent> K :call <SID>show_documentation()<CR>
|
|
||||||
|
|
||||||
"function! s:show_documentation()
|
|
||||||
"if (index(['vim','help'], &filetype) >= 0)
|
|
||||||
"execute 'h '.expand('<cword>')
|
|
||||||
"else
|
|
||||||
"call CocAction('doHover')
|
|
||||||
"endif
|
|
||||||
"endfunction
|
|
||||||
|
|
||||||
|
|
||||||
" If you prefer the Omni-Completion tip window to close when a selection is
|
|
||||||
" made, these lines close it on movement in insert mode or when leaving
|
|
||||||
" insert mode
|
|
||||||
"autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
|
|
||||||
"autocmd InsertLeave * if pumvisible() == 0|pclose|endif
|
|
||||||
" inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
|
|
||||||
|
|
||||||
" **** End CoC
|
|
||||||
|
|
||||||
" **** Configure LSP
|
" **** Configure LSP
|
||||||
|
|
||||||
luafile $HOME/.vim/nvim.lua
|
luafile $HOME/.vim/nvim.lua
|
||||||
|
|
@ -294,7 +259,8 @@ nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||||
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||||
nnoremap <silent> gy <cmd>lua vim.lsp.buf.type_definition()<CR>
|
nnoremap <silent> gy <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||||
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||||
nnoremap <silent> gK <cmd>lua vim.lsp.buf.signature_help()<CR>
|
nnoremap <silent> gs <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||||
|
nnoremap <silent> gR <cmd>lua vim.lsp.buf.rename()<CR>
|
||||||
"nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
"nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||||
nnoremap <silent> gr <cmd>lua require('telescope.builtin').lsp_references({initial_mode = "normal"})<cr>
|
nnoremap <silent> gr <cmd>lua require('telescope.builtin').lsp_references({initial_mode = "normal"})<cr>
|
||||||
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue