sponsor Vim development Vim logo Vim Book Ad

fdcc.vim : Locale or FDCC (Formal Definitions of Cultural Conventions, see ISO TR 14652)

 script karma  Rating 3/2, Downloaded by 1491    Comments, bugs, improvements  Vim wiki

created by
Dwayne Bailey
 
script type
syntax
 
description
Glibc uses locale (or fdcc) files to define cultural conventions.  The files are usualy named
xx_ZZ where xx is the ISO language code and ZZ is the ISO country code.

The highlighter has the following features:
* highlights only valid keys with various LC_ sections
* Shows bad <UNNNN> unicode as an error
 
install details
Syntax file
---------------
Copy the file to your .vim/syntax directory

in a locale file type: set syntax=fdcc

Filetype detection
-------------------------
Slightly harder as locale files do not have any specific suffix - but here's what to do

Insert this after the Diff section in your scripts.vim file.  It does initial patern matching and then looks within the file to determine if it is a locale file.  The double quotes below are escaped on this site so remove those escapes.  In fact it will pronbably mess up all back slashes aswell.  Oh well.

  " CVS diff
  else
    let lnum = 1
    while getline(lnum) =~ "^? " && lnum < line("$")
      let lnum = lnum + 1
    endwhile
    if getline(lnum) =~ '^Index:\s\+\f\+$'
      set ft=diff

      " locale input files: Formal Definitions of Cultural Conventions
      " filename must be like en_US, fr_FR@euro or en_US.UTF-8
    "elseif expand("%") =~ '\(\l\l_\u\u\($\|[.@]\)\|i18n\|POSIX\|translit_*\)'
    elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
      let lnum = 1
      while lnum < 100 && lnum < line("$")
        if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
          setf fdcc
          break
        endif
        let lnum = lnum + 1
      endwhile
    endif

  endif

  unlet s:line2 s:line3 s:line4 s:line5

endif

 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
fdcc.vim 20040330 2004-03-30 6.0 Dwayne Bailey Minor update
* Added missing keywords for LC_IDENTIFICATION, LC_CTYPE and LC_COLLATE
fdcc.vim 20040118 2004-02-20 6.0 Dwayne Bailey Initial upload
ip used for rating: 54.196.195.38

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo