I am trying to set up a vim key mapping that will map the key ‘;’ to A; – i.e. I want to auto append ‘;’ to the end of the line. However I am having difficulty in setting this mapping up. I would also like to limit this to only java files if possible.
Can this be done?
The mapping itself is done this way:
I would recommend putting this line in your .vimrc and live with it (it should not bother you, since the mapping only works in command mode). If you really must restrict this behaviour to certain files, you need to look into the
autocmdfunction (:help autocmd)