title: How do I define indents in vim based on curly braces?
body: <p>I use <a href="https://github.com/cakebaker/scss-syntax.vim" rel="nofollow noreferrer">https://github.com/cakebaker/scss-syntax.vim</a> for syntax highlighting <strong>SCSS</strong> (or <strong>SASS</strong>) files on vim, which works very well for syntax highlighting. However, the plugin does not come with an indent file and am having trouble writing one.</p>
  
  <p>I would like to set the indent to look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/AeSzw.png" alt="enter image description here"></p>
  
  <p>However, if i do <code>gg=G</code>, I get:</p>
  
  <p><img src="https://i.stack.imgur.com/gvrzg.png" alt="enter image description here"></p>
  
  <p>I suspect that it does not understand nested indent based on braces. I tried all the different combinations of</p>
  
  <p><code>set cindent</code></p>
  
  <p><code>set nocindent</code></p>
  
  <p><code>set autoindent</code></p>
  
  <p><code>set smartindent</code></p>
  
  <p>and tried to use the code from <a href="https://stackoverflow.com/questions/234564/tab-key-4-spaces-and-auto-indent-after-curly-braces-in-vim">Tab key == 4 spaces and auto-indent after curly braces in Vim</a> , including</p>
  
  <p><code>set tabstop=2</code></p>
  
  <p><code>set shiftwidth=2</code></p>
  
  <p><code>set expandtab</code></p>
  
  <p>...but nested braces indent never seems to work.</p>
  
  <p>I believe that I might want to write a custom indent file, and all I need is indentation based on braces with nested levels. How should I go about this? If someone has an indentation file for filetypes with similar syntax, that will be great as well.</p>