简体   繁体   English

OSX-Terminal.app + vim + solarized colorscheme

[英]OSX-Terminal.app + vim + solarized colorscheme

I know this topic is widely spread over the internet, but I have spent the whole morning searching a solution and nothing helps. 我知道这个话题在互联网上广泛传播,但我整个上午都在寻找一个解决方案而没有任何帮助。

I want to use vim in the osx-terminal with the solarized colorscheme. 我想在osx-terminal中使用vim与solarized colorscheme。

So i downloaded the solarized.vim file an copied it into /usr/share/vim/colors and wrote 所以我下载了solarized.vim文件,将其复制到/ usr / share / vim / colors中并写入

   let g:solarized_termcolors=256
   set background=dark
   colorscheme solarized 

in the .vimrc. 在.vimrc中。

In the preferences, the terminal is set to xterm-256color , but the color is still messed up. 在首选项中,终端设置为xterm-256color ,但颜色仍然混乱。

What i did, is exactly what you can find here . 我所做的,正是你在这里找到的。

So, what am i doing wrong? 那么,我做错了什么?

If you're trying to use VIM on the console, try changing the Terminal theme to Solarized. 如果您尝试在控制台上使用VIM,请尝试将终端主题更改为Solarized。

You can follow this blog post on Solarized theme for OSX : 您可以关注OSX的Solarized主题上的这篇博文

In the Terminal.app you have a few options of color schemes that you can choose from. 在Terminal.app中,您可以选择一些颜色方案选项。 We are going to install the Solarized Dark and Solarized Light themes for some human eye friendly color combinations 我们将为一些人眼友好的颜色组合安装Solarized Dark和Solarized Light主题

  1. Go to http://ethanschoonover.com/solarized in your browser 在浏览器中访问http://ethanschoonover.com/solarized
  2. Download the the latest version http://ethanschoonover.com/solarized/files/solarized.zip . 下载最新版本http://ethanschoonover.com/solarized/files/solarized.zip
  3. Unzip the package and locate the osx-terminal.app-colors-solarized folder within the extracted folder. 解压缩包并找到解压缩文件夹中的osx-terminal.app-colors-solarized文件夹。
  4. Double click on Solarized Dark ansi.terminal and Solarized Light ansi.terminal . 双击Solarized Dark ansi.terminalSolarized Light ansi.terminal

If your system then complains that it is from an unidentified developer, you have to temporarily allow applications from anywhere. 如果您的系统然后抱怨它来自一个身份不明的开发人员,您必须暂时允许来自任何地方的应用程序。 To do this go to: System Preferences > Security & Privacy > General > Allow applications downloaded from and select “Anywhere”. 要执行此操作,请转至: System Preferences > Security & Privacy > General > Allow applications从中下载System Preferences > Security & Privacy > General > Allow applications并选择“任意位置”。 Don't forget to change this back! 别忘了改回来!

  1. Select the theme in the Terminal.app preferences under Settings > Profiles. 在设置>配置文件下的Terminal.app首选项中选择主题。 You can press default to have it default selected. 您可以按默认选择默认值。

https://vi.stackexchange.com/a/3707/1145 https://vi.stackexchange.com/a/3707/1145

http://ethanschoonover.com/solarized/vim-colors-solarized http://ethanschoonover.com/solarized/vim-colors-solarized

IMPORTANT NOTE FOR TERMINAL USERS: 终端用户的重要说明:

If you are going to use Solarized in Terminal mode (ie not in a GUI version like gvim or macvim), please please please consider setting your terminal emulator's colorscheme to use the Solarized palette. 如果您要在终端模式下使用Solarized(即不是像gvim或macvim这样的GUI版本), 考虑设置您的终端模拟器的colorscheme以使用Solarized调色板。 I've included palettes for some popular terminal emulator as well as Xdefaults in the official Solarized download available from Solarized homepage. 我已经在Solarized主页上提供了官方Solarized下载的一些流行的终端模拟器和Xdefaults的调色板。 If you use Solarized without these colors, Solarized will need to be told to degrade its colorscheme to a set compatible with the limited 256 terminal palette (whereas by using the terminal's 16 ansi color values, you can set the correct, specific values for the Solarized palette). 如果你在没有这些颜色的情况下使用Solarized,则需要告知Solarized将其colorscheme降级为与有限的256终端调色板兼容的设置(而使用终端的16 ansi颜色值,您可以为Solarized设置正确的特定值调色板)。

If you do use the custom terminal colors, solarized.vim should work out of the box for you. 如果您使用自定义终端颜色,solarized.vim应该为您开箱即用。 If you are using a terminal emulator that supports 256 colors and don't want to use the custom Solarized terminal colors, you will need to use the degraded 256 colorscheme. 如果您使用的是支持256色并且不想使用自定义Solarized终端颜色的终端仿真器,则需要使用降级的256色方案。 To do so, simply add the following line before the colorschem solarized line: 为此,只需在colorschem曝光线之前添加以下行:

let g:solarized_termcolors=256

Again, I recommend just changing your terminal colors to Solarized values either manually or via one of the many terminal schemes available for import. 同样,我建议您只需手动或通过可导入的许多终端方案之一将终端颜色更改为Solarized值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM