Vim Hotkeys For Specific File

hotkeyshtmlkeymapvim

Is it possible to set hotkey for specific file types in vim.

For example, if I am editing a .java file, I'd like vim to run javac .java when I press 5.

Is this possible?

Best Answer

~/.vimrc

autocmd FileType java map <F5> :! javac %<cr>

More info about key mapping and external commands.

Related Question