Mac Vi Color



Question or issue on macOS:

I have installed MacVim but I cannot figure out how to do some formatting things.

By default, Mac OS doesn’t always have the.vimrc file and doesn’t have the syntax coloring enabled for vim. To enable the syntax coloring for vim, go to your home directory, and open or create the.vimrc file if it doesn’t already exist. Cd vim.vimrc Put the below in the.vimrc file. Filetype plugin indent on syntax on. Summary: vi and vim color settings. Whew, that seems like a lot of “vi and vim color” ground to cover in a short time - I hope it all makes sense. If you have any questions, comments, or vi color tips to share, feel free to use the comment form below. Vim 颜色设置 第三步:设置vim颜色等等。即vim指令编辑文件的模式的显示效果. 1.还是一样,进入用户主目录 cd 2.执行以下指令复制系统的vim配置文件到用户目录。 cp -r /usr/share/vim/vimrc /.vimrc. I'm working with the Vim 7.2 that comes with Mac OS 10.6.1 (Leopard), using the Mac's 'Terminal' app. I'd like to use a fancy color scheme.

The screen shot below shows:

Vim Color Setting

Mac

Here is what I would like to do:

http://torch.cs.dal.ca/~summers/Picture%205.png

This is my .gvimrc:

Change

This is the color scheme for .jak files located in (~/.vim/syntax/jak.vim):

Mac Vi Colors

How to solve this problem?

Solution no. 1:

Mac vi colored

For the font issue (in .gvimrc):

will set the font in MacVim to Menlo, size 11.

As for the syntax highlighting, it might just be that the colorscheme you are using in console vim is not being picked up by MacVim:

Mac Vi Colored

Putting this command in .gvimrc will use the xoria256 colorscheme (for example). I have found that the colorscheme setting in .vimrc are not always picked up correctly.

Solution no. 2:

If you’d like to experiment with your font settings try

That will allow you to choose a font using the standard mac font window. Once you’ve found the font you like, type:

It will show you what the current setting is for guifont. Then you can type that into your .gvimrc.

Solution no. 3:

I’m not on a mac right now so I can’t find the exact reference for you, but I found that while playing around in the menus, one can manually change some of these settings… and then to bring up the configuration file to see what those settings translate to in words. As a result, I was able to add these lines to my standard ~/.vimrc (which Macvim does read), in order to change the font:

You should be able to find similar settings for colours very nearby.
(I’ll edit this answer when I get back to my mac to add more details… you’ll have to wait ~6 hours though.)

Change Vim Comment Color

Solution no. 4:

You can change the font with this command:

The text color is a bit more complicated because it is syntax highlighting. But you can change this the same way you change the text color in any whatever version of vim you have used before. I use GVIM for Mac every day and I don’t notice any differences between it and GVIM for Windows, for example. For color schema changes might I suggest this great script:

It should give you a lot of great color schemes to try, and any of them can be easily edited, so it’s a good starting point. Good luck!

Solution no. 5:

Long story short: :h :hi (:h is a shortcut for :help, :hi for :highlight) and look for the guifg.

In your custom color scheme you define only cterm part – the guifg, guibg, etc are all missing. That’s why VIM in GUI mode is using default colors from your color scheme (:h :colo).

Hope this helps!