I just switched form Espresso to Vim for my programming work. I'm using the pre-installed version of Vim on my OS X 10.6. I changed the vimrc file in /usr/share/vim to:
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
set number " show line number
colorscheme desert
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
I also copied the desert.vim file to ~/.vim/colors, but vim still is only showing the default colorscheme.
I'd also like syntax heighlighting for PHP, HTML5, CSS3, JavaScript. Do I have to download this seperatly or are is this already installed in the default installation of Vim?
Is this the right stackexchange site for such questions? Or is the Apple Stackexchange site better for such questions?
:runtime syntax/colortest.vimAfter executing:colorscheme desert, does the output of:scriptnamesincludedesert.vim? What do the first lines of:versionshow? – garyjohn Jun 14 '11 at 15:53:runtime syntax/colortest.vimwith the default color scheme, the command shows colors matching there names. After running:color scheme desert, and then:scriptnames,desert.vimis included in the list (among other color schemes I added). The first line of:versionshowsVIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 24 2011 20:00:09). – wowpatrick Aug 6 '11 at 10:54:runtime syntax/colortest.vimseemed to work, it looks like syntax highlighting basically works for you. If it didn't, I thought there might be a clue in the output of:version, specifically the first four lines which contain the version of Vim and a summary of the way it was built, e.g., as a Normal version. If you execute:colorscheme desertand the output of:scriptnamescontains colors/desert.vim as the last file from any colors directory, then you should see the desert color scheme. I'm not sure what could be going wrong. What does:echo colors_nameshow? – garyjohn Aug 6 '11 at 22:22echo colors_name. Why do the two color schemes look different? – wowpatrick Aug 7 '11 at 22:55