Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing folds with synmaxcol in vim
    primarykey
    data
    text
    <p>Sometimes when I'm working on a project I want to play around with some data. Often times the data is on one line and is huge (>25k characters). I understand I could <code>set nowrap</code> and have this line just run off the screen, but I tend to like <code>set wrap</code> for other reasons. So, as a workaround I want to hide these long lines in a marker fold (e.g. <code>{{{ long line }}}</code>). This works fine but I run into a problem with <code>synmaxcol</code> for some reason. If the folded line exceeds <code>synmaxcol</code> then when I open the file, the syntax highlighting runs over. For example:</p> <p><img src="https://i.stack.imgur.com/mXSCY.png" alt="enter image description here"></p> <p>However, as soon as I open the fold the syntax corrects itself:</p> <p><img src="https://i.stack.imgur.com/2CEab.png" alt="enter image description here"></p> <p>Having to open the fold every time is annoying though. As you can see in this example the line is not actually all that long -- it just exceeds <code>synmaxcol</code>. Since <code>synmaxcol</code> is exceeded at a "string" element, the rest of the file is highlighted as a string (so nothing but a singular double quote will stop it).</p> <p>Why is this happening and how can I fix it? I've tried this with different syntax files and filetypes and it still occurs. I've also tried it with no plugins, a minimal vimrc (containing only <code>syn on</code>) and a modeline to set <code>fdm=marker:synmaxcol=60</code> and it still happens.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload