Is there a way to highlight sqlite3 syntax within python3 code in Visual Studio Code? As a lot of the code is within strings, python3 highlights it as a string making it hard to read.
Thanks!
I build an extension called Highlight String Code which can highlight SQLs in python or any other languages.
You can easily use it by uppercasing the first keyword of SQL and adding a semicolon at the end:
I hope it can be helpful.
Related
I am using Haskell in Atom text editor version 1.23.1 on Mac. Other languages syntax is highlighted correctly but when I code in Haskell the text editor does not highlight the syntax correctly and shows it as plain text. I have tried searching for it and found that in Atom pressing ctrl-shift-L I can temporarily change the grammar. However, there is no option for Haskell as can be seen in the screenshot below.
The screenshot below shows what I am expecting.
Is there anything that I might have done wrong? Can anyone give me a clear and easy solution to this problem. Thank you
Haskell support unfortunately doesn't come packaged with atom. Use the language-haskell package.
The language-haskell package, according to the page 'Adds syntax highlighting and snippets to Haskell files in Atom.' It comes with support for .hs, .lhs, and .cabal files.
You can find help on installing atom packages here.
If you want to talk about adding Haskell support, or changing atom features, it seems that the atom forum would be the best place to do so.
I'm learning vuejs. I use vim as my editor.
I want to format the template section of a vue component using html-beautify, and format the script section using standard and css with css-beautify.
I'm not sure how can I do this? Any suggestion or recommended format program?
You could visual select your desired lines using linewise visual mode V and run your beautifier on them; for example locate your cursor between <script></script> tag and type: Vit then type :(this will also insert '<,'> which means visual selected lines) then run the system command js-beautify on selected lines using ! operator:
:'<,'>!js-beautify
for css and html also select their regions and run html-beautify or css-beautify
Also check this another answer of mine on how to treat each section separately: change-the-filetype-based-on-tags-regions-in-the-file
I'm using sublime text 3. And I want to display a text with color like a code file in Sublime. But I don't know how to do. Please help me!.
Thanks you!
You can manually set the syntax of any file using the Command Palette and type "Set Syntax: " or from the bottom right dialog (by default it reads "Plain Text").
If you want Sublime Text to remember your choice, you can also do that from the syntax selection dialog mentioned above, or View > Syntax > Open all with current extension as…".
I think if you need your text file for purposes like note taking, there is a nice hack.
Go to View > Syntax and then select haskell. Haskell syntax highlighting is subtle and works fine. To highlight something just capitalise the first letter and it pops in a different colour. Numbers are highlighted in a different colour again, increasing readability. Finally brackets commas etc have different colour which further helps.
Well, coloring is based on the syntax, like every programming language has its syntax, but the pure text file is hard to detect the syntax since it can be anything. So if you use the Sublime to coding,try save it as a file with file extension first, then the Sublime will detect by itself, however you could also do this manually.
The ability to create your own syntax highlighting rules is one of the excellent features of SublimeText.
Have a look here at some other people wanting to build their own syntax highlighting rules:
How to not highlight object keys such as 'do'/'package' as keywords in Sublime?
Sublime Text - C++ Highlight
That explains the basic tools you need to use to do what you want to do.
Following the same ideas there you can build a syntax highlighting scheme for whatever it is you want to achieve in your text file based on whatever syntax rules you are trying to follow. Hard to imagine what those are for a text file without you supplying exact details but if you want to do it Sublime Text gives you the power to do it.
If you give that a try and have trouble with developing the relevant Regular Expression/s to do what you want to do then post what you have done and how it is not working the way you hoped and perhaps we can help you get to the end of the game.
Is there way to have sublime text to build/compile real time as I type code so it can show my code errors if there's any? xcode has this feature.
for example, if i'm writing in a ruby file and in the first line i type:
print(hello)
and as i enter to the second line, sublime will tell me there's an undeclared variable "hello" in the first line?
This feature is not specific to the build/compilation process. What you're really looking for is linting.
You can use SublimeLinter coupled with SublimeLinter-ruby for ruby linting. There are also many more packages available for linting other languages at packagecontrol.io.
I've searched a lot for this and can't find how to Indent code in dreamweaver...
COMMAND-OPT+] - I've found this on google but it didn't work with me, I'm using a mac book air and to achieve ] I have to do alt+9 ( ] -> alt+9
I just want to indent automatically a bunch of code.. I know dreamweaver has automatic indenting but that just works when I'm writing code, but when I copy piece of code that are not indented like I do, ( I use tabs ), it doesn't indent them. I have to do it manually
Thanks
I typically use the formatting tool at http://www.freeformatter.com/html-formatter.html#ad-output. If you're using a copied block of code, you could format it with this tool and paste it accordingly into your existing code. An extra step, but well worth it in my experience.