All Projects → Valloric → Matchtagalways

Valloric / Matchtagalways

Licence: gpl-3.0
A Vim plugin that always highlights the enclosing html/xml tags

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Matchtagalways

Primrose
A syntax-highlighting text editors that renders to an HTML5 Canvas
Stars: ✭ 451 (-12.09%)
Mutual labels:  syntax-highlighting
Zep
Zep - An embeddable editor, with optional support for using vim keystrokes.
Stars: ✭ 477 (-7.02%)
Mutual labels:  syntax-highlighting
Cudatext
Cross-platform text editor, written in Lazarus
Stars: ✭ 498 (-2.92%)
Mutual labels:  syntax-highlighting
Nord
An arctic, north-bluish color palette.
Stars: ✭ 4,816 (+838.79%)
Mutual labels:  syntax-highlighting
Soapengine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app.
Stars: ✭ 468 (-8.77%)
Mutual labels:  xml
Quick Xml
Rust high performance xml reader and writer
Stars: ✭ 480 (-6.43%)
Mutual labels:  xml
Replxx
A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.
Stars: ✭ 446 (-13.06%)
Mutual labels:  syntax-highlighting
Sublime Monokai Extended
Extends Monokai from Soda with additional syntax highlighting for Markdown, LESS, HTML, Handlebars and more.
Stars: ✭ 505 (-1.56%)
Mutual labels:  syntax-highlighting
Folder Explorer
分析文件目录,统计数据并以树形结构和图表的形式展示结果,也可以导出多种格式留存
Stars: ✭ 479 (-6.63%)
Mutual labels:  xml
Delphi Ide Theme Editor
Custom color highlighting for Object Pascal IDE's
Stars: ✭ 489 (-4.68%)
Mutual labels:  syntax-highlighting
Xmlcoder
Easy XML parsing using Codable protocols in Swift
Stars: ✭ 460 (-10.33%)
Mutual labels:  xml
Ohmyrepl.jl
Syntax highlighting and other enhancements for the Julia REPL
Stars: ✭ 466 (-9.16%)
Mutual labels:  syntax-highlighting
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (-6.24%)
Mutual labels:  xml
Zek
Generate a Go struct from XML.
Stars: ✭ 451 (-12.09%)
Mutual labels:  xml
Untangle
Converts XML to Python objects
Stars: ✭ 499 (-2.73%)
Mutual labels:  xml
Node Xml2js
XML to JavaScript object converter.
Stars: ✭ 4,402 (+758.09%)
Mutual labels:  xml
Iguana
universal serialization engine
Stars: ✭ 481 (-6.24%)
Mutual labels:  xml
Markupkit
Declarative UI for iOS and tvOS
Stars: ✭ 508 (-0.97%)
Mutual labels:  xml
Tokenizer
A small library for converting tokenized PHP source code into XML (and potentially other formats)
Stars: ✭ 4,770 (+829.82%)
Mutual labels:  xml
Log4rs
A highly configurable logging framework for Rust
Stars: ✭ 483 (-5.85%)
Mutual labels:  xml

Always highlight enclosing tags

Build Status

The MatchTagAlways.vim (MTA) plug-in for the Vim text editor always highlights the XML/HTML tags that enclose your cursor location. It's probably easiest to describe with a screenshot:

MatchTagAlways screen shot

It even works with HTML templating languages like Jinja or HTML5 use-cases like unclosed tags. It's pretty smart and should do the right thing in most cases. If it doesn't, report the problem on the issue tracker!

Installation

Use Vundle to install the plugin. You are using Vundle to manage your Vim plugins, right? Pathogen works fine too (but I recommend Vundle).

Note that the plugin requires that your copy of Vim is compiled with Python support. You can check for this with :echo has('python') in Vim. If the output is 1, then you have Python support.

After installation you should be done. The plugin should be plug & play. It will automatically turn itself on for HTML, XML and a few other HTML-like filetypes. You can also explicitly turn it on for other filetypes too (more details in the Options section).

Options

All options have reasonable defaults so if the plug-in works after installation you don't need to change any options. These options can be configured in your [vimrc script] vimrc by including a line like this:

let g:mta_use_matchparen_group = 1

Note that after changing an option in your [vimrc script] vimrc you have to restart Vim for the changes to take effect.

The g:mta_filetypes option

This option holds all the filetypes for which this plugin will try to find and highlight enclosing tags. It's a Vim dictionary with keys being Vim filetypes. The values set for those keys don't matter and are not checked, the only thing that matters is that a key is present in the dictionary (VimL has no sets).

You can find out what the current file's filetype is in Vim with :set ft?. Don't forget that question mark at the end!

Default: { 'html' : 1, 'xhtml' : 1, 'xml' : 1, 'jinja' : 1 }

let g:mta_filetypes = {
    \ 'html' : 1,
    \ 'xhtml' : 1,
    \ 'xml' : 1,
    \ 'jinja' : 1,
    \}

The g:mta_use_matchparen_group option

When set to 1, forces the use of the MatchParen syntax group. This is the same group that Vim uses to highlight parens, braces etc. This option is useful for people who want to use the same highlight color for both constructs.

When set to 0, MTA will use a custom MatchTag syntax group with a default highlight color. See the g:mta_set_default_matchtag_color option for instructions on how to change that color.

By default, this option is set to 1 because this makes it very unlikely that your colorscheme will conflict with the default colors used for the MatchTag group. It's the safe choice. Feel free to toggle this option to 0 (the author uses it like this).

Default: 1

let g:mta_use_matchparen_group = 1

The g:mta_set_default_matchtag_color option

This option only makes sense when g:mta_use_matchparen_group is set to 0. When it is, g:mta_set_default_matchtag_color option can be used to prevent MTA from overwriting any color you have set for the MatchTag group.

So, if you want to use a custom color for tag highlighting, have both g:mta_use_matchparen_group and g:mta_set_default_matchtag_color set to 0 and then set a custom color for MatchTag in your vimrc. For example, the following command would set a light green text background and a black foreground color ('foreground' is the text color):

highlight MatchTag ctermfg=black ctermbg=lightgreen guifg=black guibg=lightgreen

See :help highlight for more details on text highlighting commands.

Default: 1

let g:mta_set_default_matchtag_color = 1

Comands

You can use the plugin to also go to the closing tag if this tag is in the visible screen.

MtaJumpToOtherTag

Jumps to the enclosing tag if the tag is visible. If you are on top of an opening tag, it will jump to the closing tag. If you are on the closing tag, it will jump to the opening tag. If you are inside a tag, then it will jump to the closing tag.

Setting a mapping for this command:

nnoremap <leader>% :MtaJumpToOtherTag<cr>

FAQ

I've noticed that sometimes no tags are highlighted. Why?

The plugin only scans the lines that are visible in your window. If an opening tag is visible but the closing tag is not, no tag will be highlighted. This is for performance reasons (ie. what happens if the user opens a 10k HTML file?).

It's also possible that the plugin's parser is just out of ideas on how to extract the enclosing tags out of your text. This should be very rare though.

Contact

If you have questions, bug reports, suggestions, etc. please use the issue tracker. The latest version is available at http://valloric.github.com/MatchTagAlways/.

The author's homepage is http://val.markovic.io.

License

This software is licensed under the GPL v3 license. © 2012 Strahinja Val Markovic <[email protected]>.

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