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

Support editing command line with external editor #393

Closed
alexherbo2 opened this Issue Jul 7, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@alexherbo2

alexherbo2 commented Jul 7, 2017

That could be useful when commands grow in complexity to be able to use an external editor.

That could be done by passing the command-line contents plus the cursor position to the usual editor and flushing the command-line buffer on quitting with the new contents.

Command-line buffer should not be updated if editor quits with error though.

Prototypes

Default

edit:command:edit

Launch the usual editor.

The following command will be executed:

$E:EDITOR <file> +<line>:<column>

Usage

edit:binding[insert][Alt-i] = edit:command:edit

String

edit:command:edit <editor>

Launch given editor.

The following command will be executed:

<editor> <file> +<line>:<column>

Usage

edit:binding[insert][Alt-i] = {
  edit:command:edit $E:EDITOR
}

Lambda

edit:command:edit <lambda>

Launch given editor, using lambda return value.

The following options are passed:

  • file
  • line
  • column

Usage

edit:binding[insert][Alt-i] = {
  edit:command:edit {
    put $E:EDITOR $opts[file] +$opts[line]:$opts[column]
  }
}

@xiaq xiaq added this to the 0.10 milestone Jul 8, 2017

@xiaq xiaq changed the title from Add binding to edit command-line with editor to Support editing command line with external editor Jul 9, 2017

@xiaq xiaq modified the milestones: 0.10, 0.11 Sep 16, 2017

@xiaq xiaq added the duplicate label Dec 31, 2017

@xiaq

This comment has been minimized.

Member

xiaq commented Dec 31, 2017

This is now covered by the more general #535, closing as duplicate.

@xiaq xiaq closed this Dec 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment