tab-completion

How should I use argcomplete in zsh?

一曲冷凌霜 提交于 2020-01-24 04:25:29
问题 I'm using argcomplete to have Tab completion in Bash. argcomplete offers global completion for bash , but doesn't for zsh . I would like to create a file ~/.zsh_completion , to contain the to be completed files. This file should generate autocompletion for those files when it's sourced from ~/.zshrc . How do I do that? 回答1: Alright there is a way to do it, but it's not the way I really wanted it to be. Anyway, here goes: Install argcomplete : $ pip install argcomplete Activate argcompolete :

Zsh tab completion duplicating command name

南楼画角 提交于 2020-01-22 04:48:13
问题 I'm on OS X Mountain Lion, running the included ZSH shell (4.3.11) with Oh-My-ZSH installed over the top. When using tab completion with commands such as homebrew, when ZSH lists the available commands, it is also duplicating the command. For example: $ brew {tab} will result in: $ brew brew [list of homebrew commands] I'm unsure what is causing this error, as when I resize the terminal window, the first instance of the command name disappears. If I hit backspace when the duplicates are

Zsh tab completion duplicating command name

你离开我真会死。 提交于 2020-01-22 04:48:10
问题 I'm on OS X Mountain Lion, running the included ZSH shell (4.3.11) with Oh-My-ZSH installed over the top. When using tab completion with commands such as homebrew, when ZSH lists the available commands, it is also duplicating the command. For example: $ brew {tab} will result in: $ brew brew [list of homebrew commands] I'm unsure what is causing this error, as when I resize the terminal window, the first instance of the command name disappears. If I hit backspace when the duplicates are

CVS tab completion for modules under Linux

▼魔方 西西 提交于 2020-01-13 15:55:28
问题 How can I get tab completion to work for selecting CVS modules under Linux (preferably using bash) ? For example, "cvs co " + tab would list the modules I can checkout. I've heard it's easy to do using zsh, but still I didn't manage to get it working either. Also, how can I list all available modules (or repositories?) available in the CVSROOT? 回答1: There is the Bash completion project. It has some cvs completion in it, I'm not 100% if it can determine all the modules for checkout. But it

CVS tab completion for modules under Linux

江枫思渺然 提交于 2020-01-13 15:53:10
问题 How can I get tab completion to work for selecting CVS modules under Linux (preferably using bash) ? For example, "cvs co " + tab would list the modules I can checkout. I've heard it's easy to do using zsh, but still I didn't manage to get it working either. Also, how can I list all available modules (or repositories?) available in the CVSROOT? 回答1: There is the Bash completion project. It has some cvs completion in it, I'm not 100% if it can determine all the modules for checkout. But it

tab complete dictionary keys in ipython

只愿长相守 提交于 2020-01-12 14:18:08
问题 I was wondering if anybody knows how to enable or implement tab completion for dictionary keys in IPython? It seems like it wouldn't be very different from functionality that already exists, like tab completion of object attributes. If I'm wrong, then I'd like to understand why 回答1: IPython supports dict key completion for string keys since version 3.0.0 (despite not appearing in release notes), thanks to this patch. It also supports column name completion for numpy struct arrays and pandas

How to test Python readline completion?

孤街浪徒 提交于 2020-01-01 08:33:12
问题 I'm writing a command-line interface in Python. It uses the readline module to provide command history and completion. While everything works fine in interactive mode, I'd like to run automated tests on the completion feature. My naive first try involved using a file for standard input: my_app < command.file The command file contained a tab, in the hopes that it would invoke the completion feature. No luck. What's the right way to do the testing? 回答1: For this I would use Pexpect (Python