Atom editor HTML snippets unavailable - atom-editor

I'm trying to use the Atom editor on Windows machine for HTML authoring.
However, I can't make the HTML snippets work.
Regular completion of tags is working, but trying to invoke, for example, html snippet by pressing Tab results in inserting the Tab character.
Also, the only available snippets for HTML grammar shown on Alt+Shift+S are legal and lorem.
Any ideas how to fix this or where to look for the problem?

Related

VSCode Prettier adding quotes to css where I don't want them

I am using VSCode's Prettier extension and trying to work on some html for a Salesforce Lightning Web Component. In my html, I have a div like so
<div class={someVar}</div>
This is the correct syntax for this, however, whenever I save Prettier adds quotes like this
<div class="{someVar}"
which causes a syntax error. I can't seem to find this setting anywhere in the prettier settings or anything online about how to disable this addition.
I have some other html files that this doesn't happen to when I save, just this new html file I just added.

Why is my code not colorized in Atom Editor and acts like broken?

I am new to Atom and I've come across a problem. Any HTML code that is pasted or snippet isn't colorized in the editor. It doesn't show any effects when I open the file in a web browser as well. It acts like those codes aren't saved in the file.
I checked the language and it indeed is HTML (Since atom detects it from the file extension). I checked if my language package (language-html) is installed, and it certainly is.

How to quickly create <div> classes in VSCode

Generally new to web design and watching some tutorials on creating some backend for a project, getting really tired of writing out the manually, I see youtubers do .classname and then the class with the div appears, but for some reason it isn't working for me? Any help would be appreciated.
Also, would it be easier to switch to Sublime, my buddies think that it is the way to go.
Cheers.
Go to settings
Go to emmet under the Extensions section.
Click on 'Edit in settings.json'.
Write the following inside the 'emmet.includeLanguages' tag. Otherwise, paste the whole statement.
"emmet.includeLanguages": { "javascript":"javascriptreact" }
Save the settings.json file.
Those videos are likely using emmet. VS Code includes built-in support for emmet completions in html files. For example, typing .classname in an html file will trigger an emmet suggestion that expands to <div class="classname"></div> when you accept it
If you do not see this working:
Make sure the document is in the html language mode
Try manually triggering suggestions after .classname using ctrl+space
Make sure you have not disabled Emmet
I tried everything written in the answers but it wouldnt work, I had to do the following;
go to settings in the bottom left, search for 'emmet'
scroll down to and tick:
'Trigger expansions on Tab'
then it works by typing .divClassName + Tab
Check out this Cheat Sheet for VSC:
Cheat sheet for VSC
Ensure that VScode recognises your file as HTML5 or CSS file. In my case I had emmet enabled, but while I could get emmet abbreviation in a CSS file, they wouldn't work in an HTML file. The issue was that I also had Django template extension installed and the file had Django template code as well, hence VScode considered the file as Django template file, not HTML. You can check this the status bar at the bottom of VScode. Once I changed the file from Django template to HTML by clicking on Django Template in the VScode status bar, emmet started working.
The above answers didn't help me because VS code already came with Emmet installed, but I was missing the information on how to actually trigger it.
For an html element
Type the element e.g. div, h1, whatever, then press tab to complete it
For a class
Type the class name beginning with a dot then press tab to complete it.
For example type .myclass and hit tab and you'll get <div class="myclass"></div>
Note: if your class has spaces, use a dot in place of the space (e.g. for "my great class", you should type ".my.great.class" and hit tab)
Source
This information is from here
Tried mentioned thing from emmet vs code document
go-to .vscode >> settings.json
add line "emmet.triggerExpansionOnTab": true
it worked for me for reference : Emmet in visual studio code

Atom text editor - highlight line based on regex

Atom is a hackable text editor but I can't find a way to hack it to my needs.
On PC I use Notepad++ and its custom highlighting engine to view very large log files with visual cues to assist me.
I want to be able to highlight individual lines in Atom based on their contents: say the line contains "warning" I want it to be orange or "error" - red.
Atom is build on web technologies, so you can use JavaScript and CSS to alter its behaviour. If, for instance, you type "Warning" into a plain-text document and open the Developer Tools, you will see it is rendered as plain HTML:
<span class="text plain">
<span class="meta paragraph text">Warning</span>
</span>
Unfortunately, there are currently no CSS selectors for the text inside a tag-pair, so you would have to create a plugin, or package, in JavaScript/Coffeescript. How to CSS: select element based on inner HTML) provides a good starting point.
Use JavaScript to detect all instances of “Warning” inside the HTML of the editor view, then add a class. You can then use CSS to highlight the line.
Alternatively, you could probably create custom grammar for your log file.

Meteor aptana and templates

Im using aptana to code with meteor on windows (it has nice ota SSH/FTP editing which is why I use it). But the <template> tags are a meteor feature so it spits out warnings when using them.
Is there a nicer editor for windows to handle my files with SSH/FTP? Or even better a way to to add <template> to aptana?
The warning is specifically:
Because templates encapsulate all the html, everything gets underlined!
If you go to Window > Preferences > Aptana Studio > Validation you can go through the various validators (HTML Syntax Validator and HTML Tidy Validator are probably the relevant ones for you).
Under HTML Tidy, you can clickdown 'Elements' and change 'Unrecognized elements' from 'Warning' to 'Info' or 'Ignore'.
In the HTML Syntax Validator you can add regular expressions for errors to be ignored like in this question.
Sublime Text 2 is a nice editor for Javascript code.
Although it doesn't come with FTP support by default, but you can configure it using instructions given here.
Hope it helps.

Resources