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.
Related
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:
I have a batch file that creates text files in multiple folders.
What I need it to do as well, is after creating that text file, save a copy of it as a .scr file
If I were to do with this without a batch file, I would open the text file, click SAVE AS and save the file with a .scr extension. I cannot figure out how to add this feature to my batch file however.
The original text file cannot be erased, so I can't just change the extension. I would have to copy it, then change the extension, or imitate the SAVE AS feature.
Help?
I just used the ren *<> *<> command. It is extremely redundant because I end up making two text files that are identical and just changing one, but it gets the job done
I have an executable that accepts typed user input on three seperate lines on the GUI. The executable also has a button called "create file" that will perform a file creation based on the typed data. My question is how can I automate passing the three typed values into the executable and then execute the "create file" button all from a batch file? I do not have access to the source code so I cannot make modifications there to achieve this.
(Im not able to write comments yet, so I have to use an "answer")
I agree Cebence, as far as I know you need some kind of macro player. Best free I know of is autohotkey (just google for it). It needs a bit reading in at first but is pretty easy to use and very versatile.
Well, this is not really a batch file solution - I don't think one exists. But you could use a tool like Spy++ to find the IDs of the relevant dialog controls and then write a program to:
Launch the executable
Retrieve the main window handle
Send the appropriate window messages
There is probably software out there that can do this. Maybe there's something that you can batch which will just take the process name or ID and pass a single message to it.
If the GUI application doesn't support command-line arguments BAT file will not be of much help here.
What you actually need is some kind of "GUI macro player" application that will execute a script, i.e. macro like this one:
Switch focus to running application named "XYZ"
Find the input box named "text1" and type in "${param1}"
Find the input box named "text2" and type in "${param2}"
Find the input box named "text3" and type in "${param3}"
Find the button named "button" and click it.
I don't know if there are (free) applications that can do this now, but there was a free application called "Act!" or something like it (its icon was a yellow Mickey Mouse glove with a finger pushing a button). It was actually a ZIP file containing a running Windows executable and Delphi application source code, but I can't find it now on PC Magazine's website.
Hope this helps.
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.
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