fannheyward / coc-markdownlint

markdownlint extension for coc.nvim
MIT License
170 stars 2 forks source link

How to autofix the file? #451

Closed seriiserii825 closed 2 years ago

seriiserii825 commented 2 years ago

Hi, thanks for plugin.

I am not familiar with nvim-coc. I installed some plugins coc-css coc-emmet coc-eslint coc-explorer coc-fzf-preview coc-git coc-highlight coc-json coc-phpactor

And i don't understand, how to make to work autofix.

In ~/.config/nvim/keys/mapping.vim i set a keybinding

inoremap jk markdownlint.fixAll

But it not works.

Also plugin coc-codeaction no longer support, and i can't install them, but i used float mode.

https://i.imgur.com/0byf9Ds.png

Also, when i press space + a, i got in footer a list of errors, and can switch between them.

Sorry for a stupid, may be, question, i am beginner.

fannheyward commented 2 years ago
  1. you can run :CocCommand markdownlint.fixAll to fix.
  2. you can set autocmd BufWritePre *.md silent! :call CocAction('runCommand', 'markdownlint.fixAll') to fix on save
  3. nmap <silent> ga <Plug>(coc-codeaction-cursor), then ga will list available code actions.