How can I make vim automatically sort file on close?

Posted by planetp on Stack Overflow See other posts from Stack Overflow or by planetp
Published on 2010-04-09T09:49:38Z Indexed on 2010/04/09 9:53 UTC
Read the original article Hit count: 306

Filed under:
|

I have a config file which has sorted lines. After I add new lines somewhere in the file, I usually type ggvG :sort. Is it possible to make vim do this automatically when I close the file?

© Stack Overflow or respective owner

Related posts about vim

Related posts about sort