I am very pleased with the new editor by Github. Unfortunately it isn't exactly easy to customize it. I wanted to create my own Syntax Highlighting Theme, because I am not happy with the ones available to download (at least they don't seem to do well with Java)
Now the files (syntax-variables, color.less, etc.) to style seem to be in:
~/.atom/ .../packages (if you want to change existing themes)
The problem is just that I don't know which (CSS) classes style which elements of the syntax. Is there a place where I can look up how to change the color of for example variable type declarations?
You can easily change your selected UI and Syntax themes through the Settings View: Open the Settings View. Click the Themes tab. Select Syntax or UI theme in their respective drop down lists.
Create a Syntax Theme In Atom, press cmd-shift-P to bring up the command palette, then start typing "Generate Syntax Theme". When you see Package Generator: Generate Syntax Theme appear click it to execute the command: A window will appear in which you can enter the path and name for your syntax theme.
In a recent version (v1.13.0) (the latest v1.18.0) of Atom, it seemed that there were extensive changes in the syntax of stylecs.less. Most of information I found in the Internet seems outdated. Select Atom > **Stylesheet… , and a file named styles.less will open. You add CSS code for customization into the space at the bottom of the file.
You can use chromium web-console by pressing Ctrl+Shift+I (tested in linux) and highlighting any element. After then open your stylesheet by pressing Edit->Open Your Stylesheet and add style for element with LESS syntax. You want bold highlighting class and function name.
Creating a Syntax Highlighting Package. To add new syntax highlighting rules, you need to create a subfolder named grammars. In this folder, create a new CSON file named after the language you want to support (e.g. mylanguage.cson). This file will contain all your syntax highlighting rules.
To add new syntax highlighting rules, you need to create a subfolder named grammars. In this folder, create a new CSON file named after the language you want to support (e.g. mylanguage.cson ). This file will contain all your syntax highlighting rules.
Yes, you can start Atom in Developer Mode by using the command atom --dev
or by using the menu View > Developer > Open in Dev Mode ...
. When you do that you can right click on any element in the UI and select Inspect Element
from the context menu, just like you would in your web browser.
Additionally, for syntax elements you can:
The scopes of the syntax element translate directly to CSS classes.
You can use chromium web-console by pressing Ctrl+Shift+I
(tested in linux) and highlighting any element. After then open your stylesheet by pressing Edit->Open Your Stylesheet
and add style for element with LESS syntax.
For example:
You want bold highlighting class and function name. If you select class with chromium-console you can see that it have class .name
That you should add in you Stylesheet file something like this:
atom-text-editor::shadow .name{
font-weight: bold
}
And you may create you own theme. In Atom it's not difficlt - press Ctrl+Shift+P
and type "Generate Syntax Theme"
. In new theme you can copy some code from other theme. If you don't know CSS/LESS - don't worry! Your new theme have file in style
folder named colors.less
. You can change it or write new color rule on base.less file.
Atom have awesome doc, you can read about creating theme in this page https://atom.io/docs/v1.4.2/hacking-atom-creating-a-theme
For others that come here because the highlighting for a filetype is not recognized for your language:
~/.atom/config.cson
file (by CTRL+SHIFT+p: type ``open config'')add/edit a customFileTypes
section under core
for example like the following:
core:
customFileTypes:
"source.lua": [
"conf"
]
"text.html.php": [
"thtml"
]
(You find the languages scope names ("source.lua", "text.html.php"...) in the language package settings see here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With