I'm using prelude emacs with solarized theme and parenthesis highlights are hardly visible and looking very ugly. I've tried disabling show-smartparen-mode also show-paren-mode but nothing seems to disable it. I'm not sure, which mode is making highlight parenthesis. Please check the image below:
I would like to change background color of parenthesis to something else so it is more visible. I would appreciate if anyone could provide any help/comments in this regards. Thanks!
EDIT
Problem: The matching parenthesis highlight, if you look at image above, my cursor is immediate right of the ) therefore ( and ) are highlighted in bluish shade which is not visible.
What I want: I would somehow like to change background color of this highlight.
After doing C-u C-x = with the cursor on the highlighted parenthesis, you will know what the highlighting face is. If you just want to change its background color, then do M-x customize-face FACE, where FACE is the face name.
Related
When I place my cursor on the extremity of a block (represented by the white drawn cursor on the picture below) VSC highlight both the ending and the starting symbol of that block.
The red line on the picture represent the starting and the ending of that block. Where can I set the option for VSC to automatically use a background color to highlight the current selected block ? (I am really more of a visual guy and I like to feel where's my current locations when I am coding.)
You are going to need an extension to do that, it isn't built-in. Try:
Indented Block Highlighting
I am not sure it supports all languages but see if it works in your case.
Bracket-pair-colorizer does something similar but more subtle. See "bracket-pair-colorizer-2.showHorizontalScopeLine".
.
And see How to change indent guide line color between brackets in VSCODE? - perhaps highlighting the active indent guide will be enough for you?
Using (in your settings.json):
"workbench.colorCustomizations": {
"editorIndentGuide.background": "#bbb",
"editorIndentGuide.activeBackground": "#f00e0e",\
}
I am using Emacs Prelude. I didn't find most of the custom themes comfortable. I really liked Sublime Text 2's Monokai theme, so I installed the Monokai theme ported for Emacs. Though it is more or less similar to Sublime Text 2's Monokai, there are some differences which I want to correct, so as get my Emacs Monokai more close to Sublime's Monokai.
For example I don't want every Python keyword to be the bold pinkish. I would be prefer keywords like class,def to have a blue color than the pink ones and I would prefer the function arguments to have an orange color.
The Emacs Monokai theme seems to color the variable name to an orange color, which I don't want. How do I implement this? I checked the monokai-theme.el file, but I don't know what variable to edit and what variable to add to give the features in color changes I mentioned above.
I suppose you're referring to this version of Monokai?
You'll be able to make some of your changes, but without doing a huge amount of work some of them won't be feasible. This theme uses font-lock to identify many of the things to be coloured, and font-lock identifies all Python keywords the same way.
Have a look through the various font-lock variables in that file. This will give you a good idea of what you can easily change. For example, if you want to change variables from orange to something else, change
'(font-lock-variable-name-face
(:foreground monokai-orange))
to use one of the other monokai- colour variables, or define your own.
If you're trying to figure out how a particular character is recognized by Emacs, move your cursor over that character and do C-u C-x = (C-u M-x what-cursor-position). This will show, among other things, the face for that character.
Is it possible to select a piece of text you're editing and change its color? I know it's possible to create a color theme that will color certain kinds of text (like for example coloring functions in a certain programming language), but is it possible to do a one time color change to a selected piece of text in a specific emacs document without creating a theme? thanks in advance.
A theme doesn't allow you to specify the color of arbitrary text in any case. It only describes a set of face to be used by font-lock.
To apply a face to an arbitrary piece of text, select the text, then M-: (add-text-properties (region-beginning) (region-end) '(face font-lock-warning-face))
See the faces section of the elisp manual on how to create a face.
Emacs also comes with the hi-lock package, which can highlight regexps or lines containing regexps. See manual
how about M-x highlight-phrase ?
I know six years is a pretty long time, but I stumbled across this question and, after a lot of research, I did not find anything nearly as objective as what I eventually dug out for myself.
To color say, the first 200 characters in your buffer, execute the command:
(put-text-property 1 200 'face (cons 'foreground-color "red"))
If you need help executing this command in emacs, here is one possibility among many:
Type ESC-x eval-expression.
Type or paste the above command in the mini-buffer after the prompt.
Press ENTER.
You might like to look at enriched-mode.
If you are in a buffer that isn't controlled by font-lock, you can use 'facemenu'.
For example, highlight a bit of text, then with the mouse, press C-mouse-2. You can then select a face (some combination of text properties with a name). You can also pick random forground or background colors.
If you Emacs is particularly old, I seem to remember something similar on M-g.
Try set-background-color, set-foreground-color, set-cursor-color.
Changes won't be saved with the document though.
Note:
When I try those functions, they don't set the region's color unless I go through the menus.
See http://www.emacswiki.org/emacs/HighlightTemporarily (and it need not be temporary).
You can "color" text by swiping it with the mouse, or matching it with a regexp, and several other ways. Library highlight.el, in particular, lets you "color" text in many ways.
Is there a way to change the text of the command line in emacs?
I do not know, what the real name of the command line at the bottom ist, but I marked it on the picture. It is the blue text at the bottom:
The bottom part is called minibuffer if I recall correctly.
M-x customize-face
minibuffer-prompt
Two possibilities for this one:
One: http://www.gnu.org/software/emacs/windows/old/faq4.html
Just scroll down until you see the part about color, in which it gives you the libraries where you can change emacs colors using RGB values.
Two: http://www.emacswiki.org/emacs/ColorTheme
This one's definitely a lot more robust than you need, but it's basically a 'plugin' of sorts that allows you to customize literally any color in emacs, or use premade color themes.
I highlight current line by evaluating:
(hl-line-mode)
It could also be set globally:
(global-hl-line-mode nil)
The problem is that this way line highlighting overrides highlight-phrase. So my question is: "how to highlight both current line and a given phrase in this line?"
Both highlight-phrase and hl-line apply faces that have a background color set. hl-line wins because it uses an overlay, and overlays always override text properties, which highlight-phrase uses. I suggest that you work around this by customizing the hi-yellow face to use a bright foreground color instead of a background color, or even a box.
So here's some, definetly not ideal, solution. Do:
M-x customize-face
emacs then asks you which one, and I did
hl-line
Then I turned off "inherit" flag (the last one), and turned on the "foreground" flag, - it was saying "black" - I made it red. After that You should save it all at the top of the page - either - for this seccion only, or for future sessions too.
That's it! This way current line text arrears of red font, while highlight-phrase highlights the phrase with yellow.
Edit: The previous solution that I posted doesn't work, but this one should.
Highlight has two modes, one for font-lock-enabled buffers (which uses font-lock) and one for without (which uses overlay). The solution I found was to simply force highlight to use overlay at all times, and thus have higher priority over hl-line (because shorter overlays have an implicitly higher priority, given the same value of priority).
To do this I went into hi-lock.el and replaced every instance of font-lock-fontified with nil. Be sure to M-x byte-compile-file afterwards in order to update hi-lock.elc.