![]() ![]() Run :CocConfig this will open the file ~/.config/nvim/coc-settings. Hit to see a list of options for each extension Configuration For snippets get coc-snippets extension, which will use ultisnips for snippets. You can manage your extensions with: :CocList extensions If you don't want to setup a bunch of customizations and just want it to work then coc.nvim is the way to go, just install coc.nvim and coc-r-lsp extenstion. You can uninstall an extension with: :CocUninstall coc-html You can list all of the extension commands with: :CocList commands There are many more extensions to choose from here: You can install extensions for languages like this: :CocInstall coc-json coc-python coc-snippets coc-vimlsp You can also run :CocInfo to get some useful info Install extensions You can use g:coc_node_path to point to your node executable You can run :checkhealth and there should now be an entry for coc Head over to the readme and grab his example configĪdd the following to your init.vim source $HOME/.config/nvim/plug-config/coc.vim Start using Socket to analyze coc-snippets and its 0 dependencies to secure your app from supply chain attacks. Make sure you have yarn installed if you choose the second way npm i -g yarnĬreate a directory called plug-config and an entry for coc mkdir ~/.config/nvim/plug-config Good thing the author provided extensive documentation here Install with vim-plug " Stable version of coc I'm not sure if it's loading the snippets correctly and I've done some basic checking from the repo's FAQ.This plugin is too featureful (bloated) to explain in a single blog post ![]() However, it doesn't seem to be giving me the right snippets from ~/.custom/snippets/. "erSnippetsDirectory": "$HOME/.custom/snippets" This is my ~/.vim/coc-settings.json file: //. " provide custom statusline: lightline.vim, vim-airline. " NOTE: Please see `:h coc-status` for integrations with external plugins that " Add (Neo)Vim's native statusline support. " Add `:OR` command for organize imports of the current buffer.Ĭommand! -nargs=0 OR :call CocAction('runCommand', '') " Add `:Fold` command to fold current buffer.Ĭommand! -nargs=? Fold :call CocAction('fold', ) " Add `:Format` command to format current buffer.Ĭommand! -nargs=0 Format :call CocAction('format') coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. " coc-tsserver, coc-python are the examples of servers that support it. When comparing cmp-nvim-lsp and coc-snippets you can also consider the following projects: nvim-cmp - A completion plugin for neovim coded in Lua. " NOTE: Requires 'textDocument/selectionRange' support from the language server. " NOTE: Requires 'textDocument.documentSymbol' support from the language server. " Apply AutoFix to problem on the current line. " Remap keys for applying codeAction to the current line. " Applying codeAction to the selected region. " Update signature help on jump placeholder.Īutocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') " Setup formatexpr specified filetype(s).Īutocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Highlight the symbol and its references when holding the cursor.Īutocmd CursorHold * silent call CocActionAsync('highlight') " Use K to show documentation in preview window. Coc only does snippet and additional edit on confirm. " Use to confirm completion, `u` means break undo chain at current " other plugin before putting this into your config. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " Use tab for trigger completion with characters ahead and navigate. vimrc (mostly default settings provided on github): " coc.nvim :CocCommand workspace.showOutput snippets returns the following: Using ultisnips directories: UltiSnips /home/user_name/.custom/snippets When I'm working in a python file, :CocCommand snippets.editSnippets opens the correct snippets file. I don't have ultisnips or any other snippet plugin installed, just coc.nvim and its friends, including coc-snippets. My snippet files are named python.snippets, cpp.snippets, etc. ![]() I've downloaded a bunch of custom snippets to ~/.custom/snippets/. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |