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

Re: Save file w/ orig mtime?

Expand Messages
  • Colin Keith
    ... *nod* Makes sense. ... Ignore it, its meaningless :) ... Correct. ... On this line I m opening the file and executing the commands: source mtime.vim
    Message 1 of 5 , Jul 1, 2002
    • 0 Attachment
      On Mon, Jul 01, 2002 at 01:57:31AM +0000, Soren Andersen wrote:
      > text but I would not be. I would typically be wanting to be
      > (re)formatting some textfile (say, a news or email posting saved to my

      *nod* Makes sense.
      > Thank you very much for the work you put in. I have to admit I am
      > puzzled by some of it. Who or what is "- sed bob" anyway? Is that a

      Ignore it, its meaningless :)

      > "~/vim/mtime.vim"). Then if I ':source [pathtothisfile]mtime.vim' I
      > will be able to do... something ...


      > openbox% vim header.js -c 'so ~/vim/mtime.vim|call append("$", "//Test")|wq'

      On this line I'm opening the file and executing the commands:
      source mtime.vim " load the instructions
      call append( ... ) " Do something to change the file
      wq " Save and quit as normal.

      This is just because I could show it on the command line.

      > Sorry but the commands are pretty opaque to me. OK ... My understanding
      > is that you are in a manner typical of an expert user, combining


      > several things into a very concise (and obfuscated) form: sourcing
      > (':so') the new 'mtime.vim' file and calling ('call') the func 'append'
      > to add the line '//Test' then issuing command ':wq!' all in one
      > compound command. OK, good enough. I will play with this and see. Will

      That's completely correct. It was just a compact way to say "look this was
      the last modification time, and the last line of the file, now I do something
      to the file and the last 2 lines are this, but the last modification time
      hasn't changed"

      > the mtime.vim code affect other buffers that might be open at the same
      > time, because I use GVIM and usually have split windows? Will there be
      > anything 'global' I have to watch out for or will only the file I've
      > opened with the ':so[urce]' command be affected by the directive to
      > "save with no change in mtime"?

      Yes it will affect all saves. If you wanted to restrict it, change the
      autocmd pattern match from * to something else. If you only wanted it to
      apply to files in your mail directory (for example) you could replace the
      * with a directory to match. See the help for "autocmd" for details on this.


      Then graphics games came along and the computer using portion of the human race
      forgot all about 500,000 years of language evolution and went straight back to
      the electronic equivalent of banging rocks together - the point'n'click game
      - http://www.douglasadams.com/creations/infocomjava.html
    Your message has been successfully submitted and would be delivered to recipients shortly.