nunjucks-extended icon indicating copy to clipboard operation
nunjucks-extended copied to clipboard

Adds Nunjucks formatted comment regardless

Open djmtype opened this issue 7 years ago • 2 comments

This package applies Nunjucks-formatted comments to *.html and *.php file types.

For example, Toggle Comments applied via default keyboard binding or command prints comments as {# … #} instead of <!-- … -->. Some its own snippets can override the default snippets. In this case, the Toggle Comments.

Regardless, Nunjucks-formatted comments should only be printed according to the appropriate file type.

So, how can this problem be fixed if we want nunjucks-formatted comments in *.njk files, but also want html-styled comments in *.html and *.php files?

djmtype avatar Jun 14 '18 14:06 djmtype

I am having the same problem.

harberg avatar Jan 08 '19 17:01 harberg

You can solve this problem by changing the scope value in the comment settings file(nunjucks-extended/Preferences/Comments.tmPreferences):

<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.njk</string> 
<key>settings</key>

To do this:

  1. Extract "Comments.tmPreferences" file from "nunjucks-extended" with Package​Resource​Viewer
  2. Change the seventh line as above

or manually:

  1. Create directories "nunjucks-extended/Preferences/" in the packages directory(Sublime menu -> Preferences ->Browse Packages)
  2. Download "Comments.tmPreferences" from github
  3. Change the seventh line as above
  4. Save the file to a previously created folder(Sublime Text 3/Packages/nunjucks-extended/Preferences/)

alsolovyev avatar Feb 22 '20 14:02 alsolovyev