Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Non gvim compatibility #4

Closed
dathinaios opened this issue Jun 7, 2013 · 32 comments
Closed

Feature request: Non gvim compatibility #4

dathinaios opened this issue Jun 7, 2013 · 32 comments

Comments

@dathinaios
Copy link

Hey :)

Thanks for this beautiful theme!! It would be great if I could use it in the Terminal as well ;)

best,

Dionysis

@morhetz morhetz mentioned this issue Jun 7, 2013
@krzkrzkrz
Copy link

Great theme. But yea, wish there was one for the terminal

@jojoyuji
Copy link

jojoyuji commented Aug 6, 2013

for terminal users I suggest the CSApprox plugin. Though it's not the same colors it's quite a solution for the majority of vim's colorschemes

@greduan
Copy link

greduan commented Sep 21, 2013

@morhetz
Still no progress on this? CSApprox doesn't quite cut it, it gets some stuff really wrong:
screen shot 2013-09-21 at 12 34 55 pm

Loving it on MacVim, but sadly I don't use MacVim 99% of the time. :/

@mukiwu
Copy link

mukiwu commented Sep 29, 2013

same question for me, hope this color scheme can have non GUI version

@morhetz
Copy link
Owner

morhetz commented Oct 3, 2013

This should be fixed with the latest commit f2efaec. I'll provide updated documentation and term-autodetection a little bit later. If your term doesn't handle italic text then it's displayed inverted. In this case you should put this string to vimrc before setting colorsheme:
let g:gruvbox_italic=0

Also "let g:gruvbox_termcolors=16" will use base 16-color palette for most colors, which is handy if your term-theme uses gruvbox colors, and also it provides you more accurate result. This would be the recommended way to use gruvbox at term. See "Palette" section at colorscheme file for details. I think I'll keep this issue opened for a while.

@greduan
Copy link

greduan commented Oct 3, 2013

@morhetz Awesome, thanks!

So for us to be able to use it on a terminal we would need to use a Gruvbox terminal theme correct?

@morhetz
Copy link
Owner

morhetz commented Oct 3, 2013

