VIM editor – delete lines longer than 50 charenters

 

You want to remove long lines, but not touch shorter lines.

Example: For each line longer than 50 chars,


:g/.\{50,\}/d

 

 

also

:g/^.\{,39\}$/d

and

:g/\(^.\{,39\}$\)\|\(^.\{61,\}$\)/d

should work.

It's only fair to share...Tweet about this on TwitterShare on Google+Share on FacebookShare on LinkedInEmail this to someone
Twitter Auto Publish Powered By : XYZScripts.com