Skip to content

Release #3 - Completions #290

Closed
Closed

Description

@sophiajt

Completions

  • command-based completions
  • completions from the plugin
  • proper completion for cd that doesn't use history if it's not appropriate

Activity

  1. changed the title [-]MVP #3 Tracking Issue[/-] [+]Release #3 Tracking Issue[/+] on Aug 15, 2019
  2. pinned this issue on Aug 15, 2019
  3. changed the title [-]Release #3 Tracking Issue[/-] [+]Release #3 - Completions[/+] on Aug 15, 2019
  4. alecthomas commented on Aug 24, 2019

    @alecthomas

    IMO this is the feature that will drive adoption the most. This and probably inline help for commands.

    Completions will allow discoverability, where currently there is zero. I type ps | where and I have no idea what fields area available.

  5. omertuc commented on Aug 24, 2019

    @omertuc

    Moreover, if completion information is unknown for a command, maybe it's possible to suggest a list of columns gathered from recent runs of the command. Usually I would do something like this:

    1. type ls
    2. See the unfiltered output to decide what needs to be filtered
    3. type ls | where somecolumn=somevalue according to what I saw in step (2)

    Maybe nu could intercept the output in step (2) to cache the different column names / some common values for those columns and suggest those when offering completion in (3).

  6. alecthomas commented on Aug 25, 2019

    @alecthomas

    IMO it would be ideal if plugins could (perhaps optionally if not by default) declare an output schema. Completions could then use the schema.

  7. alper commented on Sep 30, 2019

    @alper

    Do I get it right that arrow right completes the current suggestion but that this isn't documented yet?

  8. syvanpera commented on Sep 30, 2019

    @syvanpera

    Can I suggest you take some inspiration from fish shell on this. It's completions and suggestions work like magic and this is probably the biggest issue at least for me before I'd consider adopting nushell as my shell of choice

  9. Nemikolh commented on Oct 3, 2019

    @Nemikolh

    Would it be possible to consider having the autocompletion behaviour configurable?
    In particular, I like a lot if for a directory containing foobar, foobaz, foobar001, ... , foobaz125. I start typing f, press Tab and get fooba instead of one of the possible entries.

    I understand some folks like the current behaviour but I personally find it very frustrating when exploring the list of files in a directory. I probably am biased by my daily use of zsh with the zsh-syntax-plugin

  10. JosephTLyons commented on Jan 29, 2020

    @JosephTLyons
    Contributor

    I see there is a desire to support autocomplete of commands, is there any desire for nu to support completion of file names / directory names in real-time as well?

  11. kazysmaster commented on Feb 6, 2020

    @kazysmaster

    I think it would be nice to have ide like file/directory name completion.

  12. added
    delight
    category:enhancement
    category:meta-issue
    on May 16, 2020
  13. schoetbi commented on Jun 15, 2020

    @schoetbi

    I saw that the git branch is displayed in the command prompt but when I enter
    git checkout branch_name_start
    and press Tab nothing happens. Is Git branch completion implemented?

  14. 13 remaining items

  15. rsteube commented on Oct 14, 2021

    @rsteube
    Contributor

    Got rid of the hardcoding by using the config (persistent, but seems to be the best approach with current nushell capabilities).

    So basically commands can be configured to be called for completion which then return json:

    [completion]
    git = ["command", "complete"]
    > git checkout <TAB>
    # command complete git checkout ''
    # [{"display":"master (commit msg)","replacement":"master "}]
  16. added a commit that references this issue on Feb 7, 2022
  17. unpinned this issue on Feb 8, 2022
  18. fdncred commented on Feb 18, 2022

    @fdncred
    Contributor

    ancient

  19. igitur commented on Feb 18, 2022

    @igitur

    Ancient, but I'm still very much invested in this issue.

  20. fdncred commented on Feb 18, 2022

    @fdncred
    Contributor

    Which parts are you all invested in? We have completions, and the start to external completions.

  21. zeenix commented on Feb 18, 2022

    @zeenix

    Which parts are you all invested in? We have completions, and the start to external completions.

    Then perhaps it's miscommunication. The issue was closed with just ancient as the reason instead of being closed by PRs and all the checkboxes in the description are still unchecked.

  22. fdncred commented on Feb 18, 2022

    @fdncred
    Contributor

    ya, that makes sense. I was half asleep when I closed it last night. Sorry. :)

    I checked all the boxes in the issue because completions work for commands, plugins, and cd'ing. There's some fancy stuff going on too with menus and such. Like this one.

    keybindings: [
        {
          name: complete_in_cd
          modifier: control
          keycode: char_p
          mode: emacs
          event: [
              { edit: { cmd: clear } }
              { edit: { cmd: insertString value: "./" }}
              { send: Menu name: completion_menu }
          ]
        }
      ]
    

    This was posted in discord #cool-oneliners.

  23. Feel-ix-343 commented on Jun 20, 2022

    @Feel-ix-343

    This has been very hard to follow. Are there any updates?

    Just started trying nushell out, but cant use it without something like zsh completions plugin

  24. fdncred commented on Jun 20, 2022

    @fdncred
    Contributor

    There are some custom completions in our nu_scripts repo.

  25. tobiasBora commented on Nov 5, 2022

    @tobiasBora
  26. DeadRobotDev commented on Nov 26, 2022

    @DeadRobotDev

    I checked all the boxes in the issue because completions work for commands, plugins, and cd'ing.

    While completions work with cd, it still suggests history that isn't appropriate. For example: I cd into FolderA. I type cd again. It recommends FolderA, even though FolderA does not have a sub-folder/file called FolderA.

  27. rsteube commented on Nov 26, 2022

    @rsteube
    Contributor

    @DeadRobotDev probably best to open a new issue for that

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

Metadata

Metadata

Assignees

Labels

category:enhancementcategory:meta-issuedelight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions