Sublime Text 2 HTML default markups? - html

Sorry for asking such basic question but I can't seem to find the answer anywhere.
How can I get ST2 to write the basic html markup structure in new files?

You can use the Emmet package.
Installation
The simplest method of installing Emmet (and any other package) is via the Package Control package. To install that, follow the instructions from the project's home page:
The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.
import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
Next, open the command palette using the shortcut: CTRL + SHIFT + P
and type: "install package" and press Enter.
Type "Emmet" and select: Emmet (ex-Zen coding) for Sublime Text package.
And that’s it. After selecting the package, Emmet will install. You'll get a notification once it's done.
Use
Emmet allows you to type CSS-like expressions that can be dynamically parsed to produce (amongst other things) HTML.
For example, open a new file, type html:5, then press Ctrl + E. This will expand into:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
Emmet can do a lot more though, for example ul>li*3 will expand to:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
I would recommend that you watch the getting started video and check out the docs. Integrating Emmet into your workflow is a real time saver.

You can use DefaultFileType.
If you have the Package Control package installed, you can install DefaultFileType from inside Sublime Text itself. Open the Command Palette and select "Package Control: Install Package", then search for DefaultFileType and you're done!
Package Control: https://packagecontrol.io/installation#st2

Related

visual studio code not recognizing html files

