All Projects → dsawardekar → Wordpress.vim

dsawardekar / Wordpress.vim

Licence: mit
Vim Plugin for WordPress Development

Labels

Projects that are alternatives of or similar to Wordpress.vim

Vim Js Context Coloring
JavaScript Context Coloring in Vim
Stars: ✭ 149 (-9.15%)
Mutual labels:  viml
Vim Operator Flashy
🔦 Highlight yanked area
Stars: ✭ 156 (-4.88%)
Mutual labels:  viml
Vim Config Python Ide
Symlink the .vim dir and the .vimrc file and start kicking ass
Stars: ✭ 159 (-3.05%)
Mutual labels:  viml
Vim Jekyll
📝 Fork of psykidellic/vim-jekyll because actually forking it freaks out
Stars: ✭ 151 (-7.93%)
Mutual labels:  viml
Vim Flavored Markdown
Stars: ✭ 153 (-6.71%)
Mutual labels:  viml
Pdv
PHP Documentor for VIM - Generates PHP docblocks
Stars: ✭ 158 (-3.66%)
Mutual labels:  viml
Matchit.zip
extended % matching for HTML, LaTeX, and many other languages
Stars: ✭ 146 (-10.98%)
Mutual labels:  viml
Vim Github Comment
Comment commits on GitHub using Vim
Stars: ✭ 162 (-1.22%)
Mutual labels:  viml
Vim Project
lcd to the root of the project everytime you BufEnter a file inside a project.
Stars: ✭ 155 (-5.49%)
Mutual labels:  viml
Vimerl
A set of erlang plugins for VIM. This is not maintained, better use som modern fork of this!
Stars: ✭ 159 (-3.05%)
Mutual labels:  viml
Vimside
Vim Scala IDE (VimSIde) built upon ENSIME
Stars: ✭ 151 (-7.93%)
Mutual labels:  viml
Vim Tmuxify
Vim plugin for handling tmux panes.
Stars: ✭ 152 (-7.32%)
Mutual labels:  viml
Vim As An Ide
Workshop on how to use Vim Plugins.
Stars: ✭ 1,915 (+1067.68%)
Mutual labels:  viml
Mru.vim
Plugin to manage Most Recently Used (MRU) files
Stars: ✭ 149 (-9.15%)
Mutual labels:  viml
Vim Indentwise
A Vim plugin for indent-level based motion.
Stars: ✭ 160 (-2.44%)
Mutual labels:  viml
Tlib vim
Some utility functions for VIM
Stars: ✭ 147 (-10.37%)
Mutual labels:  viml
Vim Galore
🎓 All things Vim!
Stars: ✭ 12,610 (+7589.02%)
Mutual labels:  viml
Paredit.vim
Paredit Mode: Structured Editing of Lisp S-expressions
Stars: ✭ 162 (-1.22%)
Mutual labels:  viml
Vim Operator User
Vim plugin: Define your own operator easily
Stars: ✭ 161 (-1.83%)
Mutual labels:  viml
Vim Markbar
Display all accessible marks and their surrounding lines in a collapsible sidebar.
Stars: ✭ 159 (-3.05%)
Mutual labels:  viml

WordPress.vim

Vim Plugin for WordPress Development

Features

  • 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.

Auto-Completion

WordPress.vim extends phpcomplete.vim to provide Auto-Completions for WordPress PHP files. If you have phpcomplete.vim installed no additional configuration is required.

The demo below shows Auto-Completion of the WP_Query class and other API functions.

Auto Completion

See :h wordpress-auto-completion for more.

WordPress Hooks Integration

WordPress.vim has close integration with the WordPress action and filter hooks. This feature uses ctags and is further enhanced with the presence of CtrlP.vim.

The demo below shows navigation to a few hooks with the ex commands :Waction and :Wfilter and their CtrlP variants, :CtrlPaction and :CtrlPfilter.

WordPress Hooks Integration

See :h wordpress-hooks-integration for more.

WP-CLI Integration

WordPress.vim is closely integrated with WP-CLI. You can easily run WP-CLI commands without leaving Vim. It maps the wp {command} to Vim's Ex commands of the form :W{command}.

The demo below shows :Wscaffold plugin in action. Also seen are the :Weval and :Wplugin commands.

WP-CLI Plugin Scaffold

See :h wordpress-wp-cli for more.

Jump to Definition in Core

Jump to Core takes you to the implementation of a function in Core. You can easily move around the code base and return once you've figured out what you need.

The demo below starts out in a theme then jumps to different Core functions and finally returns back to the starting point.

Jump To Core

