1

I develop using Python on Ubuntu and so I use the workon command (from virtualenvwrapper) a lot to switch virtualenvs.

Previously, workon was the first tab-completion match for "wo", so I could type w,o,tab to match it. But now on Ubuntu 16.04 this is matching to word-list-compress instead, so I need to type w,o,r, k,tab instead.

How can I remove word-list-compress from the tab completion search, or otherwise make workon the first match for w,o,tab?

Note - workon itself has auto-complete support (tab to choose between virtualenvs).

  • Curious: why don't you alias it to wo and just wo Enter? – muru May 22 '16 at 2:20
  • @muru good question - workon has autocomplete support, I don't think aliasing will support that. – therefromhere May 22 '16 at 8:54
  • There is a -n option in the autocompletion script to exclude patterns, but I am not sure on how to modify the calling to the completion. Probably just a modification in .bashrc would work... – dadexix86 May 22 '16 at 9:57
  • @therefromhere a better shell (like zsh) supports autocompletion with aliases. Or you could configure tab to cycle in reverse. – muru May 23 '16 at 7:19
0

From this blog it should be sufficient to do

complete -r word-list-compress

in order to remove it from the completion list.

I do not know (yet) how to revert it, so I did not try it myself.

  • Thanks, I tried that already, it didn't work - I think it's completing word-list-compress since it's found in /use/bin , so there's not a specific completion rule defined for it. – therefromhere May 22 '16 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.