dparkins / language-fortran

Syntax highlighting for FORTRAN for atom
MIT License
35 stars 16 forks source link

Is it easy to set custom file extensions to be recognized as fortran? I have ftn, ftn90, cdk, thanks. #47

Closed guziy closed 9 years ago

tomedunn commented 9 years ago

You can set custom file extensions for any language in Atom by modifying your init.coffee file as discussed here. For your case try

path = require 'path'

atom.workspace.observeTextEditors (editor) ->
    if path.extname(editor.getPath()) in [".ftn", ".ftn90", ".cdk"]
        editor.setGrammar(atom.grammars.grammarForScopeName('source.fortran.modern'))
guziy commented 9 years ago

Thank you very much Tom:

It works very nicely.

Cheers