Useful Vim plugins for web development and design (php, html, css, javascript)?

JavascriptVimPlugins

Javascript Problem Overview


Right now I'm using surround.vim to enclose text in HTML tags, and a plugin that highlights text according to the hex value in the CSS file (e.g. #888 will have gray background in the CSS file).

Are there other useful plugins for web development?

Recommendations

Here is a list of the plugins mentioned in the answers so far:

Javascript Solutions


Solution 1 - Javascript

I've written answers for this question and this question explaining how to get JavaScript syntax checking / linting and source-code browsing / tag-list for Vim using the community-driven jshint.com (which is way better than JSLint IMO) and Mozilla's DoctorJS (formerly jsctags).

Solution 2 - Javascript

I find Syntastic to be fairly helpful in spotting minor PHP problems. (and/or blend it with some form of setting php -l as :make.) Syntastic also shows you tidy warnings on your html.

Solution 3 - Javascript

How about JSLint right in VIM, http://github.com/hallettj/jslint.vim ?

Solution 4 - Javascript

Here are the plugins I'm currently using as well as some vimrc mappings to make things a bit easier.

Plugins

Pathogen is an essential vim plugin for every user. It helps keep all the plugins you need organized within their own directories. This makes it much easier to uninstall plugins at a later time, since your plugins don't all live in the same tree. Pathogen will handle adding everything together at runtime.

Command-T adds the popular textmate feature that makes it easy to open files.

Snipmate gives vim the power of textmate like snippets.

Sparkup adds zencoding to vim to make it faster and easier to write HTML.

NERDCommenter makes it easy to toggle commented blocks of code.

Syntastic adds syntax checking to lots of different file types, and if vim has signs support enabled, you get markers to the left of your line numbers telling you where your errors are.

.vimrc config settings

Encode/Decode HTML to HTML Entities (Great for writing documentation)

"EASILY ESCAPE OR UNESCAPE HTML
function HtmlEscape()
  silent s/&/\&/eg
  silent s/</\&lt;/eg
  silent s/>/\&gt;/eg
endfunction

function HtmlUnEscape()
  silent s/&lt;/</eg
  silent s/&gt;/>/eg
  silent s/&amp;/\&/eg
endfunction

map <silent> <c-h> :call HtmlEscape()<CR>
map <silent> <c-u> :call HtmlUnEscape()<CR>

Toggle Relative Line Numbers (new VIM 7.3 feature)

function! g:ToggleNuMode() 
  if(&rnu == 1) 
    set nu 
  else 
    set rnu 
  endif 
endfunc
nnoremap <C-L> :call g:ToggleNuMode()<cr>

Highlight unwanted whitespace

"HIGHLIGHT POTENTIALLY UNWANTED WHITESPACE
highlight BadWhitespace term=standout ctermbg=red guibg=red
match BadWhitespace /[^* \t]\zs\s\+$\| \+\ze\t/

Solution 5 - Javascript

Solution 6 - Javascript

ctags aka Exuberant ctags

A blog post about it.

That blog post also mentions the taglist plugin, which I have yet to use.

Solution 7 - Javascript

Solution 8 - Javascript

Very helpful when dealing with html or xml: surround.vim; it allows to easily add/delete/change any kind of tags.

Solution 9 - Javascript

Adapted by someone else from a couple of functions of mine (in turn adapted from others), this plugin allows you to turn "special" characters into HTML entities (and back) or URL Escapes (and back).

This is extremely useful when writing stupid HTML Emails.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionalexchencoView Question on Stackoverflow
Solution 1 - JavascriptOry BandView Answer on Stackoverflow
Solution 2 - JavascriptJamey PearceView Answer on Stackoverflow
Solution 3 - JavascriptLuca MatteisView Answer on Stackoverflow
Solution 4 - JavascriptBrian WiggintonView Answer on Stackoverflow
Solution 5 - JavascriptDrasillView Answer on Stackoverflow
Solution 6 - JavascriptGeorge MarianView Answer on Stackoverflow
Solution 7 - JavascriptFlavius StefView Answer on Stackoverflow
Solution 8 - JavascriptmatiasView Answer on Stackoverflow
Solution 9 - JavascriptromainlView Answer on Stackoverflow