
			    Text Formatting Plugin

This is a 'formatexpr' plugin.

{only works when 'encoding' is utf-8 or |+iconv| is enabled}

==============================================================================
1. Usage
>
  :set runtimepath+=/path/to/autofmt/
  :set formatexpr=autofmt#compat#formatexpr()

Following method can be used:

  autofmt#compat#formatexpr():	  Vim compatible
  autofmt#uax14#formatexpr():	  Implementation of UAX #14
  autofmt#japanese#formatexpr():  Japanese

UAX #14: Line Breaking Properties: http://unicode.org/reports/tr14/.

==============================================================================
2. Language

If you want to create your 'formatexpr' plugin, autofmt can be used as
framework.  You can define your language specific formatting easily.
For example: >

  set formatexpr=myfmt.formatexpr()

  let s:compat = autofmt#compat#import()

  let myfmt = {}
  call extend(myfmt, s:compat)

  function! myfmt.check_boundary(lst, i)
    if a:lst[a:i].c == "x"
      " It is possible to break a line before 'x'.
      return "allow_break"
    elseif a:lst[a:i].c == "y"
      " It is impossible to break a line before 'y'.
      return "no_break"
    else
      " Use default behavior.
      return call(s:compat.check_boundary, [a:lst, a:i], self)
    endif
  endfunction
<

 vim:tw=78:ts=8:ft=help:norl:
