title: How to redirect vim's output to terminal?
body: <p>I'm currently writing a small bash script to create a pre-filled file at a specific location. To do so, my bash script call vim and execute a vim script.
  In this vim script, I want to ask to the user if the location where the created file is going to be saved is the correct one. The user then enter yes or no.
  To do so, I'm using this set of command:</p>
  
  <pre><code>call inputsave()
  let name = input('Is it the correct location ? y/n')
  call inputrestore()
  </code></pre>
  
  <p>this input function works fine when I'm in gvim or vim. But from a script, nothing is displayed is the terminal where I launched my bash script.</p>
  
  <p>Is there a way to redirect outputs to my terminal ?</p>
  
  <p>I found <code>:redir &gt; {file}</code> but this is obviously redirecting all vim outputs to a file which not interactive.</p>
  
  <p>I also managed to echo something int the terminal by using this:</p>
  
  <pre><code>let tmp = "!echo what I want to display"
  execute tmp
  unlet tmp
  </code></pre>
  
  <p>but again this is only to display something. I won't be able to enter an input</p>
  
  <p>my bash script:    </p>
  
  <pre><code>#!/bin/bash
  touch tmp.txt #file used to pass argument to vim
  echo "$1" &gt;&gt; tmp.txt #append argument to the end of the txt file
  vim -e tmp.txt &lt;create_new_file.vim #launch vim and execute the scrip inside create_new_file.vim
  rm tmp.txt
  echo "new file created"
  </code></pre>
  
  <p>the <code>create_new_file.vim</code> basically just call my function <code>CreateFile(_name)</code> located in my <code>.vimrc</code>. This is this function who call <code>inputsave()</code>, <code>input()</code> and <code>inputrestore()</code>.</p>