Use shiftwidth() where available. This allows UltiSnips to work properly...

... when

shiftwidth is zero. Per ":help shiftwidth":

shiftwidth()                                            shiftwidth()
                Returns the effective value of 'shiftwidth'. This is the
                'shiftwidth' value unless it is zero, in which case it is the
                'tabstop' value.  To be backwards compatible in indent
                plugins, use this:
                        if exists('*shiftwidth')
                          func s:sw()
                            return shiftwidth()
                          endfunc
                        else
                          func s:sw()
                            return &sw
                          endfunc
                        endif
                And then use s:sw() instead of &sw.