atom how to change default syntax highlighting for .js files to language-babel

。_饼干妹妹 提交于 2019-12-23 13:19:06

问题


It's all in the title.. suddenly atom no longer defaults to language-babel for .js files and I'm not sure how to get back to the previous behaviour.

update - current config.cson:

"*":
  core:
    telemetryConsent: "no"
  editor:
    fontFamily: "Operator Mono Lig"
  "exception-reporting":
    userId: "a8f4cc72-fe9c-4093-b562-fcb344219d50"
  "language-dotenv":
    dotenvFileNames: [
      ".env"
      ".env.schema"
    ]
  "linter-eslint": {}
  "linter-ui-default": {}
  "prettier-atom":
    formatOnSaveOptions:
      enabled: true
      isDisabledIfNotInPackageJson: true
    prettierOptions:
      bracketSpacing: false
      semi: false
    useEslint: true
  "tree-view":
    hideVcsIgnoredFiles: true
  welcome:
    showOnStartup: false
".languagebabel.ttlextension":
  editor:
    softWrap: true

I tried a few variations of your suggestion and clearly I messed it up because atom could no longer launch


回答1:


You can create a custom file type by adding following in your config.cson file

  core:
    customFileTypes:
      "source.js.jsx": [
        "jsx"
        "js"
      ]

This will use language-babel for all the .js and .jsx files



来源:https://stackoverflow.com/questions/53145360/atom-how-to-change-default-syntax-highlighting-for-js-files-to-language-babel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!