tab-completion

Cycle through only specific file types in PS using custom tab completion on the command line

◇◆丶佛笑我妖孽 提交于 2019-12-08 08:28:28
问题 I use PowerShell's PSReadline-based tab completion and I'm looking to implement the following custom completion behavior: In a folder I have File1.java File1.class File2.java File2.class If I use tab after java I got a list of the files: java .\File File1.java File1.class File2.java File2.class But I want to use a shortcut so I can scroll through only the .java-files but without the extension shown. I also want to get rid of ".\" in the name. So if I write java and use tab I want to have java

Cycle through only specific file types in PS using custom tab completion on the command line

假如想象 提交于 2019-12-08 02:54:15
I use PowerShell's PSReadline -based tab completion and I'm looking to implement the following custom completion behavior: In a folder I have File1.java File1.class File2.java File2.class If I use tab after java I got a list of the files: java .\File File1.java File1.class File2.java File2.class But I want to use a shortcut so I can scroll through only the .java-files but without the extension shown. I also want to get rid of ".\" in the name. So if I write java and use tab I want to have java File1 And next tab gives java File2 And so forth (with tab or some other key). I also wondering,

Bash completion from another completion

泄露秘密 提交于 2019-12-07 16:21:22
问题 I have a script that requires as an argument the name of command and arguments of that command. So I want to write a completion function that would complete the name of the command and would complete the arguments for that command. So I can complete the name of the command like this if [[ "$COMP_CWORD" == 1 ]]; then COMPREPLY=( $( compgen -c ${COMP_WORDS[COMP_CWORD]} )) else #Don't know what to write here fi So this will complete the first argument to list of shell commands that are available

Bash TAB-completion inside double-quoted string

浪子不回头ぞ 提交于 2019-12-07 15:39:18
问题 Problem I'm writing a Twitter client for the command line (in C). I'm currently working on doing TAB-completion for Twitter screen names, like so: tweet "@s<TAB> @sourcebits @spolsky However, I can't get it to work mid-string, e.g.: tweet "Foo bar @s<TAB> since Bash treats the string as one word. I couldn't find anything in the Bash man page suggesting a simple fix, so I decided to hack around it. Below is my half-done solution to the problem. I simply split the incoming string by spaces,

Python Twisted integration with Cmd module

旧城冷巷雨未停 提交于 2019-12-07 01:58:58
问题 I like Python's Twisted and Cmd. I want to use them together. I got some things working, but so far I haven't figured out how to make tab-completion work, because I don't see how to receive tab keypres events right away (without pressing Enter) in Twisted's LineReceiver. Here's my code so far: #!/usr/bin/env python from cmd import Cmd from twisted.internet import reactor from twisted.internet.stdio import StandardIO from twisted.protocols.basic import LineReceiver class CommandProcessor(Cmd):

How to enable auto word completion in the MATLAB Editor?

青春壹個敷衍的年華 提交于 2019-12-06 17:23:44
问题 I can use auto word completion at the MATLAB command prompt by pressing tab, but I can not do that while using the Editor for an m file. Is there any way to use tab completion in the Editor? 回答1: According to this MathWorks blog post, tab completion works in the Editor as it does in the Command Window for MATLAB R2010a, but you may have to turn it on in the Keyboard Preferences menu. For older MATLAB versions, tab completion in the Editor only works for function names and variables that have

Is it possible to display some help message when showing autocomplete candidates?

自古美人都是妖i 提交于 2019-12-06 09:40:50
Some commands have many -x ( x can be any English letter) options and it's some times difficult to remember all of their meanings. I can use bash's compgen -W '-a -b -c' to show possible options and I'm wondering if it's possible to also show some help message. Like this: bash# foo -<TAB><TAB> -a: This is option a -b: This is option b -C: This is option c bash# I ever did something similar to map some of curl 's single char options (like -x ) to GNU style --long-option s. This is how it works: [STEP 101] # cat curl function _compgen_curl() { local cmd=$1 cur=$2 pre=$3 local -a options=( \ '' -

Emacs: Tab completion of file name appends an extra i:\cygwin

China☆狼群 提交于 2019-12-06 06:25:09
问题 I am facing some strange behavior with file-name completion in emacs. C-x C-f to find file opens up the minibuffer with i:/cygwin/home/rrajagop/StockScreener/working_copy/master_repo/stock_screener/. Hitting a TAB makes it i:/cygwini:/cygwin/home/rrajagop/StockScreener/working_copy/master_repo/stock_screener/. A couple of interesting things I've noticed: When the minibuffer opens up, i:/cygwin is greyed out and the path seems to start from /home. A C-a (go to begining of line) takes me to

Unable to find a substitute command for Bash's complete in Zsh

♀尐吖头ヾ 提交于 2019-12-06 03:47:04
I put the newest git-completion.bash to my .zshrc and I get /Users/Masi/bin/shells/git/git-completion.bash:2116: command not found: complete /Users/Masi/bin/shells/git/git-completion.bash:2118: command not found: complete The lines are complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ || complete -o default -o nospace -F _git git complete -o bashdefault -o default -o nospace -F _gitk gitk 2>/dev/null \ || complete -o default -o nospace -F _gitk gitk Which command is a substitute for Bash's complete in Zsh? Git's completion script has been updated to work with ZSH too. The

IPython tab completes only some modules

巧了我就是萌 提交于 2019-12-06 01:33:49
问题 I'm using the EPD version of python and IPython. After installing some modules using easy_install I notice that, although they can be imported, they cannot be tab completed. They exist on the path but, while included modules (pylab, readline, math) can be completed, these new modules cannot. Anyone know what I should look into to find the problem? I've checked that the packages are in the same place as other modules: In [1]: import pylab In [2]: pylab Out[2]: <module 'pylab' from '/Library