I'm writing plugin for VIM and i need to know a filetype
of buffer specified by a number. But filetype
is an option
- how can i get specified buffer option programmatically? I can get buffer name via bufname()
vimscript function - but i did not found any function that allows me to get an option. Maybe it's some trick with bufdo
?
The getbufvar()
function cannot just retrieve variables, but also buffer-local options (prefixed with &
):
:let bufFiletype = getbufvar(bufNr, '&filetype')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With