Are there any tools to convert a pygments style definition into a gvim colorscheme?
I found vim2pygments, which converts vim colorschemes to pygments themes, but I haven't found anything doing the inverse. Specifically, I'm using macvim, though I imagine the colorscheme format would be the same for any gvim-derivative (please, correct me if I'm wrong).
I haven't come across anything that will automate this process, but it should be very easy to do by hand. Grab an existing colour scheme, stick it in your ~/.vim/colors/ directory and put the colours that are defined in the pygments scheme into the appropriate places.
For example, if you use my colour scheme (which uses a non-standard format to make it more editable) and make it uses the pygments autumn scheme, you could take the line that looks like this:
let ColourAssignment['Function'] = {"GUIFG": '#007777', "CTERMFG": 'Cyan'}
and change it to look like this:
let ColourAssignment['Function'] = {"GUIFG": '#00aa00'}
(I've removed the colour terminal assignment as you've said you're using a GUI and it is thus largely irrelevant).
It shouldn't take very long to go through the whole set. My colour scheme is designed for dark backgrounds primarily (it adjusts colours if you switch to a light background), but it wouldn't be very hard to get rid of this aspect: change the "Normal" highlighting to be black on white rather than white on black and remove the s:MakeDarker function and the bit in the if &background == 'light' block.
Alternatively, you could do a similar thing with the normal syntax highlighting format by taking (e.g.) darkblue.vim and changing (e.g.):
hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=lightblue
and changing it to:
hi ErrorMsg guifg=#aa0000 guibg=#ffffff ctermfg=white ctermbg=lightblue
Related
In frustration of some breakage, I've nuked my old/ancient
version of Scite, and done a fresh install of Scite.
So, on Windows, I now have 32-bit version 5.1.4.
Three issues:
#1 How/where to change the overall (not file-type specific)
background color, it defaults to WHITE. I'd like to configure it to that light-yellow-ish color. How/where to
do that. (Googling said to change it in the "SciTEGlobal.properties" file, but nothing in there resembles what I'm trying to do. !?!?)
#2: So, specific to HTML files, as I scrolled down thru a file, the background in HTML sections would have this same light-yellowish color, and the JS sections had white background, and I'd like to have something equivalent
to that. (On the defaults I see now, html sections are white, but the JS section are an off-white, but they are
so close to white, that my eye can hardly discern them, unless I tip the laptop's screen back and forth. (Yuck.)
#3: A new behavior I see now, is that there is some scheme for html, that uses different font-sizes for different contexts. While that seems like a worthwhile feature for many, I'd like to go back to what I had before...where
all lines were the same font-size. (And then, how can I specify just one single font-size, for all lines in all file-types.)
TIA...
Dave
Default background color and style can found in SciTEGlobal.properties file
# Global default styles for all languages
# Default
style.*.32=$(font.base)
# Line number
style.*.33=back:#E7E7E7,$(font.base)
To change default background color open SciTEUser.properties file and add following lines
# Global default styles for all languages
# Default
style.*.32=$(font.base),back:#101010,fore:#BBBBDD
# Line number
style.*.33=$(font.base),back:#101010
Note: Editing SciTEUser.properties file for customization is best practice. However this file is stored under %USERPROFILE% folder (in Windows) and customization limited to that machine only. If your SciTE installation is on USB stick (Portable installation) and you want to retain SciTE customization on whichever PC you plugged in then edit SciTEGlobal.properties
To do any changes specific to any language then edit <language>.properties file.
example html.properties for HTML specific customization.
I'm very happy to be using the most recent ruby 3.0; as well as having access to the updated command-line interpreter which does syntax highlighting and coloring.
However, the colors are a bit hard to see for me. How can I change them? The command line options for IRB allow me to turn off colorization, but I can't figure out where the configuration files are that would allow me to change the defaults (e.g., to make the blue color lighter.)
I fixed this by changing iTerm2 theme.
Switching to 'Tango Dark' made it readable.
Here how the new Ruby 3.1 autocomplete feature looks like right now:
Some are hardcoded; but most of it is inside a constant, and thus editable (even though it's private). This should let you change all the pesky blues with cyans. The single downside is that keywords are indeed hardcoded to use CYAN, but we can cheat and change the CYAN constant itself to something else (e.g. BLUE - readability for stuff like nil and true is not that important to me, but feel free to change to something else), and hope no other plugin relies on CYAN actually being cyan :D
module IRB::Color
TOKEN_SEQ_EXPRS.each do |token, (seq, exprs)|
seq[0] = CYAN if seq[0] == BLUE
end
remove_const :CYAN
CYAN = BLUE
end
You can put it inside $HOME/.irbrc to make it work across all future irb sessions.
Needless to say, this is a hack, and should IRB::Color change in the future, this may well stop working.
A quick work around until this is configurable is to change the ANSI Cyan colour default in your terminal preferences. In iTerm2 you can go to preferences > Profiles > Colors. I went for a rather fetching 383a59.
As far as I can tell reading the source, the colors are hard-coded in the last version or IRB, so there's no configuration (yet!) available for this.
I'm looking for a reference as to what each color of syntax highlighting in Visual Studio Code actually means. I'm currently using the dark default theme Dark+. I've gotten used to recognizing a few of the highlight colors and I get the gist of what I'm looking at, but I'm looking for a more detailed reference of what each color means.
I've searched for a while for this and can not find any reference guide or glossary/index listing the colors and meanings. Not sure if it matters, but I am solely writing in JavaScript.
Thank you in advance.
edit: I have included a screenshot of the type of syntax highlighting I am referring to.
The meaning of the syntax highlight colors comes in two parts:
How are the characters in the file organized into meaningful tokens?
How are those tokens assigned a particular color and font style?
Partitioning text to tokens
The first part is determined by a grammar description built in to VSCode. VSCode uses a system based on TextMate grammars. The grammars are defined in the VSCode sources (e.g., JavaScript.tmLanguage.json), but in that form have gone through a couple stages of postprocessing, making them nearly unreadable. There is no documentation of the intent of these grammar files. They tend to at least roughly follow the relevant language specification, but with plenty of ad-hoc deviations.
The most practical way to understand what tokens are defined is to use the "Developer: Inspect TM Scopes" tool available in the Command Palette (Ctrl+Shift+P). When you put your cursor on a token, it will show you the "scope labels" that describe that token. These labels are more or less human-readable.
Edit 2020-07-24: As of VSCode 1.47 (and possibly a little earlier) the command is called "Developer: Inspect Editor Tokens and Scopes".
Example:
Above, we can see that the return keyword is most specifically classified as keyword.control.flow.js. It is within a brace-enclosed code block (meta.block.js), within a function definition (meta.function.js), within Javascript source code (source.js).
That sequence of scope labels is the closest thing there is to a "meaning" for a token in VSCode.
Assigning colors to tokens
Next, there is the process of mapping that sequence of scope labels to a color and font style. That is done by the theme. In my case I am using Visual Studio Light, defined in the VSCode sources in light_vs.json. In the case of the return keyword, this is the applicable fragment:
{
"scope": "keyword.control",
"settings": {
"foreground": "#0000ff"
}
},
This says, basically, that anything with a scope label beginning with "keyword.control" shall have a blue color. But other fragments may override this one; the rules are somewhat complex. Why blue? It's an arbitrary aesthetic choice.
Why do function and NaN have the same color? The grammar assigns them different scope labels (storage.type.function.js versus constant.language.nan.js), but it just happens that the theme you are using (Dark+) assigns them the same color (as does mine). I find that an odd choice, but can only speculate about the reason.
Customizing the colors
You didn't ask, but an obvious follow-on question would be how to customize these colors, for example giving function and NaN different colors. See this answer.
I was doing a visualization in this years adventofcode. My first stab just used plain ascii chars video here. Then I saw this image
Which I thought was really nice. However, when I attempted to put in these chars, they completely overlapped.
Is there a nice way to do this? I've tried installing gnu unifont as that sounded like a decent start, but no joy.
How do I use the terminal to print "letters" like this and have them come out nicely? I might be missing something fundamental about terminals + UTF8. If it matters, I'm using OSX terminal app, Anonymice Powerline Nerd Font Complete Mono font.
EDIT
Yes, the font didn't contain items which were encoded correctly (or was falling back?! if that's even possible, to items which weren't encoded correctly)
I ended up using the symbola font which, while not perfect, means I can draw this:
which is good enough!
It looks as if the "patched font" didn't set the font metrics properly. Terminals expect the font header to give a bounding box which applies to all characters. If the individual glyphs don't fall into the box, you'll get interesting effects like this.
As the title says I'd like to have my Sublime Text 3 with Espresso's default theme.
I know there's Soda which is a really similar one but I need that specific color scheme instead of Soda's. I've searched around on Google and there's only modified personal versions but I wonder if there's something "official" in the sense that it's looking exactly as the original Espresso color scheme.
Also, is there something that replicates Deamweaver's scheme? This one's for a friend who's starting out and having some difficulties adapting to another color scheme.
If you can't find a color scheme there is a nice tm-theme editor to build your own scheme: http://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai%20Extended%20Mod