Skip to content

Passing the cursor position to edit_command_buffer #6138

@rien333

Description

@rien333

The alt+e bind to edit_command_buffer - that is, opening the current command in $EDITOR - is very handy. However, often I only realize half way editing a command that using my $EDITOR would be more convenient. In such cases, it's pretty cumbersome and superfluous to navigate to where I had my cursor in the fish shell, before I started my $EDITOR session.

Fortunately, editors like emacs (and maybe also vim) can be told to open a file at a specific line and column:

emacsclient --help
Usage: emacsclient [OPTIONS] FILE...
Tell the Emacs server to visit the specified files.
Every FILE can be either just a FILENAME or *[+LINE[:COLUMN]]* FILENAME.

Therefore, it would be great if edit_command_buffer could be told about the current cursor column (and possibly line). Afaik, there is currently no good way to pass such information to edit_command_buffer. I'm also not sure if it's possible to get the cursor's current column, and then pass that as some kind of argument to edit_command_buffer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions