Open npearson72 opened 2 years ago
@npearson72 I actually just ran into this--fun that we did this a few days in a row. :Format
is from here https://github.com/neoclide/coc.nvim#example-vim-configuration -- you need to add this to your vimrc:
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocActionAsync('format')
I actually had to essentially do this to get it to work on save though (prob want to limit the file types, but here we go):
autocmd BufWritePost * call CocActionAsync('format')
@lukevers thanks, that helps.
Still not sure why it doesn't work with coc.preferences.formatOnSaveFiletypes
Yeah I'm not sure either..it almost looks like that's defined from the prettier plugin and not COC directly? I tried the prettier plugin, but it doesn't support prisma lol
Thanks @lukevers that works great. Any ideas how to get it to work with syntax highlighting? I normally use coc-prettier. The gif in the readme has highlighting, so someone got it to work..
@SOLID-arity Yeah I'm using https://github.com/pantharshit00/vim-prisma
Here's my vimrc if it helps https://github.com/lukevers/vimrc/blob/main/vimrc#L17
I've followed the instructions here:
https://github.com/pantharshit00/coc-prisma/blob/fc64aaa7fb0f0cdf51a84eeadee53e99fe1d3b90/README.md#formatting
However, when using the command
:Format
I get the following:E492: Not an editor command: Format
Also, here is what I have in my coc-settings:
But it does not work for prisma. All other filetypes do format properly.
Any ideas?