Reputation: 40499
I am looking for any pointers with regards to editing html with Vim.
The HTML documents I need to edit will use css (probably inline) but no JavaScript or any other "technique".
So, I thought there must be people more knowledgebale than me in that area that could give me some hints as to where I could find some tools, or scripts or Vim plugins that assist me while I am editing the documents.
FWIW, I am using Vim 7.3.
Upvotes: 3
Views: 416
Reputation: 196546
I'm happy with SnipMate. It comes with a bunch of default snippets for many languages including HTML and JavaScript but they are easy to modify/augment: here is my customized html.snippets.
SparkUp allows you to use compact CSS syntax to write massive amounts of HTML, it's a bit too rigid for my taste, though.
To be able to use Omni Completion for CSS you will need to change the "file type" setting for the buffer like this: :set ft=css.html
.
Also Vim itself is very powerful for HTML even without fancy plugins:
cit
will remove text
from <p>text</p>
and leave you in insertion mode between the opening and closing tags
dat
will delete the whole <p>text</p>
:norm I
and :norm A
let you append text at the beginning and end of multiple visually selected lines
and so on…
Upvotes: 4
Reputation: 948
Check my .vimrc
and vim config
in my git repo at github
I've spend so many weeks tweaking Vim to suit my needs to do web development in a productive way.
Upvotes: 0
Reputation: 42218
Zen plugin seems interesting to write HTML with minimal number of keystroke.
There is a nice video demonstrating how it works in the link above.
Upvotes: 1
Reputation: 74548
The surround plugin is quite useful for HTML, it makes it a lot easier to add/delete/edit sets of tags, instead of having to deal with the opening and closing tags individually.
A good article about explaining some of the things you can do with it is here: Vim Plugins You Should Know About, Part I: surround.vim
Upvotes: 1
Reputation: 1379
RagTag (documentation) is a nice plugin for HTML (and more) editing.
Also, matchit to help navigate between an opening tag and its closing tag with '%'
Upvotes: 2
Reputation: 1439
I've heard that this one is quite good, HTML/XHTML mappings for Vim it provides macros for templates, header insertion, tag insertion, and tag completion. It does supports inline CSS and includes commands to launch the a web browser and display the currently edited file.
Hope that's a start!
Kate.
Upvotes: 1