See :h wordpress-jump-to-core for more.

UltiSnips Snippets

WordPress.vim comes with a few useful snippets to speed up common WordPress development tasks. Snippets require the UltiSnips snippets engine plugin to be installed.

A Snippet is like an interactive Web Form. Once you enter a Snippet you are put at the first placeholder. As you start typing the placeholder changes and also affects any dependent placeholders. You can cycle back and forth between placeholders and Escape out when done.

The demo below shows the theme header snippet in action.

themeheader snippet

See :h wordpress-snippets for more.

Syntax Highlighting

WordPress.vim extends the default PHP syntax highlighting with support for the WordPress API. Importantly it highlights the use of any deprecated function as Errors.

Note the highlighting of the deprecated is_taxonomy function.

Deprecate is_taxonomy

Additionally the readme.txt found in WordPress files is highlighted as Markdown.

See :h wordpress-syntax-highlighting for more.

Search in Codex

The :Wcodexsearch Ex command provides searching for keywords on the Codex. When arguments are omitted it uses the current Visual selection or the word under the cursor to query for.

For faster searches, You can map this to a key sequence like, <leader>co with,

:nnoremap <leader>co :Wcodexsearch<CR>

WpSeek.com Integration

WordPress.vim integrates with the WpSeek API. This allows searching using the wpseek api directly from within Vim.

The demo below shows the :Wsimilar Ex command in action.

Wsimilar demo

see :h wordpress-wpseek-integration for more.

Getting Started

The repository includes a minimal Vimrc for trying out WordPress.vim without affecting your existing Vim configuration. Plugin management is done with Vundle.

First backup your existing vimrc.

$ mv ~/.vimrc ~/.vimrc_backup

Then download the minimal vimrc to a temporary directory like /tmp/wordpress_vim.

$ mkdir -p /tmp/wordpress_vim
$ wget -O /tmp/wordpress_vim/vimrc https://raw.githubusercontent.com/dsawardekar/wordpress.vim/develop/examples/minimal_vimrc.vim

Link the tmp vimrc to your $HOME vimrc.

$ ln -s /tmp/wordpress_vim/vimrc ~/.vimrc

Now start Vim.

The first time the vimrc will download Vundle to the /tmp/wordpress_vim directory and then proceed to install the required plugins using Vundle. Plugins will be installed in the subdirectory /tmp/wordpress_vim/bundle.

Installation may take a few minutes. Once completed you will have a custom vim configuration separate from your existing one.

To move to your old configuration simply link your backup vimrc back to the $HOME vimrc.

Installation

1. With Vundle

Plugin 'dsawardekar/wordpress.vim'

2. With NeoBundle

NeoBundle 'dsawardekar/wordpress.vim'

3. With Pathogen

git clone https://github.com/dsawardekar/wordpress.vim ~/.vim/bundle/wordpress.vim

System Requirements

WordPress.vim requires Vim 7.3p97+ with Python support.

WordPress.vim uses Progressive Enhancement to enable/disable features. This means that the features that depend on other plugins/external tools are only enabled if their presence is detected. A missing requirement will not affect the behaviour of the rest of the plugin.

It is highly recommended to install the following plugins to get the best experience.

Additionally the following tools enhance WordPress.vim.

  • WP-CLI - Enables :W ex commands & automatic WordPress path lookup.
  • Exuberant CTags - Enables the Jump to Core Definition feature

To install ctags,

  • On Ubuntu, use apt-get install exuberant-ctags
  • On Mac, use brew install ctags

Thanks

WordPress.vim builds on top a number of other excellent Projects. Many Thanks in particular to,

  • Shawn Biddle - for phpcomplete.vim
  • Cristi Burcă - for WP-CLI
  • Luke Gruber - for Riml
  • Oliver Schlöbe - for the WpSeek API
  • Sudar Muthu - for the Syntastic Integration.

Contributing

WordPress.vim needs the help of the WordPress community to keep improving. Please consider joining this effort by providing new snippets, new features or bug reports.

If you find that a feature is missing or find a bug, please contact me or and add an issue to the issues tracker.

For further details on setting up a development environment for WordPress.vim and the implementation of the plugin see CONTRIBUTING.md.

TODO

  • WordPress Hook Integration DONE
  • Find current word in Codex DONE
  • Highlight Constants DONE
  • Improve snippets
  • Integrate with the wpseek.com API DONE
  • Improve Javascript Support
  • Figure out how to run WP-CLI shell commands. DONE
  • WPSE integration.

License

MIT License. Copyright © 2014 Darshan Sawardekar.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].