LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   vim php color coding? (https://www.linuxquestions.org/questions/linux-software-2/vim-php-color-coding-168279/)

Longinus 04-09-2004 04:21 PM

vim php color coding?
 
hi

im wondering how i can get vim to color code php files

any suggestions?

thanks

wapcaplet 04-09-2004 06:05 PM

My version of vim already does this... perhaps all you need to do is tell it to apply color-coding? Check out the help system in vim (type ":help syntax" once you're in vim)

Longinus 04-09-2004 07:58 PM

ah

thanks i just typed in :syntax on

one more question:

how can i change the default color scheme?

thanks

mikshaw 04-09-2004 10:13 PM

I think you'd need to edit /usr/share/vim/<vim_version>/syntax/php.vim (or similar path)
The colors are listed at the end of the file.

Also you can permanently set syntax on in /etc/vimrc or ~/.vimrc

hw-tph 04-11-2004 05:56 AM

In addition to what mik suggested, you can also create a directory called ~/.vim and under that directory create directories for colors, syntax and plugins. Copy the files you want to change to the hierarchy you created under your home directory as these will be used instead of the global ones in /usr/share/vim, if they are present.

Also, settings are stored in ~/.vimrc and ~/.gvimrc (for the GUI version). I usually have all my general settings in ~/.vimrc and call it from my ~/.gvimrc so the settings are the same for both versions of vim. The things I define in my .gvimrc are only GUI-related. For reference, here is my ~/.gvimrc:
Code:

" Get the .vimrc settings
so ~/.vimrc
" Set color scheme
colo buttercream
"This is the XFT version of font names, if you have an old GTK 1.x version you
"+ need to use regular XFree86 font  names
set guifont=ProFontWindows\ 9

...and here is my .vimrc:
Code:

" Map Ctrl+N to (temporarily)  disable search highlighting
nmap <silent> <C-N> :silent noh<CR>
" Get rid of annoying errors when you do simple typos
map :W :w
map :Q :q

" Settings...
set softtabstop=4
set shiftwidth=4
set cindent
set ignorecase
set showmatch
set title
set showmode
set ttyfast
set wildchar=<TAB>

" Set the make program to the java compiler so you can compile
" and jump between errors inside vim
set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#

" Gentoo-portage specific stuff
if (getcwd() =~ 'gentoo-x86\|gentoo-src\|portage')
  set tabstop=4 shiftwidth=4 noexpandtab
endif


Håkan


All times are GMT -5. The time now is 11:29 PM.