Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Robert Basic:
Current Vim setup for PHP development
Feb 10, 2017 @ 17:46:10

For those out there always interested in how other developers have their development environment, Robert Basic has some info on his own setup that might interest you. In this new post to his site he shares his configuration using the Vim editor when writing PHP code.

I made some changes to my Vim setup for PHP development recently, so it’s time to write it all down. I’m more than sure that I’ll break it soon and won’t be able to remember all the things I did to have the current setup.

Some new plugins popped up on my radar, I tweaked some older plugins and I even wrote one for PHPStan!

He starts with the improvements in tag support he's found recently using the Gutentags plugin. He also covers other tools and functionality like:

  • Jump to definition
  • (Getting the ) current PHP class and method
  • PHP namespaces
  • Linting
  • A promising completion engine for PHP
  • PHPStan in Vim
  • Debugging

He finishes up the post with a few other helpful supporting plugins for indenting, searching and argument swapping.

tagged: vim editor setup development plugin programming

Link: https://robertbasic.com/blog/current-vim-setup-for-php-development/

Robert Basic:
Tags for PHP in Vim
Mar 10, 2016 @ 17:32:34

In a post to his site Robert Basic has shared some helpful plugins for PHP developers using Vim as their primary editor. These plugins not only help you jump around in your code but get more context on where you're at.

One thing I was missing for a long time in Vim is to be able to "jump to definition" in an easy and painless way. The other thing I wanted to improve is to be able to tell easily where am I actually in the code base; to see the current class and method name of wherever the cursor was.

With a bit of googling and poking around, I finally came up with a perfect combo of 5 plugins (yep, five!) that enables me to do both, and a little bit of extra.

He shows examples of using three different things he wanted to be able to do when working in his code and the plugins that satisfy each:

One line examples are included showing how to configure them with your current Vim use.

tagged: tags vim plugin jump definition context class method

Link: http://robertbasic.com/blog/tags-for-php-in-vim

Rob Allen:
Checking your code for PSR-2
Jul 28, 2015 @ 13:17:20

Rob Allen has posted a guide showing you how to make your code PSR-2 compliant with the help of some handy tools, both in and out of your editor/IDE.

Most of the projects that I work on follow the PSR-2 coding style guidelines. I prefer to ensure that my PRs pass before Travis or Jenkins tells me, so let's look at how to run PSR-2 checks locally.

He looks at three different methods - not the only ones out there but three quick to implement ones:

  • Using the PSR-2 sniffs for PHP_CodeSniffer
  • Automating the checks with Phing
  • Editor integration (he shows VIM and Sublime Text)

There's links to the tools mentioned here and screenshots/configuration information showing how to get it set up too.

tagged: psr2 code style check phpcodesniffer phing editor vim sublimetext

Link: http://akrabat.com/checking-your-code-for-psr-2/

Matthew Setter:
Can VIM Ever Replace PHPStorm?
Mar 02, 2015 @ 16:54:13

In an interesting new post to his site Matthew Setter wonders if an IDE like PHPStorm can be replaced by VIM, a standard in the editor community for decades.

Is it reasonable, even practical, to expect that a 30 year old application can match a modern one? Is it conceivable to be able to code as well using VIM, said 30 year old application, as I can in PhpStorm, with all the IntelliSense-lead functionality PhpStorm offers?

He starts with some of his recent experience with the editor and some of the things he's (happily) found it can do he didn't know before. He includes a screenshot of a multi-pane view, explains what each is and what he can do with them. He points out that this example is Markdown documents but it can just as easily be used for code too. Finally he talks about the subject any PHPStorm user wants to know about, the IntelliSense functionality. Unfortunately, while there are some tools he mentions that can do similar things, they don't provide the context PHPStorm can deliver.

He ends the post with an interesting question: is IntelliSense the right approach? He wonders if having more context is a better answer rather than just the auto-complete handling IntelliSense offers.

tagged: vim editor replacement phpstorm opinion autcomplete context screenshot

Link: http://www.matthewsetter.com/can-vim-ever-replace-phpstorm/

Chris Hartjes' Blog:
How the Testing Sausage Gets Made
May 17, 2012 @ 14:19:33

For those either just getting into unit testing your applications (maybe even TDD) or those that are old hat at it and what to figure out a few more tricks of the trade, you should check out this latest post from Chris Hartjes about some of the tools he uses to get the job done.

So how does the Grumpy Programmer write code, TDD style? It starts with using a set of tools that reduce the amount of friction required. First, I do almost all my work from a terminal. [...] Why the terminal? PHPUnit is a CLI application. Yes, many popular editors and IDE's can do things like execute PHPUnit for you, but they are limited in what flexibility they provide.

He also talks about his editor of choice, vim, and some of the plugins he uses in his day to day testing development. This includes tools to handle things like interfacing with git/gists, working with ctags to see the code's structure, working with "surroundings" and the pathogen plugin to make adding other plugins easier. He keeps the code up in one terminal and his testing tool (PHPUnit or other) accessible in a second, making it a simple matter of switching to write the test then the functionality to make it pass.

If there is a lesson to be learned from this, it's to make sure that every tool that you use reduces the friction that is generated when building your application using TDD.
tagged: testing tools vim plugins tdd unittest phpunit terminal

Link:

DZone.com:
2 years of Vim and PHP distilled
Apr 06, 2012 @ 14:50:35

On DZone.com there's a new post from Giorgio Sironi with some of his tips for PHP developers that want to use VIM in their development - some handy tricks to help make you a more effective developer.

In the case of PHP development, you'll need to add some configuration and plugins to speed up your activities. Most of the responsibilities of an IDE - like testing and version control - are outsourced to the terminal while running Vim; however, there are some tweaks that make writing and editing code faster, along with aiding in discovery classes and methods in a PHP codebase.

He includes settings for your .vimrc to detect and load the right PHP functionality, using Command-T, functionality for autocompletion and the snipMate plugin for managing and using reusable code snippets.

tagged: vim editor tips vimrc commandt snipmate autocomplete

Link:

Thijs Lensselink's Blog:
VIM for a PHP Developer
Apr 18, 2011 @ 15:57:17

Thijs Lensselink has a new post to his blog today showing a step-by-step guide to setting up a vim editor environment to provide a richer experience than the plain-text defaults for working with your PHP code.

For my coding work i mostly use Zend Studio. And i am a big fan of this IDE. But i also do a lot of work in the shell. And that asks for at least basic vim knowledge. My colleague is a big vim fan. And does most of his work in vim. So last week i was compiling a cheat-sheet for my self. And came across a slideshow of one of Andrei Zmievski's talks. This slide show got me inspired enough to start playing around with vim a bit. And this is the result of it.

He walks you through everything from scratch - installing vim, setting up some of the configuration files, grabbing some plugins to help with highlighting, adding in ctags for code completion and a plugin to give the editor more of an "IDE feel". There's a few screenshots included in the post as well, so you can be sure your environment is looking the same as his.

tagged: vim editor plugin guide screenshot configuration

Link:

Gonzalo Ayuso's Blog:
My VIM configuration for PHP development
Jan 03, 2011 @ 19:50:35

In a search for his perfect development environment (note "his" not "the") Gonzalo Ayuso has taken another look at vim in a new post to his blog with some handy plugins and commands he's found so far.

Keeping on with my continuous search for the perfect IDE I’ve resumed my fight against VIM. As someone told me the learning of vim is a road of pain. It’s something like going to the gym. We known that going to the gym is good and healthy but it’s hard and painfully especially at the beginning. The learning curve of vim is hard. [...] VIM is not my default IDE yet. I hope to swap to VIM soon but I feel myself slower when I code comparing with Netbeans or ZendStudio, and slow means less productive but I also feel if invest more time vim can be really productive.

He points out these plugins and commands:

  • NerdTree
  • the "buffer explorer"
  • using Zen Coding
  • using the debugger (along with XDebug)
  • snipMate
  • using omni completion
  • supertab
  • and a few more various, useful commands...
tagged: vim ide development opinion configuration plugin command

Link:

PHPBuilder.com:
Using Vim for Your PHP Development
Sep 23, 2010 @ 14:13:07

On PHPBuilder.com today Jason Gilmore has an introductory tutorial to using the popular vim editor for your PHP development with more that just the basic features.

When you choose a streamlined IDE, you forfeit the visual bells and whistles usually found in many commercial products but you gain the ability to write, organize and refactor code as quickly as you can type. For millions of developers around the globe, that IDE is Vim, and in this article I'll show you how Vim can help you to write PHP code faster than ever before.

He starts with the basics - what vim is and how to start it up - and shows how you can use the command-line inside of the editor to do things like a simple search and replace. He also shows how to edit multiple files, set up PHP command completion and how to use the Project plugin to make it easier to find files without having to leave the editor.

If you're looking for more detailed information on using vim in your development, check out this presentation from Andrei Zmievski or these tips from Matthew Weier O'Phinney.

tagged: vim development editor introduction

Link:

Web Builder Zone:
NetBeans vs. Vim for PHP development
Aug 30, 2010 @ 13:56:18

On the Web Builder Zone there's a recent article comparing one of the PHP IDEs growing in popularity, NetBeans, and one of the standbys of the development world, Vim. It compares how they both stack up for PHP development work by things like features, speed and ease of use.

Since this is an old religion war and it can't be solved out of context, my points will be specifically related to these programs. In this comparison, I collected examples of where Vim and NetBeans differ in behavior and performance. The point of view is that of a PHP developer, since I experienced much worse results with Unix tools while programming in other languages such as Java.

He compares them on a few different levels including overall speed, autocompletion, portability, ease of use, codebase navigation and versatility. There's no "better than" judgment here, just a good look at what each tool has to offer. What it really boils down to, of course, is personal preference. These are just two of the many possibilities out there (like PHP Storm, Eclipse PDT or Zend Studio).

tagged: netbeans ide development vim compare feature

Link:


Trending Topics: