title: Ag.vim: Use word under the cursor as *part* of a search pattern?
body: <p>Using the Ag.vim plugin you can easily search for the word under the cursor by calling <code>:Ag</code> without any arguments, but how can I include the word under the cursor as <em>part</em> of a search pattern? I'm trying to add a bit to my vimrc to search for method definitions in Ruby files. Something like:</p>
  
  <pre><code>autocmd FileType ruby noremap K :Ag! "\bdef &lt;C-R&gt;&lt;C-W&gt;\b"&lt;CR&gt;
  </code></pre>
  
  <p>It doesn't recognize the <code>&lt;C-R&gt;&lt;C-W&gt;</code>. Also, I've tried both <code>\b</code> and <code>\&lt;</code>, <code>\&gt;</code> as word boundaries. Ag uses <code>\b</code> outside the context of Vim, but I know it translates <code>\&lt;</code> and <code>\&gt;</code> to <code>\b</code> in some contexts (not sure about this context though).</p>