3

I can set a file format to unix or windows by using:

:set ff=unix

Is there a way to check the file format ?

Pasan W.
  • 133
  • 4

1 Answers1

3

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.

Maxim Kim
  • 13,376
  • 2
  • 18
  • 46