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

Better tab completion #136

Closed
1 of 5 tasks
athityakumar opened this issue Oct 22, 2017 · 5 comments · Fixed by #138
Closed
1 of 5 tasks

Better tab completion #136

athityakumar opened this issue Oct 22, 2017 · 5 comments · Fixed by #138

Comments

@athityakumar
Copy link
Owner

athityakumar commented Oct 22, 2017

Description

The current tab completion does work for flags. But it'd be better to have functionality of completing to flags when a match is found, and works with normal directory tab complete when no match is found.

For example, colorls ../<TAB> doesn't complete the directories.

Ping @rohitner - Do you think this could be made better?

@rohitner
Copy link
Contributor

rohitner commented Oct 25, 2017

@athityakumar replacing
complete -W "${_colorls_options}" 'colorls' with
complete -f -W "${_colorls_options}" 'colorls' does the job
however the completion suggestions show mixed up like this
image

@athityakumar
Copy link
Owner Author

Oh, that's a better way. But could the flag options come in only when the completing ARG isn't empty? Like,

colorls <TAB> - All Files and directories
colorls ../<TAB>- Matching Files and directories
colorls -<TAB> - Matching Flags

@rohitner
Copy link
Contributor

rohitner commented Oct 26, 2017

colorls -<TAB> does show matching flags only and not the directories. I suggest you to try making the mentioned changes and check it out.

@athityakumar
Copy link
Owner Author

I checked that, but consider scenario 1 (colorls <TAB>) : wouldn't it better to atleast group the flags and files separately? Give this a try.

@GeneralD
Copy link

btw, zsh-completion-generator makes completion perfectly.
colorls -<TAB> shows

--all                      -a                 -- do not ignore entries starting with .
--almost-all               -A                 -- do not list . and ..
--dark                                        -- use dark color scheme
--dirs                     -d                 -- show only directories
--files                    -f                 -- show only files
--git-status               --gs               -- show git status for each file
--group-directories-first  --sort-dirs  --sd  -- sort directories first
--help                     -h                 -- prints this help
--light                                       -- use light color scheme
--long                     -l                 -- use a long listing format
--report                   -r                 -- show brief report
--sort-files               --sf               -- sort files first
--tree                     -t                 -- shows tree view of the directory
--version                                     -- show version
-1                                            -- list one file per line

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

Successfully merging a pull request may close this issue.

3 participants