title: Creating a dynamic alias, is it possible?
body: <p>I'm creating a library in the C language and have separate folders for each header/source file.  I recently had the need to go into many of the folders and change some code in both the .c and .h files.  So I'm frequently using the commands:</p>
  
  <pre><code>nano &lt;some-detailed-filename.c&gt;
  nano &lt;some-detailed-filename.h&gt;
  </code></pre>
  
  <p>I wanted to look at creating an alias like the following:</p>
  
  <pre><code>alias nanc="nano $(ls ./*.c)"
  alias nanh="nano $(ls ./*.h)"
  </code></pre>
  
  <p>The idea being that it will open whatever .c/.h files in the current directory.  But when I add these lines to my .zshrc file, I get the following as the aliases:</p>
  
  <pre><code># alias nanc
  nanc='nano ./xh.c       ./yp.c'
  # alias nanh
  nanh='nano ./xh.h       ./yp.h'
  </code></pre>
  
  <p>This is not desired, as the files nano tries to open are only located in my home/login directory.</p>
  
  <p>How can I go about creating this alias so that it uses the current directory I'm in when I issue the command?  I'm not having much luck with my searches.</p>