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

shell_replace_with_output action #11670

Open
Axlefublr opened this issue Sep 10, 2024 · 1 comment
Open

shell_replace_with_output action #11670

Axlefublr opened this issue Sep 10, 2024 · 1 comment

Comments

@Axlefublr
Copy link
Contributor

I'm working on a new feature, and want to get feedback to see if I should keep it in my personal fork, or if it would be accepted to core.

There's a certain consistency in various mappable commands: you can either insert, append or replace.
More specifically, the shell_insert_output, shell_append_output, shell_pipe commands.

The issue here is that while you can prepend or append the output of a shell command, if you wanted to replace your selections with the output of a shell command, you would have to employ hacks:

  1. press d and then prepend — this easily breaks, because in a lot of cases all of your cursors would merge into a single one, so you can no longer replace all of those selections, you only have one
  2. use shell_pipe like ; my-actual-command — while this works, I think it's agreeable that it's a hack.
    First of all, most people probably don't know they could use ; like that.
    Second of all, the intention is different. If we want to replace selections with the output of a shell command, we never wanted to pipe to begin with, so it's just a workaround for something that should be doable directly.
    So, I intend to implement shell_replace_with_output (not sure about the _with there, looking for feedback on naming).
    It will replace selections, but won't actually pipe them.
@justinlovinger
Copy link

Along similar lines, I would like something like shell_pipe_insert and shell_pipe_append to insert or append output while piping selection.

@Axlefublr Axlefublr reopened this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants