Stack Overflow: Helping One Million Developers Exit Vim

OK, this one is socially funny and statistically cool – Stack Overflow question on how to exit Vim editor was viewed over a million times in the last few years.  Now, there’s a breakdown of all sorts of statistics about who gets stuck in Vim the most.  It’s pretty amazing the kind of questions and answers one can ponder at when having access to a lot of statistical data.

:wq

WordPress.vim – Vim Plugin for WordPress Development

If Vim is your editor of choice, and WordPress is something you work with on a regular basis, then check out WordPress.vim – a Vim plugin for WordPress development.

Some of the features are:

  • Auto-Completion for the WordPress API
  • WordPress Hooks Integration
  • WP-CLI Integration
  • Jump to Definition in WordPress Core
  • UltiSnips Snippets
  • Syntax Highlighting for WordPress PHP files.
  • Markdown Syntax Highlighting for readme.txt
  • PHPCS Syntax Checker integrated with WordPress Coding Standards
  • Search in Codex
  • Integration with WpSeek API.
  • Readme.txt Auto Validation.

Vim setup for PHP development

Robert Basic shares his “current Vim setup for PHP development“.  He shows how setup the Gutentags plugin, jump to definitions with CtrlP plugin, display of the current file and method in the status line, add support for PHP namespaces, improve linting with Asynchronous Lint Engine, and add support for PHPStan.

Via PHPDeveloper.

Use vimdiff as git mergetool

Ruslan Osipov has a very handy tutorial on how to setup Vim text editor as git merge tool, for resolving git conflicts.

Basically, run the following commands to tell git to use Vim as a merge tool (don’t forget the –global flag if you want it for all your projects, not just the current one):

git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false

With that, running “git mergetool” after a conflict was reported, will result in something like this:

The three way split window will show local version (–ours) on the left, the remote version (–theirs) on the right, and the base version with the conflict in the middle.  You can then get changes from one window into another using the following Vim diffget commands:

:diffg RE  " get from REMOTE
:diffg BA  " get from BASE
:diffg LO  " get from LOCAL

Awesomeness!

Check a few of Ruslan’s other vim-related articles.