As I love vim, I found two posts that are interesting in order to use PS with vim:
Help starting vim from PSISE with the file edited in PSISE.
I found this following 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')
open PSISE:
psise> ise $profile
Paste the line in the file that PSISE opens. After that you can open the current file with vim by pressing Ctrl-Alt-V.
poshcomplete helps to complete PowerShell language once in vim.
- I've installed the poshcomplete vim plugin. I've installed webapi-vim and vimproc.vim as per this link.
PROBLEM:
After starting the server with the command
:call poshcomplete#StartServer()
everything is OK. The function is found in poshcomplete, the variables for port or other detail were declared.
If then I try to call the completion Ctrl-X,Ctrl-O after, for instance, the word "write" I receive the following error:
: omni completion(^O^N^P) Pattern not found.
But if I check what poshcomplete is returning from server (I use httprequester with the line "http://localhost:1234/poshcomplete?text=write") I can see that the answer from the web server is correct. Indeed I can see all the commands that have "write" in it.
I don't understand what's going on from the vim side that recover that data to show it for completion, because I had two times the plugin working, but then it stopped working.
I think there's a problem of sync between the moment the result is exposed by the server and the moment vim try to get it. I'm probably wrong, but I'd like to correct this if someone can help.