sponsor Vim development Vim logo Vim Book Ad

dosbatch indent : Indenting for filetype dosbatch

 script karma  Rating 7/4, Downloaded by 691  Comments, bugs, improvements  Vim wiki

created by
Geoff Wood
script type
I couldn't find an indent script for DOS batch files so I wrote a simple one.  It just follows these rules:
- generally keep the indent of the previous line
- if previous line is not a comment and has ( and no matching ), increase indent
- if this line starts with ), decrease indent

I started by cutting down and modifying Erik Janssen's awk.vim.
install details
Copy the file into one of the indent directories in your runtime path (see :help 'runtimepath'), personally I put it in c:\program files\vim\vimfiles\indent\

Make sure filetype-specific indenting is switched on (see :help filetype), personally I put this in my _vimrc file

:filetype indent on

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
dosbatch.vim 1 2009-05-14 6.0 Geoff Wood Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.