8

I don't use coc, so I will just share my vision on how you can try to fix this. I assume that by suggestion box you mean regular vim Pmenu. Try to make sure if it is actually Pmenu: run :hi Pmenu and check the colors: if it really is, then changing it would be simple, add to your vimrc """ Customize colors func! s:my_colors_setup() abort " this is ...


5

This is a general way to scroll popup window above or under around cursor, it first get winid by test :h popup_locate() with screen cursor position, then update firstline of the found window. I didn't add the close map, AFAIK, it's closed automatically when you move your cursor. Note that the beginning and ending of scroll is affected by :h 'scrolloff' code ...


3

Based on :help coc, I would use :CocDisable and :CocEnable. If you can find a way to detect if coc is enabled (b:coc_enabled I think was mentioned in the documentation and looks helpful), you could write a smarter “toggle” command.


3

One way to get this feature is by using coc and coc-emoji. Coc is a plugin which allows you to get the same Language Server Protocol (autocompletion, linting, go to definition, etc...) as VSCode because it uses the same extensions as VSCode. This is a pretty powerful tool but installing it just to get emoji support might be a bit overkill. However if you do ...


3

You can use the <buffer> argument to restrict a map to a certain filetype, see :help :map-local for details. Fugitive's status filetype is fugitive, so you can try: augroup FugitiveMappings autocmd! autocmd FileType fugitive nmap <buffer> <Tab> = augroup You can also call the right function instead of mapping <Tab> to = (which ...


3

I inject my own way of opening files in CoC with: let g:coc_user_config = {} let g:coc_user_config['coc.preferences.jumpCommand'] = ':SplitIfNotOpen4COC' Then the command is defined in my lh-vim-lib plugin to search if the buffer is already opened or not. Having more control is possible. To use the prompt already provided by CoC, you may have to search in ...


2

It turns out it was another plugin causing the interference: townk/vim-autoclose. After uninstalling it, the issue went away. I am now using jiangmiao/auto-pairs without problems.


2

According to coc readme you can trigger completion manually with: " Use <c-space> to trigger completion. inoremap <silent><expr> <c-space> coc#refresh() NOTE that not every terminal supports <c-space>... I don't know for sure how to map cmd in vim... Probably D or something: " Use <CMD-x> to trigger completion. ...


2

Perhaps I should have searched the internet more before I asked this question. I was able to accomplish what I needed using the system function. So here I needed to do: let g:coc_node_path = substitute(system('which node'), '\n', '', '') The substitute is necessary because we need to get rid of the new line at the end of the output, otherwise the path is ...


2

CoC assumes that a directory containing .git/ is the root of your project. According to the CoC docs: Unlike VSCode vim doesn't have workspace support. The solution is resolve workspace folders from opened files. This means that CoC uses a list of filenames which, if present in a particular directory, indicate that it might be the project's root. If ...


2

Hey not a long time ago I was also looking to have the same setup as yours and ended up with this config. Although I ended up using <c-j> and <c-k> for navigating the completion list and also for snippet jumps. let g:coc_snippet_next = '' let g:coc_snippet_prev = '' inoremap <expr> <c-j> \ pumvisible() ? "\<c-n>" : ...


2

The advantage of generic plugins such as CoC is that they work for a wide range of filetypes; for example I normally write most of my code in Go and use the Go Language Server for this (via vim-lsc, which is more or less similar to CoC). This week I did some C programming though, and by just installing the clangd language server on my system vim-lsc also ...


1

It seems the problem is that CoC is using an asynchronous action that doesn't take affect right at the point where the mapping is executed. Looking at the CoC sources, I see there's a CocAction() counterpart to CocActionAsync(), so maybe you can use that to run the gd action synchronously. Try the following: nnoremap <silent> <leader>gd :vsplit&...


1

Thanks to @d-ben-knoble, in my case I had vim-surround in my vimrc which was causing this behaviour I removed that and now is fixed.


1

to move between errors, use nmap <silent> [e <Plug>(coc-diagnostic-prev) nmap <silent> ]e <Plug>(coc-diagnostic-next) You need to be at the exact cursor position for the error to be displayed in hover. So just press it in the current line. This I haven't tried: <Plug>(coc-diagnostic-info) *n_coc-diagnostic-info* ...


1

Answer via this Reddit commenter: these floating boxes are controlled by coc itself. In this case the box is called CocHintFloat and can be seen with :hi CocHintFloat. In general :hi Co<tab> shows you all the possible coc highlight groups. To change it, add eg highlight CocHintFloat ctermfg=Red guifg=#ff0000 to your .vimrc. The background colour ...


1

coc#util#float_scroll has been replaced by coc#float#scroll() The example keymapping has been given in the documentation. if has('nvim-0.4.3') || has('patch-8.2.0750') nnoremap <nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>" nnoremap <nowait><expr> <C-b> coc#...


1

As Tae pointed, that's not really about vim, nor CoC. This message is displayed (most probably) because you have no .eslint nor .eslint.json, which are needed for CoC to use the linter. First, you'll need eslint if it's not already installed: npm i -g eslint You can then generate these files with the config demon. Run this command from your project root:...


1

Plug-in managers are largely interoperable in Vim, all modern plug-in managers work by updating 'runtimepath' to include the root of the plug-in in the list of paths, which is how Pathogen works (you could call Pathogen the "grandfather" of plug-in managers.) In your specific case, you are trying to install coc.nvim using Vundle. As you reported in issue #...


1

You can call the action jumpDefinition with a command as argument: nmap <silent> gs :call CocAction('jumpDefinition', 'split')<CR> nmap <silent> gd :call CocAction('jumpDefinition', 'vsplit')<CR> nmap <silent> gt :call CocAction('jumpDefinition', 'tabe')<CR> To get more information: :h coc-action-jumpDefinition


1

I was breaking my head trying to debug this. It turns out it was a problem with my vim colorscheme. I was using Monokai from vim-colorschemes. In the definition for PMenu it specifies all colours as NONE, I think this somehow interferes with the autocomplete engine when it has to resize the popup window. The resize action leaves the debris of random text on ...


Only top voted, non community-wiki answers of a minimum length are eligible