In Vim, I want to have a certain mapping set only if and only if the filetype is markdown, text, or none (ie NULL). Specifying "none" is the hard part.
The command below works if :set filetype?
returns filetype=markdown
or filetype=text
. But if :set filetype?
returns filetype=
(shows as none
in my status line) it does not work.
autocmd FileType markdown,text,none nnoremap <leader>f :%! cat<CR>
What is the correct way to to specify filetype is not set? In other words this mapping should be defined only when filetype is not set (or is text or markdown). On any other filetype the mapping should be undefined.
NB: the mapping is contrived because it is not the interesting part of the question.