Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac Vim: How can I change the default text color to be green? Default font? Macvim manual?

Tags:

vim

macos

macvim

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

The screen shot below shows:

  • the file class1.jak (custom file type I have defined) open in both macvim and vim
  • the left one is macvim
  • the right one is the terminal

Here is what I would like to do:

  1. The default color of my terminal is green. I would like the default text color to be green for mac vim as well.

  2. The font is strange in macvim. How can I change that.

  3. I think that both of these are very basic macvim questions but I could not find a really good mac vim reference. I read the :help macvim but I didn't find it that helpful. What should I read to understand macvim formatting and features better? Is there a tutorial somewhere? I feel pretty happy with my vim skills in general but this is the first gvim I have used.

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

This is my .gvimrc:

set background=dark
set go-=T

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

 16         "===============
 17         " Titles
 18         "===============
 19 
 20                 syn region JakeSubSubtitle start=+= + end=+ =\n+ oneline
 21                 highlight JakeSubSubtitle ctermfg=cyan guifg=cyan
 22 
 23                 syn region JakeSubtitle start=+== + end=+==+ oneline
 24                 highlight JakeSubtitle ctermbg=black ctermfg=DarkMagenta guifg=DarkMagenta
 25 
 26                 syn region JakeTitle start=+=== + end=+===+ oneline
 27                 highlight JakeTitle ctermbg=black ctermfg=Yellow guifg=yellow
 28 
 29                 syn region JakeMasterTitle start=+==== + end=+====+ oneline
 30                 highlight JakeMasterTitle cterm=bold term=bold ctermbg=black ctermfg=LightBlue guifg=LightBlue
 31 
 32         "===============
 33         " Keywords
 34         "===============
 35 
 36                 syn keyword JakeKeywords        AssQuestion Question TODO Answer JAKEHTTPS PossibleProblem Note done LowPrio
 37                 highlight JakeKeywords cterm=bold term=bold ctermbg=black ctermfg=blue guifg=blue
 38 
 39                 syn keyword JakeRedKeywords     Priority HighPriority containedin=ALL
 40                 highlight JakeRedKeywords cterm=bold term=bold ctermbg=black ctermfg=Red
 41 
 42                 syn keyword JakeLongTermKeywords ReturnTo Ask containedin=all
 43                 highlight JakeLongTermKeywords ctermfg=lightGreen
like image 346
sixtyfootersdude Avatar asked Jun 22 '10 21:06

sixtyfootersdude


2 Answers

For the font issue (in .gvimrc):

set guifont=Menlo:h11.00

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:

colorscheme xoria256

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.

like image 52
redacted Avatar answered Oct 23 '22 17:10

redacted


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

:set guifont=*

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

:set guifont=<tab>

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

like image 43
dar512 Avatar answered Oct 23 '22 19:10

dar512