Dynamic pattern for vim highlight -


in vim help, there suggestion use highlight groups highlighting text greater textwidth:

another example, highlights characters in virtual column 72 , more: :highlight rightmargin term=bold ctermfg=blue guifg=blue :match rightmargin /.\%>72v/

i reflect value of texwidth setup. like:

match rightmargin /%\=&textwidthv.*/

but doesn't give me expected. can me parameterize overlength actual value of textwitdh.

nb: plan put in filetype autocommand block , inside which, there set textwidth option , redefinition of rightmargin highlight group.

i realize parameterization not save me lines of code, want know if possible @ in vim.

one way it:

call matchadd('rightmargin', '\%'. &tw .'v') 

you should put in ftplugin (see :help ftplugin) rather autocmd.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -