sponsor Vim development Vim logo Vim Book Ad

tEchoPair : Display the matching parenthesis/pair in the echo area

 script karma  Rating 2/4, Downloaded by 1164  Comments, bugs, improvements  Vim wiki

created by
Tom Link
 
script type
utility
 
description
VIM is an excellent editor but in comparison too e.g. emacs it lacks a
minor feature that makes editing lisp code somewhat cumbersome. While
VIM can highlight the matching parenthesis, this doesn't help much with
long functions when the matching parenthesis is off the screen.
Emacs users are better off in such a situation, since emace displays the
matching line in the echo area.

This plugin tries to mimic Emacs's behaviour. Whenever the cursor is
placed over a parenthesis or an element of a pair the matching element is
displayed in the echo area. If 'cmdheight' is set to a value greater
than 1, additional context lines are displayed, too.


In order to enable this plugin, you choose between the following  
options:
    TEchoPairInstallBuffer ... enable for the current buffer

    call TEchoPairInstall('*') ... enable globally

    let g:tEchoPairInstall = ['lisp', 'scheme'] ... enable for certain
      filetypes


Currently, there are the following display modes:
    indicate ... Display the whole line and highlight the matching
      parenthesis. If 'cmdheight' is greater than 1, additional lines
      are display.

    inner ... Display the inner text Emacs-style.

In order to see the matching parenthesis when 'showmode' is on, set
'cmdheight' to something greater than 1.

You can select the preferred display mode on a filetype basis, by
setting g:tEchoPairStyle_{STYLE}.

Example:
    let g:tEchoPairStyle_inner = ['lisp', 'scheme']
    let g:tEchoPairStyle_indicate = ['java']


The pairs are usually deduced from the value of 'matchpairs' unless
there is an entry for the current buffer's filetype in g:tEchoPairs. For
the following filetypes custom pairs are pre-defined:
    - ruby
    - vim

BUT: It actually only works for lisp-like languages.
 
install details
Copy to ~/.vim/plugin/


Also available via git
http://github.com/tomtom/vimtlib/tree/master
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tEchoPair.vim 0.1 2007-03-27 7.0 Tom Link Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github