call plug#begin('~/.vim/plugged') Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'scrooloose/nerdtree' Plug 'fatih/vim-go' Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} call plug#end() set noeb vb t_vb= let mapleader = ',' let g:go_def_mode='gopls' let g:go_info_mode='gopls' set colorcolumn=160 set number relativenumber set nu rnu set tabstop=4 set shiftwidth=0 set softtabstop=-1 set expandtab set autoindent set cursorline syntax enable nnoremap :noh " autocmd vimenter * NERDTree " ------------------------------------------------------------------------------------------------- " coc.nvim default settings " ------------------------------------------------------------------------------------------------- " if hidden is not set, TextEdit might fail. set hidden " Better display for messages set cmdheight=2 " Smaller updatetime for CursorHold & CursorHoldI set updatetime=300 " don't give |ins-completion-menu| messages. set shortmess+=c " always show signcolumns set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. " Use command ':verbose imap ' to make sure tab is not mapped by other plugin. inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. inoremap coc#refresh() " Use `[c` and `]c` to navigate diagnostics nmap [c (coc-diagnostic-prev) nmap ]c (coc-diagnostic-next) " Remap keys for gotos nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use U to show documentation in preview window nnoremap U :call show_documentation() " Remap for rename current word nmap rn (coc-rename) " Remap for format selected region vmap f (coc-format-selected) nmap f (coc-format-selected) " Show all diagnostics nnoremap u :CocList diagnostics " Manage extensions nnoremap e :CocList extensions " Show commands nnoremap c :CocList commands " Find symbol of current document nnoremap o :CocList outline " Search workspace symbols nnoremap s :CocList -I symbols " Do default action for next item. nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list nnoremap p :CocListResume " disable vim-go :GoDef short cut (gd) " this is handled by LanguageClient [LC] let g:go_def_mapping_enabled = 0