I have a vim plugin that defines a bunch of key mappings.
I’m trying to figure out how I can change the defininition of the key mapping based on the filetype.
For example:
If the file is a *.py: then map the key to X
If the file is a *.php: then map the key to Y
Thanks!
Yes. One way would be to use autocmd to call a custom function that sets your maps. It would look roughly like the following (could have mangled the syntax, so this isn’t really copy & pastable):
function !MyPythonSettings()
set noai
" set mappings...
endfunction