Is it possible to make Powershell ISE behave like vim with some vim-like editing mode or plugin?
In netbeans I'm using jVi, and in Visual Studio I'm using VsVim, is there something similar for PowerShell ISE?
Or should I drop Powershell ISE altogether and just use vim + powershell command line?
The last weaks i searched for a way to use psISE in combination with vim (i found out its possible but hard for me to code without the ISE-comfort) In the end i created a function/submenu in the ISE that:
# one-line
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("edit with Vim",{$cur=$psISE.CurrentFile; saps "C:\Program Files (x86)\vim\vim74\gvim.exe" $cur.FullPath -wait; $psise.currentpowershelltab.files.remove($cur); $psISE.currentpowershelltab.files.add($cur.fullpath) },'Ctrl+Alt+v')
You have to save it first or it will not be removed
(maybe you add the $psise.CurrentFile.Save()
-function)
(for permanent ISE-changes you have to put it into the $profile...)
*saps --> start-process alias
I may be misunderstanding the question, but the closest I've come to getting vim-like ability while using PS ISE is to install gvim74 for Windows, and create this function:
function vim
{
if ($args)
{
start-process 'C:\Program Files (x86)\Vim\vim74\vim.exe' $args
}
else
{
start-process 'C:\Program Files (x86)\Vim\vim74\vim.exe'
}
}
Unfortunately, ISE does not play nicely with console input, so the best I can get is starting vi in a new PS window. Not perfect, but I get my ability to "vim fileToEdit", which I do A LOT in non-Windows world.
The best thing I've found is VSCode with the PowerShell and VIM plugin installed. The Powershell plugin used to be a lot worse than ISE, but recently the Intellisense has gotten much cleaner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With