Akbar wrote:
Hi,
I have this part of html file:
<div id="bu">
<p>haha</p>
</div>
The cursor is in first line (the opening div). When I hit certain key,
the cursor will go to the third line (the closing div). There is a
script to achieve this. I just forgot the name. Could you tell me the
name?
Thank you.
matchit. It is distributed with Vim but not installed by default, because it
conflict with the "vi" use of the % key. To install it, use the following
shell commands in an xterm or Dos Box:
- On Unix/Linux:
cd $HOME
mkdir -vp .vim/plugin
mkdir -vp .vim/doc
cd .vim/plugin
ln -vs /usr/local/share/vim/vim70/macros/matchit.vim
cd ../doc
ln -vs /usr/local/share/vim/vim70/macros/matchit.txt
vim --cmd "helptags . |quit"
- On Windows (untested):
cd %HOMEDRIVE%%HOMEPATH%
if not exist vimfiles md vimfiles
if not exist vimfiles\plugin md vimfiles\plugin
if not exist vimfiles\doc md vimfiles\doc
copy con vimfiles\plugin\matchit.vim
runtime macros/matchit.vim
^Z
copy "C:\Program Files\Vim\vim70\macros\matchit.txt" vimfiles\doc
gvim --cmd "helptags ~/vimfiles/doc |quit"
where ^Z means "hit the Ctrl-Z key to close the file being typed-in at the
console".
Once matchit is installed, then starting at the next Vim startup, (1) hitting
% will go shuttle between < and > of the <div> tag, or between <div> and
</div>, depending on the cursor position within the tag, and (2) ":help
matchit.txt" will give you more details about how to use it.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
106. When told to "go to your room" you inform your parents that you
can't...because you were kicked out and banned.