Skip to content

Instantly share code, notes, and snippets.

@alexandrem
Created May 8, 2015 02:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandrem/d778f4ab5862f9c5eb4c to your computer and use it in GitHub Desktop.
Save alexandrem/d778f4ab5862f9c5eb4c to your computer and use it in GitHub Desktop.
Atom Editor - Default ansible syntax for .yml
# 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()}"
{extname} = require 'path'
fileTypes =
'.yml': 'source.ansible'
atom.workspace.observeTextEditors (editor) ->
scopeName = fileTypes[extname editor.getPath()]
return unless scopeName?
g = atom.grammars.grammarForScopeName scopeName
return unless g?
editor.setGrammar g
@alexandrem
Copy link
Author

Need to have package "language-ansible"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment