I should know this, but my mind is blank right now … long night …
How to define a mapping that is active only when a certain filetype is active (say, markdown and I wish to define a mapping/abbrev for inserting brackets ][ since I don’t have them on my keyboard in my language layout)?
To define a mapping effective only in the buffers having certain
filetypevalue, one can use the combination of a filetype autocommand (see
:help,autocmd
:help FileType) and a local mapping (see:help map-local).