Checking if %Y exists in current file in VimScript [closed]
- by Eduan
Like the title says.
I would love to know how, with VimScript, I can do an if statement, that checks if %Y (for statusline) exists in the current file. This is what I have so far:
if expand('%:Y') != ""
let filetype=extend('%:Y')
let filetype+= ",\ "
else
let filetype=""
endif
This is, of course, for my statusline, for which I don't want to show the filetype comma and space if the filetype doesn't exist.
BTW, this is a direct copy of this StackOverflow question: http://stackoverflow.com/questions/13314264/checking-if-y-exists-in-current-file-in-vimscript