With my current knowledge, I can use commands such as autocmd FileType markdown colorscheme zen to set a colorscheme for a particular type of file.
I have a need to use a colorscheme for all those files without a suffix, e.g., no_suffix_file.

I did some research online, but didn't find relevant information.
Perhaps there is a name for this kind of file in vim, or at least a name for all the other files that are not in vim's FileType detector range.

What is it?

  • The filetype detection is not only filename, but also content depended. Is the content of your files special (distinct header, ...)? Maybe you can introduce a new filetype for your files. – jofel Jun 30 '15 at 10:09
  • @jofel, I've got an acceptable answer in this same question on SO main-site: stackoverflow.com/questions/31129775/… – Zen Jun 30 '15 at 10:19

In vim :echo &ft results nothing in a file without suffix. So there isn't a type for files without suffix. But what you could do is set a default colorscheme for all files (including files without suffix) and then with autocmd set different colorscheme for files with certain types

  • It is true, that a new file has no filetype. You need to run :filetype detect or reopen to trigger the filetype detection. The filetype detection is not only filename sensitive but also uses the content of a file. In this sense, your answer is not 100% correct. – jofel Jun 30 '15 at 10:07
  • op asked for a solution for files without suffix. I assumed that this means any kind of files without suffix. – aks Jun 30 '15 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.