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

Re: Help with AlignMaps

Expand Messages
  • Charles E. Campbell, Jr.
    Gerald Lai wrote:nip] ... What! You should!!! :) (http://vim.sourceforge.net/scripts/script.php?script_id=294) ... The problem here is not all = s are
    Message 1 of 5 , Feb 28, 2006
      Gerald Lai wrote:nip]

      >
      > I am unfamiliar with AlignMaps,


      What! You should!!! :)
      (http://vim.sourceforge.net/scripts/script.php?script_id=294)

      > but what you describe sounds like it
      > could be done with simple substitutions.
      >
      > Original: pointer stars before the variable name
      > :%s/\w\zs\s\*\ze\h/* /g
      > (the above is the basic idea, below is a more general form)
      > :%s/\w\zs\(\s\+\)\*\ze\s*\h/*\1/g


      > Original: one space before and after the equal sign
      > :%s/\w\zs\s=\s\ze\h/ = /g
      > (the above is the basic idea, below is a more general form, allowing for
      > any amount of space before and after the equal sign, enforcing the
      > 2-space
      > rule)
      > :%s/\w\zs\s*=\s*\ze\h/ = /g


      The problem here is not all "="s are equal! In other words, probably
      the "="s inside comments should not be affected. Furthermore, it
      doesn't avoid single-line comments (which could be done with a "v/.../"
      as done in my own reply). Similar comments apply to the "*' handling
      (besides, there may be more than one; ie; int **x; ).

      Regards,
      Chip Campbell
    Your message has been successfully submitted and would be delivered to recipients shortly.