title: How do I fuzzy find all files containing specific text using ripgrep and fzf and open it VSCode
body: <p>I have the following command to fuzzy find files in the command line and to open the selected file in VSCode.:</p>
  
  <pre><code>fzf --print0 -e | xargs -0 -r code
  </code></pre>
  
  <p>Now I want to be able to search also file contents for a string. I am able to find the searched string in the command line:</p>
  
  <pre><code>rg . | fzf --print0 -e
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/OTerX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OTerX.png" alt="vscode_console_ripgrep_fzf_string_search.png"></a></p>
  
  <p>but now it does not work anymore to open the file in VSCode using this command:</p>
  
  <pre><code>rg . | fzf --print0 -e | xargs -0 -r code
  </code></pre>
  
  <p>because to VSCode is passed a file name which contains the file name itself and the search string which is of course an empty file. </p>
  
  <p>How can I combine to two above commands to pass the file name to VSCode which contains the searched string?</p>