Reputation: 49
I've recently started moving away from my regular editor to vim and I use powershell as my default shell. I noticed in the normal mode that pressing ctrl z allows to quickly go back to the terminal ( although in a very different mode, regular shortcuts like ctrl L to clear screen etc. weren't working ). After reading through some posts I got to know that this shortcut is meant to put vim in backgroud mode in linux and fg
brings it back to the foreground. Since this doesn't work in powershell is there an alternative way to get the same functionality?
PS: Is there also any alternative to reach powershell prompt from within vim?
Thanks!
Upvotes: 0
Views: 890
Reputation: 4170
The terminal
command can be used to reach a powershell prompt from within Vim.
:term powershell
This will open powershell in a new terminal window.
There are various ways to invoke a terminal. For example, :tab term powershell
will open the terminal in a new tab. :term ++curwin powershell
will open the terminal in the current window. See :help :term
for more details.
Here is some more relevant information from a prior post:
Using
:term
will place you in Terminal-Job mode, where you can use the terminal as expected.Within Terminal-Job mode, pressing
Ctrl-W N
orCtrl-\ Ctrl-N
switches the mode to Terminal-Normal, which allows the cursor to be moved and commands to be ran similarly to Vim's Normal mode. To switch back to Terminal-Job mode, pressi
.
Upvotes: 1