Set file type without leaving the code editor

If I create a new JS file and then start editing it, I want to set its type to 'sjs-4' with the least possible effort. Either automatically set the type based on the initial extension or provide an easy way to set it without leaving the code editor.