Home > scripts > Formatting make output

> I've been looking around for some blockquoting scripts for vim recently.
> All the ones I've encountered via Web searches apply some kind of text
> delimiter to it; the closest I can think of would be analogous to C
> comment style, seen in blockquote.vim.

  I use marks plus an external filter, usually "fmt".  This map lets me
  mark a line as 'a', go down a few lines, and format regular prose text
  with two spaces after the period:
    map  v  jmbk:'a,.!fmt -1\|fmt'b

  This one formats the paragraph I'm in without having to mark lines:
    map  V  }jmbk{ma}:'a,.!fmt -1\|fmt'b

  If you want to reformat text that's been quoted in some way (leading ">",
  etc) try "par" at http://www.nicemice.net/par/

  I like to save output from "make" but without lines that are 8 miles
  long.  The "mfmt" script below writes leading and trailing dashed lines
  as delimiters with the first text line indented four spaces and any
  wrapped lines indented 8 spaces.  For example, here's one unformatted
  line from "make":

    cc -I. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -xtarget=ultra -m32 -xarch=sparc -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c -o tmdiff.o tmdiff.c

  Running it through "mfmt":

        -DHAVE_DLFCN_H -xtarget=ultra -m32 -xarch=sparc -xO5 -xstrconst
        -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c -o tmdiff.o tmdiff.c

Name Last modified mfmt 07-Sep-2010 21:23 mfmt.1 07-Sep-2010 21:23