Can I have different mappings for different filetypes, and disable a plugin for a certain filetype?

Hey, thanks for help and sorry for late response. I read this and tried to use it like this. I went to .vim, there was no directory called ftplugin, so I created it. There, I created a markdown.vim file and pasted the line given in the link you shared (pressing F5 did indeed output 'I pressed F5 in a foo file'). However, when I tried to add 'let g:UltiSnipsExpandTrigger="<C-j>"`, it didn't work. That line works when it's in the .vimrc file but it doesn't work otherwise. I also tried using some other methods from below but I didn't have much success with them either. It seems like I manage to make it work for some regular mappings, but it doesn't work for setting a plugin setting (like the one I just mentioned). Any ideas? Thanks.

/r/vim Thread Parent