Turn on background color when highlighting with C-SPC on a mac? - macos

I'm using emacs on a macbook. In linux, when I use C-SPC to start mark blocks, the area I marked has a yellowish background that tells me where I start & end. However, in my macbook the background is not highlighted, leaving me lost where the marked area is precisely sometimes. Can anyone tell me how to turn on the background color highlighting on a macbook?

You can do M-x transient-mark-mode to toggle the highlighting.
If you want it on by default, you can add (setq transient-mark-mode t) to your .emacs file.

Related

How to change the face of the text in the minibuffer when running in terminal mode?

When pressing M-x in Emacs, the focus switches to the minibuffer. When running Emacs in terminal mode, I have found that this text is really difficult to read as it is dark blue and difficult to distinguish from the dark grey color of my terminal. How can I change the font color of the text I type into the minibuffer?
I want to do this from my ~/.emacs, so that it happens every time I start Emacs in non-windowed mode.
I'm using Red Hat and the GNOME Terminal, if that makes any difference.
(custom-set-faces
'(minibuffer-prompt ((t (:foreground "orange")))))

Vim color scheme does not cover whole background

I'm using Zsh with agnoster theme and Vim.
When I try to change the color scheme of Vim, a bottom and left of screen are not applied by color scheme. First screenshot is before changing color scheme and the second id after changing color scheme. How can i fix this?
The left part is because that is the background of the LineNr column. You can change this with hi LineNr ctermbg=xxx.
The bottom is because vim isn't drawn in the whole screen in fullscreen mode. Unfortunately you can only fix this by changing the background in your terminal emulator's preferences to match vim's new background colour.

How can I set tmux vi-mode highlight color

Looking for a way to control text/cursor highlighting colors when in vi-mode in tmux. I can not seem to find many answers from googling around. I love tmux and use this feature quite a bit, and I have been living with this flaw for some time and still have not been able to find a solution. You can view my dotfiles here. Keep in mind that my master branch is my OSX setup, and I have an "arch" branch for my Arch linux setup. The issues occurs on both systems. Though the colors are slightly different, but not by much.
Here is current symptoms: (both systems) I am in a tmux session, I want to enter into vi-mode for either searching or copying some text. When copying text (hitting v while in vi-mode for visual) the highlighted text and background are both black. So I can't see the text I am highlighting. Or while searching (hit "/" while in vi-mode for searching) my background and text on the entire line where my prompt is for typing the text I want to search is all black. So I have no idea what text is actually in the search. If I mis-type something due to fat fingers and nothing returns in my search, it can be frustrating. One last symptom (which is a minor one, but would be nice to solve) When I do search, I get absolutely no highlighting over than my normal cursor. Not like my vim set up where it highlights currently found, and all other matches.
Here is what the desired fix would look like: Searches would highlight in some shade of yellow or orange on all matched text. Searching prompt to type in search text would be at least readable. Anything but Black on Black. Highlighting text while selecting what to copy in visual mode again anything readable, no Black on Black.
Other things to note: I typically have mouse-mode on in tmux to promote keyboard-driven approach and not allow any selection of text via mouse selection. But when I do toggle this feature off and can then select text via mouse, the highlighted text background is white and text is black. While readable, would still wish to know how to control this color as well. Also (not sure any vim settings actually carry over to tmux) but everything works as desired while actually in vim. Just in case vim settings here. Same note about branches.
Most of my tools are latest versions afaik. This includes Tmux 2.1. I do not have full list of versions of my tools as of right now. If this may play a part in debugging let me know and I'll reply with versions. For what its worth other tools that might be in conflict is my shell I use zsh with on-my-zsh. On my mac I am using iTerm2, on arch I'm using URxvt. Doubt any of my .Xresources matter since it also happens on OSX.
Any help is greatly appreciated. Thanks in advance.

emacs indentation face in command line

I'm editing python code using emacs, elpy and magit. When starting emacs using the -nw option (from bash and gnome-terminal in gnome 3). When started this way, emacs highlight the indented blocks of code using a black background single character; when using a graphic display (without the -nw option), the same character is a light gray. Please check out the two attached screenshots:
Is there a way to modify the darkness of the face in order make it less prominent?
I found a solutions that works. I'm not sure if it's the best one: if anybody knows a better way to do this, please comment!
In short:
Place the cursor on the indented block;
M-x customize-face;
Select the default value (highlight-indentation-face);
Select Show all (the face inherit from fringes);
Tick Background (this will overwrite the fringe background color);
Choose the white color (which is aliased to #e5e5e5)
Press Apply and Save
The last step will write few lines to the ~/.emacs file (on linux) to preserve the customization values. In my system, the lines that were added are:
(custom-set-variables)
(custom-set-faces
'(highlight-indentation-face ((t (:inherit fringe :background "white")))))

Cursor lost in highlighted text - Vim

When text is highlighted in vim, for example using the 'em' tag when writing a HTML document, I find that in some color schemes the cursor becomes invisible, making it difficult to correctly place the closing tag. Is there a way to have the cursor change color over highlighted text?
Change color of cursor in gvim
Look at both answers sir, I think you'll have your answer in there....
You'd have to hook into the CursorMoved,CursorMovedI events and then determine the highlight group under the cursor with synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name"). If it's one of those diffcult-to-see groups, you can issue a :highlight Cursor ... command to change it (or else change it back).
But this is rather complicated. Why don't you simply modify the colorscheme and choose a color that is easily recognized under all circumstances?! (The :hi command lists all colors and helps you choose one.)
This problem led me down quite a rabbit hole and caused me to learn a lot more about how syntax highlighting works than intended.
I learned that the reason my, supposedly italic, text was highlighted in the first place, is because the Mac terminal doesn't support italics ("Enabling italics in vim syntax highlighting for mac terminal")
I realised, thanks to "Colour colour everywhere! 256 colour-mode for Linux consoles", that due to the color profile I had chosen in Terminal's preferences, my "bright" and "normal" colors showed no difference, and for that reason my color profiles never looked like the screenshots.
And, finally, I solved my cursor getting lost problem by changing the cursor color in the Terminal preferences.

Resources