Skip to content

Add vi binding to command line edit. #354

Closed

Description

@locheng

In Bash, you could do 'set -o vi' to use Vi binding for command line edit. It would greatly improve the productivity for Vi users.

Activity

  1. iamcodemaker commented on Aug 24, 2019

    @iamcodemaker
    Contributor

    This should be straightforward to implement. Nu uses rustyline for command line editing and rustyline already supports vi mode.

  2. MarcoPolo commented on Aug 25, 2019

    @MarcoPolo

    One line patch for now

    diff --git a/src/cli.rs b/src/cli.rs
    index a04a621..26ece91 100644
    --- a/src/cli.rs
    +++ b/src/cli.rs
    @@ -207,7 +207,7 @@ pub async fn cli() -> Result<(), Box<dyn Error>> {
         }
         let _ = load_plugins(&mut context);
     
    -    let config = Config::builder().color_mode(ColorMode::Forced).build();
    +    let config = Config::builder().edit_mode(rustyline::config::EditMode::Vi).color_mode(ColorMode::Forced).build();
         let mut rl: Editor<_> = Editor::with_config(config);
     
         #[cfg(windows)]
    
  3. jaydeland commented on Aug 26, 2019

    @jaydeland

    Sweet - Vi line editing is a great addition - will it work on the table that is returned as well?

  4. wycats commented on Aug 26, 2019

    @wycats
    Contributor

    We should make this work via config. See #100 for some design considerations on reloading the config.

  5. added
    category:enhancement
    polish
    on Aug 26, 2019
  6. max-sixty commented on Sep 13, 2019

    @max-sixty
    Contributor

    This can be closed I think

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:enhancementpolish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions