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

how install it on mac osx #23

Closed
xiangyuan opened this issue Apr 8, 2014 · 9 comments
Closed

how install it on mac osx #23

xiangyuan opened this issue Apr 8, 2014 · 9 comments

Comments

@xiangyuan
Copy link

how install it on mac osx

@greduan
Copy link

greduan commented Apr 8, 2014

You're right, it doesn't provide any instructions for users that may be new.

This may help: http://stackoverflow.com/questions/4905554/managing-vim-plugins

@morhetz
Copy link
Owner

morhetz commented Apr 8, 2014

Well I'm not good at explaining things but I'll have a try to sum things up. Until the last moment I was hoping someone would help me with writing a good documentation.

First of all let's start with basics. Pick your favorite plugin manager: Pathogen, Vundle, NeoBundle or vim-plug, just to name a few. Pathogen is the oldest, simplest, and most featureless. Vundle is very popular and I've used it for a long time before. If you're using some of Shougo's plugins, you should probably pick NeoBundle. Last but not least is vim-plug, which I've recently switched to.

  • Pathogen
    • git clone https://github.com/morhetz/gruvbox.git ~/.vim/bundle/gruvbox
  • Vundle
    • Add Bundle 'morhetz/gruvbox' to your .vimrc and run :BundleInstall
  • NeoBundle
    • Add NeoBundle 'morhetz/gruvbox' to your .vimrc and run :NeoBundleInstall
  • vim-plug
    • Add Plug 'morhetz/gruvbox' to your .vimrc and run :PlugInstall

Then add the line colorscheme gruvbox to your .vimrc file, and restart vim.

@morhetz
Copy link
Owner

morhetz commented Apr 8, 2014

If you're using GUI version of vim that should be enough. Otherwise let me guide through the hell of terminal specific issues.

First of all you should check this as how it shouldn't look:
Screenshot

Issues

1. Italics gets inverted

Most terminals doesn't handle italics so the text, that must be italicized, instead goes inverted. To prevent that disable g:gruvbox_italic option at your .vimrc:

if !has("gui_running")
   let g:gruvbox_italic=0
endif

2. Colors are off

By default gruvbox will act as usual 256-color theme, but colors wouldn't be that vivid due to limitations of 256-palette. Compare the wrong screenshot above with README preview or any from the Gallery. The difference isn't edgy, but pretty visible enough (changes in red color and shades of gray should be most noticeable). You could run side by side vim in terminal and GUI version.

There are three possible ways to get right colors at the terminal:

  • using 256-color gruvbox palette shellscript
  • using terminal 16-color base colorscheme
  • using urxvt-256-xresources
a. (Recommended) 256-color gruvbox palette shellscript

Gruvbox contains shellscript (default and osx-iterm2 versions), which would overload system default 256-color palette with precise gruvbox colors. Try running terminal vim before and after executing this script to check the difference. To avoid the necessity to reexecute it each time you're opening terminal, you should start this script from .bashrc//.zshrc//.profile either like this:

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

or, using osx-iterm version:

~/.vim/bundle/gruvbox/gruvbox_256palette_osx.sh

where ~/.vim/bundle/ is your preferred plugin manager bundles installation path

@morhetz
Copy link
Owner

morhetz commented Apr 8, 2014

b. terminal 16-color base colorscheme

This is a loose solution as you should set gruvbox as your terminal colorscheme and only 10 main colors of the whole gruvbox palette would be overloaded. But in the case of troubles with gruvbox-shellscript this is the only way to get precise colors at the terminal. First of all, let's define g:gruvbox_termcolors option at your .vimrc:

let g:gruvbox_termcolors=16

This way gruvbox would pick base colors right from your terminal colorscheme. Refer color.table for gruvbox ↔ termcolors correlation.
Next thing you'd need is gruvbox terminal colorscheme. You could pick both dark and light Xresources versions from gruvbox-generalized repo. iTerm2 colorschemes are also there.

c. urxvt-256-xresources

If you're on Arch Linux and using urxvt-256-xresources you could try setting 256-color gruvbox palette at your Xresources same way as it's provided at gruvbox-generalized repo. Take a look at gruvbox-urxvt256.xresources for details. This should do the same thing as gruvbox 256-color palette shellscript, but the result would be fixed to urxvt only.

Troubleshooting

1. Effect of gruvbox_256palette.sh gets reset on Alt-Tab

That's known issue with Ubuntu GTK-themes and//or VTE-based terminals. Refer for more details. Known affected terms are Gnome Terminal, Terminator and Lilyterm and probably more VTE-based. Though, with Lilyterm option 'Dim text when inactive' set off, everything works fine. There is no known solution//workaround to fix this. If you're disappointed with such behavior, please report issues to terminal developers, there no thing I can currently do with that.

@morhetz morhetz closed this as completed Apr 8, 2014
@mad0ba
Copy link

mad0ba commented Dec 18, 2015

When i Add Bundle 'morhetz/gruvbox' to your .vimrc and try to run :BundleInstall it tells me command not found. Could you please give me a more detailed step by step procedure, cause im new to all of this

@morhetz
Copy link
Owner

morhetz commented Dec 20, 2015

@Mardii-D-King it was changed to Plugin and :PluginInstall
Refer wiki and Vundle for details

@nabn
Copy link

nabn commented Jul 4, 2016

For me, the gruvbox shell script worked, but only for the current session (iterm 3.0.0).
i put it up on .zshrc to run the script on new terminal open

@morhetz
Copy link
Owner

morhetz commented Jul 4, 2016

@nabn That's exactly what wiki suggests to

To avoid the necessity of reexecuting it each time you're opening terminal, you should start this script from .bashrc//.zshrc//.profile either

@nabn
Copy link

nabn commented Jul 4, 2016

Haha.. my bad. didn't even see that there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants