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

Use tab completion instead of peco / fzf #126

Open
reneatzi opened this issue Apr 24, 2020 · 1 comment
Open

Use tab completion instead of peco / fzf #126

reneatzi opened this issue Apr 24, 2020 · 1 comment

Comments

@reneatzi
Copy link

What is the idea behind the fzf / peco script and the custom key bindings? Do I need to remember them to complete my command?

I think it would be easier to use the conventional tab completion scripts for zsh / bash / fish to auto complete the options / command.
E.g.: https://mads-hartmann.com/2017/08/06/writing-zsh-completion-scripts.html

For example, if I press tab after todoist it would list all available options like list, show and so on. A tab after todoist add 'My task' --label-ids would list key value pairs with the ids and labe names.

@andreoliwa
Copy link
Contributor

andreoliwa commented Mar 26, 2021

Hi @reneatzi, I think tab completion is working for Bash since #133.
But it's using fzf underneath, to display the key/value pairs you mentioned

Example output from my terminal:

$ todoist <TAB>
--color              --json               -v                   close                karma                projects
--csv                --namespace          a                    completed-list       l                    q
--debug              --project-namespace  add                  d                    labels               quick
--header             --version            c                    delete               list                 s
--help               -h                   c-l                  h                    m                    show
--indent             -j                   cl                   help                 modify               sync
$ todoist list -<TAB>
--color              --filter             --indent             --project-namespace  -h
--csv                --header             --json               --version            -j
--debug              --help               --namespace          -f                   -v
$ todoist list --<TAB>
--color              --debug              --header             --indent             --namespace          --version
--csv                --filter             --help               --json               --project-namespace
$ todoist list --h<TAB>
--header  --help

And you need to install the completions manually, brew install is not doing it.
Do something like this on macOS:

ln -s /path/to/this/cloned/repo/todoist_functions_fzf_bash.sh \
    "$(brew --prefix)/etc/bash_completion.d/todoist-bash-completion.sh"

Open a new terminal and it should work.

As I mentioned on #133:

I hope this helps.

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