@greduan
Not quite right. By default it will act as usual 256-color theme. But colors wouldn't be that vivid due to 256-palette.
Otherwise you could set g:gruvbox_termcolors option to use your terminal colorscheme for most of base colors, specifically:
dark0 = black (# 0)
light4 = light-gray (# 7)
medium = gray (# 8)
red = bright-red (# 9)
green = bright-green (# 10)
yellow = bright-yellow (# 11)
blue = bright-blue (# 12)
purple = bright-magenta (# 13)
aqua = bright-cyan (# 14)
light1 = white (# 15)
In this case you could overload base-16 terminal palette to make colors more accurate.

There is a third way, i didn't mentioned. If you use urxvt-256-xresources you could overload 256-palette instead of switching to 16 colors. E.g.:
URxvt.color167: #fb4934
URxvt.color142: #b8bb26
URxvt.color214: #fabd2f
URxvt.color109: #83a598
URxvt.color175: #d3869b
URxvt.color108: #8ec07c
URxvt.color208: #fe8019
etc.

As I've already mentioned I'm going to update documentation soon. Do I recomend you to switch term colortheme to gruvbox and use g:gruvbox_termcolors=16 option? Sure. Do you have to? Nope, but colors wouldn't be that precise using default 256 palette.

@morhetz
Copy link
Owner

morhetz commented Oct 3, 2013

Default 256 colors
gr256

Using 16-color palette from gruvbox terminal colorscheme
gr16

P.S. Yep, as you can see I've failed at highlighting comment title; oughta fix this.

@greduan
Copy link

greduan commented Oct 3, 2013

I don't know why but fold colors are weird in 256 color mode:
screen shot 2013-10-03 at 10 04 42 am

Comments have exactly the same problem. For some reason it isn't invisible (or doesn't use same background as everything else:
screen shot 2013-10-03 at 10 13 59 am

I'm using iTerm 2 on Mac OS X 10.7.

@greduan
Copy link

greduan commented Oct 3, 2013

@morhetz Also damn you for being able to use Arch Linux. ;) Wish I could but this Mac makes it a royal pain in the ass.

@morhetz
Copy link
Owner

morhetz commented Oct 3, 2013

@greduan
That's probably because iTerm doesn't handle italic text and displays it inverted. Have you tried putting this string to disable italics to vimrc before setting colorsheme on?

let g:gruvbox_italic=0

I know, I know - I should put some term-detection and auto-disable italics if it's not rxvt.
BTW, I quit using Arch and moved to Debian sid (unstable) for about a half year and not going back :)

@greduan
Copy link

greduan commented Oct 3, 2013

That can happen. Wow all right. Fixed that. I miss urxvt. :(

Also what made you quit Arch? It is still my favorite distro of Linux, only problem is that it's practically impossible to use it on a Mac. At least within a reasonable time frame.

@morhetz
Copy link
Owner

morhetz commented Oct 4, 2013

@greduan
First of all, I can't say better then Allan McRae. Second reason was moving to mobile development: while Ubuntu is the most popular distro, every dev-software is provided with at least deb-package (and it's not just about development, there are a tons of deb-packages, sue you AUR). And sid just feels right. It runs smooth on my Elitebook Folio, I had no hw-related problems except TrackPoint driver (Synaptics TrackPoint is common problem). I've got used to apt-get faster then I expected. Speaking briefly Debian unstable has all Arch advantages without having inconveniences.

As far as I can see you've decided to use 256-color palette. Would you mind testing this experimental script gist:6822769 in iTerm? It should overload 256-palette same way urxvt-256-xresources would do, but using ANSI-escape codes instead.

UPD.: Could you please try it inside tmux and w/o tmux? If it doesn't help you could try replacing every "\e" with "\x1B" as pointed here.

@greduan
Copy link

greduan commented Oct 4, 2013

Well it doesn't give me any errors, whether I use \e or \x1B.

Should I see any visible changes or is it just minor changes in the Vim theme?

@morhetz
Copy link
Owner

morhetz commented Oct 4, 2013

@greduan
Hmm. Yep it should be visible but the difference shouldn't be edgy. It's not changing vim theme - just overloading system colors. Especially changes in red color should be noticeable (compare red in my screenshots above). You could run side by side vim in iTerm and MacVim: before running script in term default 256-colors theme should be slightly pale-gray and differ from the MacVim. After running scripts their colors should be exactly the same.
Have you tried it inside tmux and when tmux isn't running?

@greduan
Copy link

greduan commented Oct 4, 2013

Oh yeah I notice that. It is so much prettier now. lol

And yes it does work with tmux and without tmux.

@morhetz
Copy link
Owner

morhetz commented Oct 4, 2013

@greduan
That's great! Thank you. The only thing: it drops color every time you restart term, so it'll be useful to start this script from .bashrc//.zshrc. I'll add this file to gruvbox repo, so if you are using Vundle or Neobundle it could be runned with something like

~/.vim/bundle/gruvbox/gruvbox_256palette.sh

@greduan
Copy link

greduan commented Oct 4, 2013

All right. Yeah I added it to my .zshrc already. :)

Perhaps it would be smart to have two versions of the file, one with \e and another with \x1B.

@morhetz
Copy link
Owner

morhetz commented Oct 4, 2013

@greduan
Which version have you added to zshrc, with \x1B? Does \e works the same way for OS X? If so I suppose they've fixed escape sequence and I'll keep only \e version at repo until any related issues occurs (if so) and document this situation at README file. Otherwise, for sure, I'll add both.

@greduan
Copy link

greduan commented Oct 4, 2013

I am using the \x1B version. I'll try it with \e right now... Yeah with \e it doesn't seem to work...

@morhetz
Copy link
Owner

morhetz commented Oct 4, 2013

Ok, thank you again, I'll add \x1B version.

@greduan
Copy link

greduan commented Oct 4, 2013

You're welcome. :) Thanks for making this awesome theme. :)

@krzkrzkrz
Copy link

Hmm seems to work in ubuntu as well now. When you said "Using 16-color palette from gruvbox terminal colorscheme" at #4 (comment) where do you suggest we set 16 color settings?

@greduan
Copy link

greduan commented Oct 9, 2013

@krzkrzkrz Those 16 colors are set by the theme your terminal app is using

@krzkrzkrz
Copy link

Manually changing each color palette in gnome terminal -> preference. Is there a better way? Plus hard to identify the colors you are suggesting. i.e. what is "grey"? There are a few shades of grey.

Good job on the theme. I like it a lot. One other suggestion, would be to change the cursor background color when it is over a highlighted searched term. Does that make sense?

For example. I search for "foo". It highlights all text with "foo". The background color it assigns it is yellow. If I move my cursor on top of any "foo" word. The cursor turns black, which makes it look like the cursor went away.

@greduan
Copy link

greduan commented Oct 9, 2013

@krzkrzkrz There is no better way AFAIK, unless you know how to edit the colorscheme file for your terminal directly. So until there's a theme someone makes using these colors this is the best way. :/

@morhetz
Copy link
Owner

morhetz commented Oct 10, 2013

@krzkrzkrz

  1. On Linux you could modify your Xresources file and set Terminal to use system colors. I've specified colors indexes ahd shades of grey already.
  2. The most recommended way using gruvbox at terminal is 256-color palette with gruvbox_256palette.sh shell-script set up at your bashrc (thanks to @greduan for testing and inspirations)
  3. There is already issue#2 on search highlighting. Please be patient and don't mess all things at one issue. It's more convinient to create separate issues for each bug/suggestions/etc.

@blueyed
Copy link
Contributor

blueyed commented Dec 8, 2013

@greduan @morhetz
is this supposed to work from inside of tmux?
It does not for me.

And it seems like it needs a special sequence: printf_template="\ePtmux;\e\e]4;%d;rgb:%s\a\e" (which works)
(see http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)

I could not make it work in screen though: the doc says "Esc P" should trigger bypassing (http://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html)

Here's the gruvbox script in question: https://github.com/morhetz/gruvbox/blob/master/gruvbox_256palette.sh

blueyed added a commit to blueyed/base16-builder that referenced this issue Dec 8, 2013
This allows to change the scheme from within tmux.

From the tmux CHANGES (1.5):

  * Support passing through escape sequences to the underlying terminal by
    using DCS with a "tmux;" prefix.

Source:
http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324

Ref: morhetz/gruvbox#4 (comment)
@morhetz
Copy link
Owner

morhetz commented Dec 9, 2013

@blueyed
It seems you're right, tmux handled it wrong. Though script works for screen correctly.
So escape sequence for screen is \eP\e]4;%d;rgb:%s\a\e\ and for tmux \ePtmux;\e\e]4;%d;rgb:%s\a\e\.

morhetz added a commit that referenced this issue Dec 9, 2013
@morhetz morhetz closed this as completed Dec 9, 2013
blueyed added a commit to blueyed/gruvbox that referenced this issue Dec 9, 2013
Also use POSIX shell syntax: lighter and the script might be sourced.

Ref: morhetz#4
@blueyed
Copy link
Contributor

blueyed commented Dec 9, 2013

@morhetz
Yes, screen handles it correctly. I was just using TERMscreen-256color-bce myself.
See my pull request.

@morhetz
Copy link
Owner

morhetz commented Dec 9, 2013

@blueyed
Awesome, thanks!

@blueyed
Copy link
Contributor

blueyed commented Oct 31, 2014

FWIW: I've learnt that tmux should be able to handle this normally, per pane, and that only GNU screen needs these escape codes to be wrapped: https://github.com/chriskempson/base16-builder/pull/189

Splinter1984 pushed a commit to Splinter1984/gruvbox that referenced this issue Nov 2, 2023
Splinter1984 pushed a commit to Splinter1984/gruvbox that referenced this issue Nov 2, 2023
Also use POSIX shell syntax: lighter and the script might be sourced.

Ref: morhetz#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants