Loading ...
Sorry, an error occurred while loading the content.

24795Re: Fixing the year in a copyright line

Expand Messages
  • Gary Johnson
    Jan 3, 2002
    • 0 Attachment
      On Thu, Jan 03, 2002 at 09:02:59AM -0800, Gary Holloway wrote:
      > Here's a more recent version... it utilizes the preview window to avoid that,
      > and leaves the copyright line visible in the preview window if it was changed;
      > and fixed several "oddities" (ok, bugs :).
      > I edited out some company-specifics; I don't think I created any bug doing
      > that... :)

      I've been using your UpdateCopyright() since you first posted it, but
      with the following change to the search() function call to make the
      copyright string customizable without having to further modify your

      if search(g:copyright_pre.'\<\d\{4}\(-\d\{4}\)\=\>'.g:copyright_post, "w") > 0

      I have copyright_pre and copyright_post defined in my .vimrc as follows
      to agree with our company standards:

      let g:copyright_pre = "(c) Copyright *"
      let g:copyright_post = " *Agilent Technologies"

      One could also use autocommands to change among different strings for
      company files and personal files.

      With the little bit of testing I did last year, it worked great. Now
      that a new year is here, I'll have a chance to use it for real when I
      get back to work next week.

      If one could choose whether or not to center the copyright notice, e.g.,
      using a g:copyright_centered flag, this would make a great plugin to
      contribute to vim online.


      Gary Johnson | Agilent Technologies
      garyjohn@... | Spokane, Washington, USA
    • Show all 13 messages in this topic