I'd like to get the current filetype as a variable in vimscript.
I'm making a function that grabs the current filetype and edits another file of corresponding filetype.
For example:
- editing "foo/bar.txt", want to open "tmp/other.txt"
- editing "foo/bar.cpp", want to open "tmp/other.cpp"
etc. I know that :set ft?
displays the filetype in vim, but I'm not sure how to capture it and then open another file using it as part of the new file string.