Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipe append and inline pipe append #12590

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chiefMarlin
Copy link

This PR introduces two new commands:

pipe-append
Takes selected text and pipes it to a shell command.
Appends the shell command's output on a new line immediately after the selected text.

pipe-inline-append
Works similarly but inserts the shell command's output directly at the cursor position, rather than on a new line.

Intent of this is to add flexibility in using shell commands for text completion and insertion.
For example using shell commands to complete code/text.
:pipe-append aichat Given the current context, suggest next line. Output only text, no explanations:
:pipe-append-inline aichat Given the current context, finish this line. Output only text, no explanations:

Adding keybindings for completion

[keys.normal]
"tab" = ":pipe-append aichat \"Given the current context, suggest next line. Output only text, no explanations:\""

[keys.normal]
"tab" = ":pipe-append aichat \"Given the current context, suggest next line. Output only text, no explanations:\""

@kirawi kirawi added the A-command Area: Commands label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants