Format reason file in neovim


Hi, i’m still wondering, how to format reason file in neovim?
currently i’m using these extensions:

  • vim-reason-plus (syntax highlight)
  • coc (autocomplete) + coc-reason extension

any idea?


With this setting in your :CocConfig it should format on save for .re and .rei files.

  "coc.preferences.formatOnSaveFiletypes": [


@believer 's answer should work when you want to format the file on save.
But if you need do this manually (by hotkey) you have to map your desired shortcut to coc’s format command :call CocAction('fomrat') . I use <leader>f for example.

nmap <silent> <leader>f :call CocAction('format')<CR>


@believer @amiralies thanks it work, ah now i can peacefully continue my project :triumph:


do you know how can I make it work with new syntax (i.e. .res and .resi files)?


sorry, there is no support yet, except syntax highlighting and formating,
syntax :
formater : using coc with (coc-rescript)