Skip to content

Instantly share code, notes, and snippets.

@guziy
Created January 26, 2016 16:55
Show Gist options
  • Save guziy/7223771ca8060eadaeaa to your computer and use it in GitHub Desktop.
Save guziy/7223771ca8060eadaeaa to your computer and use it in GitHub Desktop.
Custom initialization for fortran files in Atom
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# console.log "Saved! #{editor.getPath()}"
# Custom fortran extensions for GEM
path = require 'path'
atom.workspace.observeTextEditors (editor) ->
if path.extname(editor.getPath()) in [".ftn", ".ftn90", ".cdk", ".cdk90", ".h90"]
editor.setGrammar(atom.grammars.grammarForScopeName('source.fortran.modern'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment