I use four spaces for indent. I would like to replace the indentation with some UTF-8 chars.What I have:1.def foo(bar):    for jaffa in bar:        print jaffa2.var foo = function(bar){    bar.forEach(function(jaffa){        console.log(jaffa);    });}What I want:1.def foo(bar):for jaffa in bar:print jaffa2.var foo = function(bar){bar.forEach(function(jaffa){console.log(jaffa);});}I tried using conceal myself, but I couldn't come up with a pattern to match the indentation spaces.How would I accomplish changing the indentation to UTF-8 chars using vim conceal as described in the examples?@Muru gave the answer for this question. But what if I want to conceal the last 'block' of the indentation spaces differently than the ones before it? Example:var foo = function(bar){bar.forEach(function(jaffa){console.log(jaffa);});}
Vim conceal indentation. Replace indentation spaces with utf-8 chars
regular expression;indentation;conceal
With the following:set conceallevel=2syn match IndentWS '\v(^( {4}|\t)*)@<=( {4}|\t)' conceal cchar=I get:The regex \v(^( {4}|\t)*)@<=( {4}|\t):uses very magic \vmatches a sets of 4 spaces ({4}) or a tab \t, at the beginning of the line, with zero width \@<=and then a set of 4 spaces or a tab.Of course, if you use only tabs or spaces, you can simplify the regex accordingly.For the update, with:set conceallevel=2syn match IndentWS '\v^( {4}|\t)+\S@=' contains=IndentEndWS,IndentStartWSsyn match IndentStartWS '\v( {4}|\t)' conceal cchar== syn match IndentEndWS '\v( {4}|\t)\S@=' conceal cchar=I get:Making ends highlight differently would need a region, or contained matches. In this case I used two contained matches, one for general  indentation whitespace, and one for indentation just before a non-whitespace character (\S).