As title. Currently, I only have the buffer number, I need to know which filetype it is.
1 Answer
You can use getbufvar()
to get a variable definition, together with the '&filteype'
syntax to get the value of an option rather than a variable.
:echo getbufvar(2, '&filetype')
-
1
-