" some things do not work perfectly yet " I have to take a look at the bindings " MOSTLY, it works " but startup takes ages (>1s) " one more thing needs to be done for clever coc linting/fixing: " create a file called coc-settings.json in nvim config dir with the " following content: " "{ " // Require .prettierrc " "prettier.requireConfig": true, " // Tslint on save " "tslint.enable": true, " "tslint.autoFixOnSave": true, " // Run prettier (and others) " "coc.preferences.formatOnSaveFiletypes": [ " "css", " "markdown", " "Markdown", " "javascript", " "javascriptreact", " "typescript", " "typescriptreact" " ] "} Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}, 'on': [], 'for': []} Plug 'neoclide/coc-snippets', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-prettier', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-tslint', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile'} " Plug 'neoclide/coc-highlight', {'do': 'yarn install --frozen-lockfile'} " color highlighting Plug 'neoclide/coc-json', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-yaml', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-rls', {'do': 'yarn install --frozen-lockfile'} Plug 'neoclide/coc-git', {'do': 'yarn install --frozen-lockfile'} Plug 'fannheyward/coc-rust-analyzer', {'do': 'yarn install --frozen-lockfile'} Plug 'fannheyward/coc-markdownlint', {'do': 'yarn install --frozen-lockfile'} Plug 'fannheyward/coc-texlab', {'do': 'yarn install --frozen-lockfile'} Plug 'iamcco/coc-vimlsp', {'do': 'yarn install --frozen-lockfile'} " lazy loading since they require a lot of startup time augroup load_ide_features autocmd! autocmd InsertEnter * call plug#load('coc.nvim') \| autocmd! load_ide_features augroup end " https://github.com/neoclide/coc.nvim#example-vim-configuration inoremap coc#refresh() " gd - go to definition of word under cursor nmap gd (coc-definition) nmap gy (coc-type-definition) " gi - go to implementation nmap gi (coc-implementation) " gr - find references nmap gr (coc-references) " gh - get hint on whatever's under the cursor nnoremap K :call show_documentation() nnoremap gh :call show_documentation() function! s:show_documentation() if &filetype == 'vim' execute 'h '.expand('') else call CocAction('doHover') endif endfunction " " Highlight symbol under cursor on CursorHold " autocmd CursorHold * silent call CocActionAsync('highlight') nnoremap co :CocList outline nnoremap cs :CocList -I symbols " List errors nnoremap cl :CocList locationlist " list commands available in tsserver (and others) nnoremap cc :CocList commands " restart when tsserver gets wonky nnoremap cR :CocRestart " view all errors nnoremap cl :CocList locationlist " manage extensions nnoremap cx :CocList extensions " rename the current word in the cursor nmap cr (coc-rename) nmap cf (coc-format-selected) vmap cf (coc-format-selected) " run code actions vmap ca (coc-codeaction-selected) nmap ca (coc-codeaction-selected)