Adding PHP to VIM

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding PHP to VIM

tsai
Hello all,

I am a newer vim 7.1 user and loving it so far.  I have been used to using gui editors for php such as bluefish and Dreamweaver.  Since I use the command line a lot, I would like to know how to add php functionality to my /etc/vim/vimrc file.  I've been somewhat confused by all the info I've found googling so far.  I won't to know if/how I can code and see syntax errors for php in VIM just like with Bluefish or Dreamweaver.  Just a good guide for doing this from the terminal is what I'm looking for.  Obviously, I am choosing vim because of it's lighting speed and ease of use in a terminal environment.


Thanks,

tsai

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Adding PHP to VIM

Tony Mechelynck

tsai wrote:

> Hello all,
>
> I am a newer vim 7.1 user and loving it so far.  I have been used to
> using gui editors for php such as bluefish and Dreamweaver.  Since I use
> the command line a lot, I would like to know how to add php
> functionality to my /etc/vim/vimrc file.  I've been somewhat confused by
> all the info I've found googling so far.  I won't to know if/how I can
> code and see syntax errors for php in VIM just like with Bluefish or
> Dreamweaver.  Just a good guide for doing this from the terminal is what
> I'm looking for.  Obviously, I am choosing vim because of it's lighting
> speed and ease of use in a terminal environment.
>
>
> Thanks,
>
> tsai

You can _edit_ any language using (g)vim. You can even invoke Make from Vim
and see the errors, using the "quickfix" feature (see ":help quickfix.txt").
In addition to the make tool, many individual compilers can be used, see the
"Tools => Set compiler" menu in gvim.

The languages which can be used to _program_ Vim (i.e., to tell it what
editing tasks to do) are currently:

- Vim script
- Perl
- Python
- Ruby
- TCL
- MzScheme (vim 7.0 and higher only).

However, the first of these is preferred over all five others, for
portability: it is the only one of the six which does not depend on a
compile-time option, also the only one which requires no software other than
what is distributed with Vim.

Unless you are using some non-typically-editing functionality such as
trigonometric functions or floating-point numbers, most everything that Vim
can do can be programmed in Vim script anyway.

This said, if you want to add PHP programming functionality to Vim (and
assuming that it is sufficiently distinct from e.g. Perl), you can always take
a good hard look at the existing source and start coding. Good luck!


Best regards,
Tony.
--
God must love the Common Man; He made so many of them.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Adding PHP to VIM

Ted Pavlic
In reply to this post by tsai

> all the info I've found googling so far.  I won't to know if/how I can
> code and see syntax errors for php in VIM just like with Bluefish or
> Dreamweaver.  Just a good guide for doing this from the terminal is what

As far as I know (i.e., I have never had to install anything special for
it), the PHP syntax comes standard with Vim.

Be sure to turn on syntax highlighting/coloring:

:syntax on

You can add "syntax on" to your .vimrc to make that the default. There
are a number of different color schemes too.

You should try:

:help syntax

and

:help colorscheme

--Ted


--
Ted Pavlic <[hidden email]>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Adding PHP to VIM

Sebastian Menge
In reply to this post by tsai

Am Tue, 24 Jul 2007 11:06:52 -0700 schrieb tsai:
> the command line a lot, I would like to know how to add php
> functionality to my /etc/vim/vimrc file.  I've been somewhat confused by
> all the info I've found googling so far.  I won't to know if/how I can

See http://vim.wikia.com/wiki/Category:PHP for specific tips.

(Wow, the first real contribution _from_ the wiki ...)

Sebastian.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---