How to activate inline-comment short cut for .env and other file types


#1

How to activate inline-comment short cut for .env and other file types?

Expected Behaviour:
short cut for inline ocmment does work for any file types .js .py .env .unkown …

Actual Behaviour:
short cut for inline comment does work for any files like .js .py …
short cut inline comment does NOT work for .env .test .unkown …

What I tried so far:

  • Search Google/StackOverlow/Quick overview inside this community
  • Searched inside the .atom directory for configuration
  • I started atom with the --safe flag. No changes.

Please give me a hint towards the right direction.


#2

The definition of the inline comment is in the language / grammar description package.
Ctrl+/ is to make a line a comment line.

  • Which shortcut are you using that works for the other file extensions?
  • Which grammar are you having trouble with? …which grammar package?
  • What is the inline comment characters for this grammar?

#3

Which shortcut are you using that works for the other file extensions?

From my default key-map I got:

'atom-workspace atom-text-editor:not([mini])':
  'cmd-/': 'editor:toggle-line-comments'

It is working for any regular file extensions like *.py *.js
It is not working for *.env file extensions and as far as I saw while trying to solve my problem it is not working for any unkown file extension.

Which grammar are you having trouble with? …which grammar package?

I’m not sure if there is a grammar name for environment variables.
I’m currently not using a package for those files.

What is the inline comment characters for this grammar?

the # character is used for commenting a line


#4

In the status bar, bottom right, shows the grammar that is being used. If there is no formal grammar listed there, the line comments will not work. A plain text file / unknown has no definition for what a line comment looks like.

The grammar I’m using at this very moment uses // and (* *) for example.

Prefered way is to have the env extension linked with some grammar. It is possible to hack/force an unknown file type to the line comment method, but you still will not have syntax colouring to go with it.