VS code has suddenly stopped recognizing html files (the file icon is the default one for files with no extension)
all other file extensions work just fine
except for html
the tags still work but it won't autocomplete
Adding this to file extensions worked for me:
"files.associations": {
"*.html": "html"
}
In my case, for this problem the solution was to manually add *.html to files.associations, in user settings. Its unlogical but it seems that somehow the extension wasn't associated to the type of file. Now everything works perfectly...
Go to the settings (In mac it is Code -- > Preferences --> Settings)
In the search bar search for Association.
In Files:Associations click on Add items.
update key = *.html & Value = html
Below is the screenshot for reference.
I had the same issue but none of the other solutions worked for me!
You can try this:
Go to the path where the "settings.json" file exits, for my case the path is:
C:> Users> User123 > AppData > Roaming > Code > User > settings.json
Now, paste the code in the file:
"code-runner.executorMap": {
"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
}
Now search for the "files.associations" section in your settings.json file:
As an example
Now if you have the "files.associations" section then just add the line there:
"*html": "html"
(don't forget to write a comma after a line if there are more lines in it)
or if you don't have a "files.associations" section, then copy paste the code there:
"files.associations": {
"*.rmd": "markdown",
"*html": "html"
},
I had the same problem in Windows 10 a few minutes ago:
Yeah, from the solutions above I did this but still had some errors:
File -- > Preferences --> Settings
In the search bar search for Files: Association.
In Files:Associations click on Add item button.
update Item = *.html & Value = HTML
As shown below:
When I saved, I got this error
Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.
The problem is that terminal.integrated.shellArgs settings have been deprecated.
One of the answers here will help:
So I just had this problem and I figured it out the problem was from an extension that I installed which is the pyscript extension I disabled it and everything started to work again!
Well if you have pyscript extension installed, disable it. It has conflicts with html files I guess.
Or if you don't want to disable it just ctrl+shift+p then change language mode. Select configure file association for html.
This applies for any extension not just pyscript. For me it was pyscript

No HTML suggestions in Visual Studio Code

I've download the latest Visual Studio Code and am trying to write some HTML code. For example, <div>, <a>, <p> tags. However, there are no HTML suggestions in Visual Studio Code:
I've read this article and it says:
Visual Studio Code provides basic support for HTML programming out of
the box.
However, I've tried to install HTML extension:
In addition, I've turned on HTML5 suggestion in settings.json file:
{
"workbench.colorTheme": "Visual Studio Light",
"workbench.activityBar.visible": true,
"editor.multiCursorModifier": "ctrlCmd",
"window.zoomLevel": 0,
"html.suggest.html5": true,
}
Nevertheless, HTML, CSS suggestion does not work.
What can I do to code with suggestions?
I think the issue is that Visual Studio Code is not detecting the file type correctly. If you notice in these pictures, vscode has correctly detected that I am writing a html file by the icon <> beside the file name and the language indicator in the bottom right of the screen.
The language indicator most likely says plain text in your case. Click on it and a menu should appear at the top centre of the screen. Then try the following:
Enabling Auto Detect. I think this will be the first option.
Selecting Configure File Association for '.html'...
2 can also be accomplished by adding
"files.associations": { "*.html": "html" }
to your settings.
OR just add to settings.json (File -> Preferences -> Settings):
{
// Configure file associations to languages (e.g. "*.extension": "html"). These have
//precedence over the default associations of the languages installed.
"files.associations": { "*.html": "html" },
}
Just go to "File -> Preferences -> Settings"
Search for "Associations"
Check this image
Go to
File > Preferences > settings > Extensions > Emmet
Then click on
( C:\Users\Code\User\settings.json ) #
for reference
Add the following code:-
"emmet.triggerExpansionOnTab": true,
"files.associations": {"*html":"html"},
Save the file.

Selenium sendKeys with Chrome- Hebrew

I try to use:
action.sendKeys("some phrase with a dot, for example: www.google.co.il ");
but when i run the program what the action writes is:
www*google*co*il
the * represent hebrew character.
I can disable this only by disabling the hebrew language in my computer.
I tried to bypass the problem by using JS: set.attribute but it makes a lot of problems and i need something better.
Is there a function similar to sendkeys or a way to fix it?
You can try JavascriptExecuter using below code:
WebElement text= driver.findElement(By.name("q"));
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("arguments[0].value='test input';", text);
Webelement is the textbox where your need to write the value.
Or you can try some copy paste action after clicking into text box.
actions.click();
Refer to this URL for help:
http://www.helloselenium.com/2015/03/how-to-set-string-to-clipboard-data.html
I found out a way to change language during the tests while I solved another problem related to Upload a picture. there is this freeware called AuTOIT that you can use to help you with dialogs on Windows. I wrote a script to push the alt and click shift and my language is changed.
To change the language, I use the line:
Runtime.getRuntime().exec("path_of_script_here/name_of_script_here.exe");
The script was made the following way:
Open a text file.
Inside the file write:
Send ("{ALTDOWN}") ;Hold down Alt
Sleep(100) ;Wait 100 milliseconds
Send("{LSHIFT}{ALTUP}") ;Press Left-Shift and release Alt
Save as .au3 file.
Download and install AUTOIT.
Compile the script and then exe file will be created.
Run the test.
Hope this will help everyone else who encounters this problem. If something is not clear, ask me and I will gladly help.

how to enable html editor in eclipse JUNO for phonegap application?

I am using eclipse JUNO as Android Developer Tools, I am developing PhoneGap application, So I need mobile html but, It does not highlight the html syntax. So How to enable its **syntax highlighter and suggestions for html syntax. **
Eclipse Juno by default has the html tags enabled.
Try File-> New -> file -> FileName.html -> Finish.Now try pasting your code in this file.
Use Ctrl + Space for suggestions.
Thanks Every body I got my answer form this link
I summarized it
In Eclipse Juno Go ..
Step1:Help=>Install New Software..
Step2:Select the Juno repository (http://download.eclipse.org/releases/juno/) from the 'Work with:' menu:
Step3:In the search box, enter 'web' to filter the results, and select 'Web Page Editor':
Step4: Click Next:
Step5: Accept the terms and click Finish:
Step7: You might see this - just click OK:
Step8: Click Yes when ready:
If color of html files is not change(only black) So you have to go
step9: Window => Preferences menu as shown:
Then for both *.htm and *.html,
Step10: click on the 'HTML Editor' in the window below and click the 'Default' and 'OK' to apply.
Now open with HTML Editor
Check the Eclipse editor for HTML

How am i able to create the shortcut key in phpdesigner8?

Is there any possible way to crate a shortcut key in phpDesigner?
For an example, i have an html code
<html>
<title> My Project </title>
</html>
how can i create a shortcut key like when i press ctrl+2, it display
<html>
<title> My Project </title>
</html>
Don't know about hotkeys, but you can add an autocompletion.
Go to Tools -> Preferences -> Editor -> Autocompletions and bind, for example,
#html
to
<html>
<title>|</title>
</html>
On new page if you enter #html and press Ctrl+J your bound item changes to code set.
It sounds like you (or someone looking for a similar feature, as I did before I found it) may also be referring to something like "PHP Code Beautifier" (but this is for PHP code primarily).
To activate this by shortcut, go into:
Tools -> Customizer... -> Shortcuts -> PHP Code Beautifier :: File, and change to CTRL + 2 then click "Change".