Why some codes are colourful, some aren't in Sublime Text 3? - angularjs

I had created angular quick start but as I mentioned in title some codes aren't colourful. How can I solve this?
For example:

By default sublime check extension of file and set highlighting for language (based on extension). For your case he knows that .js is javascript but he does not recognize .ts extension so he choosed plain text.
If sublime does not recognize which language the file has you can still define language in file manually.
In the right bottom corner in Sublime you can see for second file the "syntax highlighting" is set to Plain text.
Click on plain text and select javascript for example:

Related

Vim doesn't recognize angular as HTML

I understand that vim would not know until told that some file maps to a particular type. Currently my VIM setting fails to recognize my .ng file as '.html' hence it reads it like a plain text.
I want to know the global command to enable that.
PS: I think my sytastic plugin is not working for the same reason.
Put this into your .vimrc
autocmd BufNewFile,BufRead *.ng set filetype=html

Save in Sublime Text with Another Extension

In Sublime Text 2 & 3, whenever I save a file with one extension, or without an extension, then save it with another extension later, the syntax colors seem to stay with the first extension. For example, when I save what I mean to be a JavaScript or PHP file without an extension by accident, then Save As with the correct extension, the text stays all black.
Is this supposed to happen? Is it because the file isn't actually saved as the 2nd extension the next time? Most importantly, is there a way to save the file with the correct extension without creating a new file & copying all the text over?
you can set the syntax manually as follows.
click HTML and you will see all the syntaxes, you may choose whatever you want, or you can do it in the command palette by type ctrl+shify+P and type syntax and you can do the same thing.

How to remove specific characters from a file name?

I have bunch of files that need to have a (.) dot removed from the file-name. Eg. "Mr.-John-Smith.jpg" to "Mr-John-Smith.jpg". I don't have real experience with programming and know only html/css and a little javascript. I found another identical question here on stackoverflow, but what I gathered it was fixed on linux system and BASH was used.
Anyways, if anyone could provide me a tutorial on which program to use for this and what code to execute in that program to make it happen I'd be grateful.
if you are using a windows environment (which i guess you do)
you can download this free utility to mass change file names !
main page :
http://www.bulkrenameutility.co.uk/Main_Intro.php
download page :
http://www.bulkrenameutility.co.uk/Download.php
its easy to use
enjoy
If your file names in a file...
1- Open Microsoft Word or any text editor. Press ctrl+h and then search "." without quotes then replace it with blank character.
2- It will remove all dots, again bring "." to your file extention such as .jpg , .png searh your file extention for example "jpg" and replace it with ".jpg"
It will works %100, i am using this method everytime.
if they are not in a file and if you want do somethings in your operation systems' file system
Try this program. It is very useful for this operation;
Download
To remove all except the extension dot from all files in a directory, you can use PowerShell that comes with newer versions of Windows, and can be downloaded for older versions;
Line breaks inserted for readability, this should go on one line;
PS> dir | rename-item -newname {
[System.IO.Path]::GetFileNameWithoutExtension($_.name).Replace(".","") +
[System.IO.Path]::GetExtension($_.name); }
What it does is to take the file name without an extension and remove all dots in it, and then add back the extension. It then renames the file to the resulting name.
This will change for example do.it.now to doit.now, or in your case, Mr.-John-Smith.jpg to Mr-John-Smith.jpg.

sublime text suffix mapping

is it possible to map the suffix of files opened by sublime text 2 to be similar to other languages to get the text coloring? for example, when i open a *.cu file, this isn't recognize by sublime text as a valid file extension, so it opens the file and there are no text coloring in there at all. however if you open a php or c++ files, the the file will be recognized as valid file extension, and there will be text coloring, making it much easier to read.
I know text wrangler has this feature, and you cam map *.cu file extension to be like c++ so when you open a .cu file, the text coloring will be similar to a c++ file.
Yes it is.
Please see:
http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/
->
Map file formats to syntax highlighting

Working with SASS in Adobe Dreamweaver

I am trying to figure out how to start using SASS files in Dreamweaver.
The error message I get when trying to open is: "Can't find a valid editor for this file extension".
All my SASS files are valid and open well with Eclipse.
Thanks in advance to anyone who could post any tips on this one.
OK. I have found the answer.
All you need to do is open Dreamweaver, go to Edit> Preferences> File Types / Editors
and in the top text box ("Open in code view:") listing various files extensions add .sass.
That's it. Rest is down to haml and compass.
I hope this post will help anyone having similar problem.
To go even further and make Dreamweaver treat .scss files as .css files (applying code coloring and indentation), just follow the instructions on this Adobe TechNote
The visual28 link no longer works. Here is a quick rundown from here
DreamweaverCS?/Configuration/DocumentTypes/MMDocumentTypes.xml
If Windows change winfileextension="css" to winfileextension="css,scss"
If Mac change macfileextension="css" to macfileextension="css,scss"
For older Dreamweaver:
http://www.visual28.com/articles/less-scss-syntax-highlighting-in-dreamweaver
For Dreamweaver 5.5 and above:
http://forums.adobe.com/thread/861133
instead to go in your installation directory to find the 'MMDocumentTypes.xml' file, GO to
C:\Users\\AppData\Roaming\Adobe\Dreamweaver
CS5?\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml
and then find winfileextension="css" and change it to winfileextension="css,scss"...
That would definitely work..
Update to the latest version of Dreamweaver
Ensure that ‘Show hidden files’ is enabled in Control Panel > Folder options
Open your user folder eg C:\users\Dylan\ replacing with your name
Then open AppData/Roaming/Adobe/Dreamweaver CS6/en_US/Configuration/
Open the file Extensions.txt
Replace the first line with the following:
HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF,LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,LESS,SCSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-DIST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODULE,PROFILE,ENGINE,SVG:All
Documents
Replace the following line:
CSS:Style Sheets
With
CSS,LESS,SCSS:Style Sheets
Save and exit the file
Go to the folder DocumentTypes
Open the file named MMDocumentTypes.xml
Replace the line beginning with:
=>documenttype id="CSS"
with
<documenttype id="CSS" internaltype="Text"
winfileextension="css,less,sass,scss" macfileextension="css"
file="Default.css" writebyteordermark="false" mimetype="text/css" >
Save and exit the file, and restart Dreamweaver
Syntax highlighting now works

Resources