Does anyone know of an editor that has the ability to enforce exact line lengths (bonus if it allows association of maximum line lengths by file name/extension)?
What I mean by exact line lengths is that the editor will always save each line padded to a maximum line length (defined by the user). For example, if a file should have a 120-character line length every line in the file will be 120-characters long, padded with blanks if needed, follow by the appropriate newline indicator. When someone edits a line the editor will prevent them from typing if the line length hits the max length.
Platform is Win XP/Vista.
Vim
:syn match Error /^.{,119}$/ :syn match Error /.{121,}/This will cause any lines of length != 120 to be highlighted with a solid red background (in the default color scheme).
If you write this (without the leading colons) into
$VIMRUNTIME/syntax/foo.vim, and placein
vimrcor the usualftdetectandsynload.vimlocations, then as long as syntax highlighting is enabled, these rules will will automatically apply to any*.foofile you open in Vim.(See
:h mysyntaxfile-addif you want to add to an existing syntax file, and see:h rtpfor the default$VIMRUNTIMEpath on your platform.)