tab-completion

Tab Completion In Emacs shell-mode SSH Sessions

南笙酒味 提交于 2019-12-03 11:44:33
My current use pattern of emacs results in my having several shell-mode buffers open, each running an ssh session. I am running into an issue with this, though - when I try to tab-complete file names and other things in my remote session, the shell attempts to use completions available on the local machine instead of on the remote machine. For example, if the file ~/foobar exists on the local machine and ~/frob exists on the remote machine, typing in ~/f and pressing tab results in ~/foobar instead of completing correctly. If I use ssh outside of emacs and try the same thing, I get the correct

Zsh color partial tab completions

风格不统一 提交于 2019-12-03 11:07:00
Is it possible to color the completed part of the partial completion results in Zsh? Fish does this by default (in Gentoo at least) as shown in the image below: Full size image: http://i.imgur.com/tN6w3.png Yes, you can do it with things like that: zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")' Just change the 01 and 02 colors so it matches your taste, for example to match your screenshot: zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==34=34}:${(s.:.)LS_COLORS}")'; (Taken from reddit

How to Implement Tab Completion

二次信任 提交于 2019-12-03 11:00:53
问题 I'm trying to figure out how to implement tab completion for subcommands in a C++ application. I would like it to function much like Git's tab completion. I'm trolling through Git's source, but it's not jumping out at me. I've searched for ways to implement tab completion and haven't found a straight-forward answer, so I'm guessing it might not necessarily be a feature each individual application has to implement. Is tab completion a feature of the particular shell the application is being

Customize tab completion in shell

放肆的年华 提交于 2019-12-03 10:29:10
This may be have a better name than "custom tab completion", but here's the scenario: Typically when I'm at the command line and I enter a command, followed with {TAB} twice, I get a list of all files and subdirectories in the current directory. For example: [user@host tmp]$ cat <TAB><TAB> chromatron2.exe Fedora-16-i686-Live-Desktop.iso isolate.py favicon.ico foo.exe James_Gosling_Interview.mp3 However, I noticed at least one program somehow filters this list: wine . Consider: [user@host tmp]$ wine <TAB><TAB> chromatron2.exe foo.exe It effectively filters the results to *.exe . Thinking it

zsh: use completions for command X when I type command Y

白昼怎懂夜的黑 提交于 2019-12-03 09:36:17
问题 In zsh, I have a function called g which acts like this: with no arguments, call git status with one or more arguments, delegate to git with all given arguments - i.e. call git $@ I would like the tab completions for g to be exactly the same as for git . I can achieve this with alias g=git , but that doesn't allow me to call status by default (the first point above). How can I delegate to the completion for git ? In bash, I simply did complete -F _git g which re-uses git's completion function

function name + tab does not return docstring in IPython

穿精又带淫゛_ 提交于 2019-12-03 06:44:25
问题 In IPython, I am used to write function( and then strike a tab, and get the contents of the docstring and a list of the named arguments. However, this stopped working since I installed IPython 2.0. Is there an explanation or a know fix? 回答1: Oh, the shortcut is now shift+tab . 回答2: Shift-tab only works when you place the edit cursor inside or after the object. Not when it's at the start of the object. This gotcha is not documented anywhere...! I filed jupyter issue Shift-Tab completion doesn

Ambiguous tab completion not working in iPython on Windows

那年仲夏 提交于 2019-12-03 06:23:37
问题 I am running IPython on Windows 7 x64 with pyreadline installed. If I start a new session and type: import numpy nu<TAB> Then nu autocompletes to numpy . However, if I start a new session and try this: import numpy n<TAB> Then nothing happens. I would expect it to cycle through all of the possible completions. I'm currently using out of the box config, do I need to change a setting to enable ambiguous tab completion or am I just out of luck? EDIT : To address the comment from ma3204, here is

Ajax autocomplete (or autosuggest) with TAB completion/autofill similar to shell command line completion?

吃可爱长大的小学妹 提交于 2019-12-03 05:19:39
问题 I'm implementing a AJAX autocomplete/autosuggest feature, and not only do I want to do the usual show suggestions that are similar to what the user typed, but I'd like to let the user do partial completions to save typing. So, imagine my dictionary has these values in it: "green apple", "green pear", "green fruit", "blue sky", "blue water", "blue wake". If the user types in "g", the suggestions should be "green apple", "green pear", "green fruit", and I'd like to let the user hit TAB or

How can I provide tab completions to fish shell from my own script?

拈花ヽ惹草 提交于 2019-12-03 01:40:50
I am running Ubuntu 13.10 and fish 2.1.0. I want to write myself a Python script to do some tasks from the command line. The script will require command line arguments. How can I write my script such that fish can request and get possible values for a given argument. The list of potential values is dynamic. That is, it will be determined programatically (e.g. a list of folder names matching some criteria). The end result I am aiming for is something like: user@machine ~> myprog argument=fol<TAB> folder1 folder2 folder3 Where myprog is my script file, argument is the argument name and folder1

How to Implement Tab Completion

爱⌒轻易说出口 提交于 2019-12-03 01:35:56
I'm trying to figure out how to implement tab completion for subcommands in a C++ application. I would like it to function much like Git's tab completion. I'm trolling through Git's source, but it's not jumping out at me. I've searched for ways to implement tab completion and haven't found a straight-forward answer, so I'm guessing it might not necessarily be a feature each individual application has to implement. Is tab completion a feature of the particular shell the application is being executed from? What are the basics I need to know about getting my application to support tab completion