Unable to change cursor/caret color in iTerm2 while using pywal - terminal

I am currently trying to configure my Neovim and Terminal setup in MacOS. One of the things I am doing is using Pywal to generate colorschemes in sync with my wallpaper. I am having one problem. When I run wal -i "path/to/image.jpg", my cursor/caret is becoming a color that I do not want it to become (it ends up becoming a dark color and I have a hard time seeing it against the background of the terminal, so I would like to change it to a lighter color).
So i was wondering what I should configure in order to change the cursor/caret. I already tried changing the cursor color on the iterm2 itself, it does not work when pywal is running but works fine when I do not have a colorscheme generated by pywal. I have tried using wpgtk as well but I am not sure how to configure it to change the cursor color.
So any help on how to change my cursor color while running pywal is what I need.
Also, when I use AlphaTechnology's pywal.nvim plugin for Neovim written in Lua, which essentially just uses pywal generated colorscheme for Neovim, the cursor is remains white. The cursor only becomes a problem when I change the terminal's colorscheme to something decided by wal -i "path/to/image.jpg" where I get problems with the cursor.

Related

Neovim color schemes fail on Mac terminal

Switching from Vim (on VSCode) to nvim on my Mac, I'm trying to change some color schemes.
However, when I change with :colorscheme <color>, the changes in the window don't reflect what they should.
I originally found this error while trying to load a separate color scheme from github and it didn't work, then tried others and builtin ones and they all are wrong:
Choosing a scheme:
After chosen:
It seems all these default schemes are derivative of green highlight on white text on black background.
I figured it probably has something to do with Terminal preferences, but couldn't find any solutions.
Thanks!
So you are using the builtin terminal of macOS? If that is the case, probably because the builtin terminal does not support true colors. Get yourself a decent terminal emulator, like, kitty terminal, wezterm, iterm2.
Add the following to your config:
set termguicolors
Install a color scheme supporting true color, like gruvbox-material.
Switch to it colorsheme gruvbox-material. It should work.

Edit terminal colors in WebStorm integrated terminal?

Does anyone know how to change the colors for the integrate terminal in WebStorm?
Currently it looks like this for me:
Which makes it super hard to see directory names.
If I could just have directories be a different color with no background or just bold text with no background. The key is I don't need my directories to have a background.
This is how it looks on Windows 10 using bash.exe. I can't currently show what it looks like when running outside of WebStorm, but I can show what it looks like on OSX as I'm having a similar issue:
OSX WebStorm with Material Theme plugin using /bin/zsh:
vs zsh in iTerm:
I'm mostly curious if there is a way to maybe turn off the Material Theme for just the integrated terminal or edit the colors directly there? If need be I can just use the external terminal, but it'd be nice to use the integrated one if I could just read all the text.

Setting vim's background highlight color

I am trying to set up vim to behave consistently between my Yosemite installation and another Ubuntu 14 system that I have. The main problem I'm having is with background color highlighting. The desired look is below, from gnome-terminal on Ubuntu:
However, when I try to set up the same theme in OSX using iTerm (or terminal.app) I lose the highlighting as vim seems to match the color background to the highlighting background:
Any idea of what I might be doing wrong or some commands I can use to probe how to modify the background color in Macvim so that there is consistency between both interfaces?
Add set t_Co=8 just before the line colorscheme solarized
Typically in Vim, people will have to set t_Co=256 to get rid of the background highlighting you're referring to. However, it seems that MacVim automatically assumes 256 colors, a result of the GUI.
Through set t_Co=8, you'll be overriding that default setting.
In theory anyways?

vim color not loaded or not working

I'm a fresh vim user, and I want to try new color themes.
I created a .vim dir which contains colors dir with themes and .vimrc file, and I created a symlink in my home dir, it is points to ./vim/.vimrc file.
Here is my .vimrc:
syntax enable
set t_Co=256
set synmaxcol=240
set background=dark
colorscheme twilight
let g:solarized_termcolors=256
This is the screenshot:
and that's what I want:
Whats wrong?
Note:
If I use the graphical macvim, it works, so something wrong with in my terminal
The let g:solarized_termcolors=256 is only useful if you use the solarized colorscheme. Since you want to use twilight, this line is useless and should be removed.
The twilight theme is GUI-only. Its colors are defined with hex values which are only understood by MacVim/GVim. It won't work in the terminal, no matter what you do. You can use twilight256 instead, which is designed for color terminals.
The vim themes, define a separate set of colors for the GUI (i.e. gvim) and the terminal (i.e. vim), hence you might end up seeing different colors in gvim vs vim. The reason behind that is the limited number of colors supported in the terminal compared to GUI.
CSApprox
But you could use a plugin like CSApprox, which will convert the colors in the GUI colorscheme to an equivalent one for terminal such that you see almost the similar set of colors. Most modern terminals (like Gnome Terminal, Console, OSX Terminal) that support 88 or 256 colors should work fine with this plugin.
The good thing about the CSApprox plugin is not separate configuration is necessary, and merely having this plugin in your .vim directory is good enough. And when you run the colorscheme command to choose a color scheme, this plugin automatically converts the colors for you as long as your terminal supports 88 or 256 colors.
And if you're running gvim or the terminal does not support 88/256 colors, this plugin just merely remains silent without doing any color conversions. And there is a mechanism to export the converted colors too I believe.
Alternative
Another similar plugin that I've heard is guicolorscheme which is similar to CSApprox, but you need to set the color scheme using the command :GuiColorScheme <color scheme name>.

Custom colorscheme not working on VIM

Here's what I did:
cp ~/.vim/colors/ir_black.vim /usr/share/vim/vim72/colors/
Then tried to open some code and :colorscheme ir_black
It changes a few colors but makes most of the text start to blink with the cursor.
It happens with almost all the other custom colorschemes as well. Does anyone have any ideas of what might be wrong?
I added t_Co=256 to my .vimrc file and it didn't seem to help.
PS: I'm on a Mac OS X.
Set your TERM to xterm-256color. Follow up on the iterm2 mailing list if that still doesn't work.
Edit : I found an exact duplicate of your question :here. It seems to be an issue with iTerm not supporting 256 colors by default.
The usual problem with color scheme and terminal is that terminal are often limited to 256 colors, and GUI color scheme are using 2^32 colors. So some of them are not correctly rendered in terminal.
There is a simple test to check: if you are lauching the GUI version is the color scheme rendered correctly ?
The possible solution are :
1. Convert your color scheme to 256 colors using the following plugin : CSApprox.vim
2. Choose a different color scheme. (Often on Vim.org color schemes compatible with Terminal have "256" in their name, like "wombat256" for example)
3. Use a GUI version like MacVim or GVim
If I remember correctly, the color sheme Zenburn is working nicely with both GUI and terminal version. It is rather dark with pastel colors.
Personal story : after spending ages to fiddle with color scheme to get something right for terminal, I switched to the GUI version. The GUI version with the icon bar hidden is not really different to terminal version anyway, as long as you are working locally
the default vim binary in /usr/bin/ will not work with any terminal. you need to have a version that supports gui - type "echo has('gui')" in vim command mode to check.
so your only option is to use a gui one (macvim etc.), or compile it with athena, gtk or x11 with macports, but i would advise against the latter, because it pulls down a shitload of dependencies.
i think it's better to use macvim for serious development that needs syntax highlighting, and use the 16 colour version in the terminal for quick edits.

Resources