title: how to get directory names under a path in Vim script?
body: <p>I want a simple solution to get directory names under a path in vim script.</p>
  
  <p>Here is my tried ways: the code. <a href="https://gist.github.com/4307744" rel="nofollow">https://gist.github.com/4307744</a>
  Function is at line L84.</p>
  
  <p>I use this function as complete function for input().
  So this function need to return a list of directory names under a path.
  e.g.</p>
  
  <pre><code>to/path/
          - a/
          - b/
  </code></pre>
  
  <p>I want to get <code>a</code> and <code>b</code>.</p>
  
  <p>I tried to find vim internal functions with <code>:help functions</code>. only found <code>globpath()</code>, but it will return full path.</p>
  
  <p>So does anyone have a simple solution ?
  (BTW, why it is so hard to get directory names under a path in Vim ??)</p>