atom-jinja2
atom-jinja2 copied to clipboard
I am not able to comment out selections
Does the ability to comment out selections not exist?
@rajsinghUSA do you mean that cmd
+ /
(or equivalent) comments out with <!-- -->
instead of {# #}
?
If so, go to Atom > Config then under ".html.jinja.text":
add
commentEnd: " #}"
commentStart: "{# "
@davidrpmorris I meant, that I am unable to do only comment out a selected portion of code, like if I only wanted to comment out class="myclass"
:
<p {#class="myclass"#}>Something here</p>
But as for your comment, I DEFINITELY would rather use {# #}
instead of <!-- -->
for HTML (Jinja Templates)
syntax. However, I went to Atom's Edit > Config which opened config.cson, but there is no entry for ".html.jinja.text" so I added it myself on a new line at the very bottom (and all the way to the left) and placed commentStart: "{# "
and commentEnd: " #}"
after it:
".html.jinja.text":
commentStart: "{# "
commentEnd: " #}"
However, this did not change any behavior. Restarting atom doesn't resolve it either.
@rajsinghUSA
Oops I left out 'editor'. This is how it should look:
".html.jinja.text":
editor:
commentEnd: " #}"
commentStart: "{# "
@davidrpmorris, thank you, that works to switch to {# #}.
Any idea about my original question about only commenting out a selected portion of code, like if I only wanted to comment out class="myclass"
:
<p {#class="myclass"#}>Something here</p>
Currently, I can only comment out complete lines, not just selected text.
@rajsinghUSA Check out this thread: https://discuss.atom.io/t/comment-selected-text-not-entire-line/2788/9
Seems like this works for HTML:
'atom-workspace atom-text-editor:not([mini])':
'cmd-/': 'block-comment:toggle'
@davidrpmorris I tried that (except with ctrl+/), but it didn't work.