Skip to content

Neovim/vim8 plugin to highlight surrounding braces.

License

Notifications You must be signed in to change notification settings

djdt/pyparens.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyparens.nvim

Neovim / vim8 plugin to highlight surrounding braces / scope.

As it works using python regexes you can highlight any type of pair that you want.

Column highlighting can be enabled to easily identify the scope over multiple lines.

Usage image parens Usage image words

Installation

Using vim-plug:

Plug 'djdt/pyparens.nvim'

Be sure to :UpdateRemotePlugins if using Neovim, this can be acheived using Plug:

Plug 'djdt/pyparens.nvim', {do: ':UpdateRemotePlugins'}

Options

To set the highlight group use g:pyparens_hl_group:

let g:pyparens_hl_group = 'MatchParen'

The leftmost column of the current block will be highlighted if g:pyparens_hl_col_group is set.

Use g:pyparens_pairs to set the types of pairs highlighted. Each pair is a list of python regexes for opening and closing words.

g:pyparens_ft_pairs can be used to set additional pairs used only for specific filetypes.

As an example:

let g:pyparens_pairs = [[ '\{', '\}' ], [ '\(', '\)' ], [ '\[', '\]' ]]

let g:pyparens_ft_pairs = {
		\ 'cpp': [['(?<!\<)\<(?!\<)', '\>']],
		\ 'vim': [['\bif\b', '\bendif\b', '\bfor\b', '\bendfor\b']]
		\}

Inspired by matchparenalways.vim and MatchTagAlways.

About

Neovim/vim8 plugin to highlight surrounding braces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published