1

I want to run powershell from vim and I have achieved it using the following mapping:

map <leader>cd :cd %:p:h<cr>:silent !powershell<cr>

The problem is that I can't do anything inside vim until I close the powershell window which somehow defeats the purpose. How can I tell vim to let go of the opened powershell so I could make changes in the file open in vim.

Maybe I am searching with wrong keywords and that's why I couldn't find a solution. Any help is appreciated.

  • 3
    Try :terminal powershell – Christian Brabandt Sep 1 '18 at 9:16
  • This opens a new window inside vim (which is very hard to close, how do I close that window?). Is it possible to open the powershell window from inside vim and then vim let go of that window so I could modify the content inside vim? – Ali Sep 1 '18 at 22:20
1

Try using:

:silent !start powershell

Which should run a new powershell command in its own window, detached from the current vim instance.

See also:

  • 1
    Thank you very much @Filipe. This is what I was looking for. – Ali Sep 4 '18 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.