sponsor Vim development Vim logo Vim Book Ad

Super Shell Indent : Improved indentation for shell scripts

 script karma  Rating 72/33, Downloaded by 5783  Comments, bugs, improvements  Vim wiki

created by
Tye Zdrojewski
script type
This is a shell indentation script that calculates the indent level based on begin/end syntax pairs, as opposed to complex conditionals and pattern matching.

This script also introduces indentation for:

           case blocks
           paren blocks
           '[[' blocks
           line continuation

It's slower than the stock indentation, but IMHO, it doesn the "right" thing much more often.  :)

install details
This script was written for and tested on vim 6.3.  Earlier versions may not do the right thing...

Place in ~/.vim/indent/ and let 'er rip!

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
sh.vim 1.6 2005-06-17 6.0 Tye Zdrojewski Noticeable performance improvement
sh.vim 1.5 2005-03-30 6.0 Tye Zdrojewski - Fixed indentation of first line in a file
- Fixed ignoring of certain keywords in comments
- Tested on 6.2
sh.vim 1.4 2005-03-04 6.0 Tye Zdrojewski - Fixed infinite loop
- Ignore line-continuation chars in comments and strings
sh.vim 1.3 2005-02-24 6.0 Tye Zdrojewski - fixed elif (again)
sh.vim 1.2 2005-02-24 6.0 Tye Zdrojewski - Ignore open/close pairs that are in strings
- Fixed super_sh_indent_echo
- Fixed else/elif
sh.vim 1.1 2005-02-23 6.0 Tye Zdrojewski 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.