coc-extensions / coc-powershell

PowerShellEditorService integration for coc.vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Commands documentation

50nar opened this issue · comments

commented

Is there some sort of documentation explaining how to use this ? How to trigger REPL on/off, how to run current code in shell etc?

Looks like changing powershell.integratedConsole.showOnStartup to false disables entire functionality. Is there a way to disable command shell at the bottom but keep the autocomplete functionality ?

coc-powershell is still in early days. Apologies for the lack of docs!

The powershell.integratedConsole.showOnStartup issue sounds like a bug. We should track that in a separate issue

Any chance someone could provide some updates on the basic commands to use with this plugin? Just the basics like how to execute the code in the editor (tried F8 and F5, neither worked), and also how to focus/switch to the integrated terminal.

How do you get out of the integrated console and back to your script buffer?

Ignore previous, it was an nvim question; vim manages terminal switching differently. In Neovim see :h terminal-input, you must use <C-\><C-n>.

I'm late but you can run the current line in the powershell console with:

:CocCommand powershell.evaluateLine

The selected lines with

:CocCommand powershell.evaluateSelection

You can execute the script with:

:CocComand powershell.execute

If you want to have F5 and f8 to execute code, you just have to map the key in your vimrc

nmap <F5> :CocCommand powershell.evaluateLine<CR>
vmap <F5> :CocCommand powershell.evaluateSelection<CR>
nmap <F8> :CocCommand powershell.execute<CR>

List of commands can be found in path_to_powershell_coc/out/client/extension.js (when searching for registerCommand). You can also get them by using :CocList but I'm not sure if this command is part of another plugin or not.