Do not format the file if no Default formatprograms is found or the language is not supported
c02y opened this issue · comments
c02y commented
I just started to use vim-autoformat, and set au BufWrite * :Autoformat
in my init file, and I found two issues:
- If the language is supported but the formatprogram is not installed, vim will autoformat the file depending on the rules I don't know
- If the language is not supported, vim will autoformat the file depending on the rules I don't know
Example:
- When I edit
~/.config/sxhkd/sxhkdrc
, the:set filetype?
of it ismarkdown
by my config(I use github space-vim config), but in README file, you saidremark
is supported for markdown, the thing is I don't getremark
installed, so vim shouldn't autofomat it. - When I edit
~/.config/ranger/rc.conf
, the:set filetype?
of it isconf
by my config,conf
is not supported by vim-autoformat, so vim shouldn't format the buffer.
chtenb commented
You can control this behavior with
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:autoformat_remove_trailing_spaces = 0
as explained in the readme
c02y commented
Oh, I thought they are global variables that working for all buffers.
Thanks, it seems working.