writing only a modified buffer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

writing only a modified buffer

luis jure
hello list,

i've written a _very_ simple one-line macro assigned to a function key, that
writes the file in the current buffer, compiles it using a certain program
and gets back to vim in normal mode. something like:

:map <F5> :w <CR> :!foo_command %:p <CR><CR>

now, i'd like to perform the :w command _only_ if the file has a "modified"
status (+), but i don't know how to do that. any pointers or a simple
example that would help me understand how to rewrite my macro?

best,

lj



Reply | Threaded
Open this post in threaded view
|

Re: writing only a modified buffer

luis jure
el Wed, 15 Jun 2005 17:01:10 -0400
"Alan G. Isaac" <[hidden email]> escribi?:

> :h update

alan, you must have set a record... never got a response this fast.

thanks,

lj