LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-09-2004, 04:21 PM   #1
Longinus
Member
 
Registered: Sep 2003
Distribution: Redhat 9.0 && Slackware 9.1
Posts: 420

Rep: Reputation: 30
Question vim php color coding?


hi

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

any suggestions?

thanks
 
Old 04-09-2004, 06:05 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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)
 
Old 04-09-2004, 07:58 PM   #3
Longinus
Member
 
Registered: Sep 2003
Distribution: Redhat 9.0 && Slackware 9.1
Posts: 420

Original Poster
Rep: Reputation: 30
ah

thanks i just typed in :syntax on

one more question:

how can i change the default color scheme?

thanks
 
Old 04-09-2004, 10:13 PM   #4
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
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
 
Old 04-11-2004, 05:56 AM   #5
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VIM Color Syntax Highliting bsg Linux - Newbie 5 10-07-2005 08:31 PM
Yast/You Color coding linda SUSE / openSUSE 1 08-22-2005 06:07 PM
vim color highlighting new_user10 Programming 9 11-02-2003 12:40 PM
Color Coded Vim podollb Linux - Software 5 10-16-2003 04:52 PM
Shell and file/directory color coding? l0f33t Linux - General 9 08-07-2003 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration