I can set a file format to unix or windows by using:
:set ff=unix
Is there a way to check the file format ?
You can use set ff? to check current file format 'interactively'.
If you need to check it in a vimscript, you can use
if &ff ==# 'unix'
"do smth if file format is unix
endif
See :h let-& and :h expr-option for details.
:set ff?– Christian Brabandt Mar 26 '20 at 07:42