A feature provided by interactive programs such as shells and text editors that inserts text to complete a word or phrase that the user is likely intending to compose.
1
vote
1answer
20 views
How can I keep the trailing slash after choosing a directory from the zsh completion options?
In zsh, when I press tab 2 times to enter the "completion menu", select a directory and press enter, it first adds the chosen directory with a trailing slash to the command, but as soon as I press ...
4
votes
2answers
63 views
Where do bash completion functions come from?
I have a Raspberry Pi running Raspbian (Debian Wheezy). I entered set in a terminal and was surprised by the long list. This seems to be almost entirely git functions — ~3700 lines of them.
...
1
vote
1answer
24 views
Custom tab-completion in bash's `read`
Is there a way to "import" a list of words into bash's read builtin to have custom tab-completion? I've been writing a wrapper script for suckless' minimalist irc client "ii", and I don't have a way ...
0
votes
1answer
54 views
Add autocompletion in dash
Is it possible to get at least "some" autocompletion in a dash shell like in bash?
At least for the existing filenames in a path.
3
votes
0answers
57 views
can we use something better than more for tab completion?
more is not as convenient as less.
Is it possible to use something better than more for tab completion, when ls and then tab? Thanks.
2
votes
1answer
43 views
Why can't I use tab expansion/auto-complete of shell variables with cd?
I have setup a variable in .bashrc:
export SOME_DIR=/path/to/some/dir
Now, with ls I can type ls $SOME_DIR[tab] and the variable will be expanded, and I can then use tab for auto-completion when ...
2
votes
3answers
45 views
Hide make targets from shell when users autocomplete in bash
Is there a way to flag some targets in a Makefile so that they don't appear at all in the shell when the user types make and then presses Tab ?
I am having a Makefile with too many recipes and I don't ...
1
vote
1answer
43 views
Is autocompletion for applications done by shell?
When I type evince, and then hit tab, the bash shell will list all files that can be opened by evince, which seems to be based on the ext part of the filename.
Is this done by shell or the ...
1
vote
1answer
40 views
zshell is tab-completing ambiguous options
I've been having an issue with zsh completion that's becoming a rather large annoyance. It's completing options beyond where there is ambiguity. For example, in a directory with these files:
...
0
votes
0answers
23 views
Zsh - Modify File Completion w/ Quotes
I've been using Zsh recently, and when I complete a file name within quotes, the completion adds a space after the completed file name. Interestingly, this does not occur when I complete directory ...
1
vote
3answers
117 views
How to do command-line completion with files and folders
As a new Linux user, one of the things that's kept me away from the Command Line (CL) is that, for tasks involving files and folders (i.e. everything!), the amount of typing involved makes using the ...
4
votes
2answers
72 views
Display possible corrections but do not apply them automatically
I have the following completion:
zstyle ':completion:*' completer _complete _approximate
As a result if I type something incorrectly and hit TAB I will see a list with corrected propositions (what ...
12
votes
3answers
862 views
How to eliminate annoyances when starting a GUI from a terminal?
I prefer to launch GUI applications from a terminal window rather than by using a graphical desktop. A frequent annoyance is that often the developers haven't anticipated this type of use, so the app ...
5
votes
2answers
65 views
exclude particular file from bash_completion
I have a simple bash_completion code. The only thing it does, is when I type grcat and then Tab, it offers to complete filenames from /etc/grcat.
_grcat() {
local word
COMPREPLY=()
if [ 1 ...
11
votes
1answer
399 views
How do command-line tools have their own autocomplete list?
How does Bash in Ubuntu know a tool's specific list of actions?
For example if I type apt-get and tab twice I only see remove, update, upgrade ...etc, but not the actions for another command or the ...
1
vote
1answer
65 views
Bash Autocompletion (rather than tab completion)
How can I make bash show completion suggestions without having to press [tab]. I'd like the suggestions to update on each character I add and maybe to have the ability to quickly pick an option. I'd ...
1
vote
1answer
48 views
Modify $READLINE_LINE and $READLINE_POINT values inside bash script
I already asked this question on stackoveflow, but received no answer and very few views. I thought I would post here as there should be more bash users and someone might have already stumbled upon ...
7
votes
2answers
134 views
How to customize Bash command completion?
In bash, it's easy enough to set up customized completion of command arguments using the complete built-in. For example, if, for a hypothetical command with a synopsis of foo --a | --b | --c, you ...
5
votes
2answers
50 views
Is it possible for bash completion to cycle through the alternatives?
When using bash completion and an a number of characters have been entered, tabbing ceases to work then the prefix you have typed is matched by more than one of the possibilities.
Is there a way to ...
9
votes
3answers
154 views
Bash autocomplete with vim command
In bash, autocompletion of paths has recently stopped working when issuing vim commands where the path is deeper than two directories (it continues to work as expected with other commands, such as ls ...
1
vote
1answer
30 views
Filename completion in gvim
for some reason, my filename completion in gvim is not working.
In vim, its working properly. Commands and such are, however, completed correctly.
I have set wildmode=full.
An example:
Assume i want ...
3
votes
0answers
169 views
bash does not autocomplete my command when using sudo?
I'm using SaltStack. I would like to auto-complete the minion name when calling salt command.
The following line has been added into ~/.bashrc:
complete -o default -o nospace -W "$(sudo ls -1 ...
2
votes
0answers
73 views
Bash tabcomplete file names for environmental variable values
After I upgraded my Ubuntu from 12.04 to 14.04, bash would no longer let me tabcomplete file names when setting the value of an environmental variable, e.g.
FILE=/home/_
_ is where I would press ...
2
votes
2answers
62 views
zsh completion - show more options than just the alias
I am trying to modify the behaviour of zsh completion and its menus. I'm stuck, and I've read so much documentation it's making my head spin.
The following is only an example; I'd prefer answers that ...
2
votes
1answer
159 views
How to enable double tab autocompletion list in bash?
I've worked in Linux before where when I press tab it autocompletes until it becomes ambiguous. If I pressed tab twice at that point it would give me a list of all possible completions.
My current ...
2
votes
0answers
30 views
rlwrap-like tool with command autocompletion
I am often using rlwrap sqlite database.sqlite to browse an SQLite table. It works great but I would like to have a tool that would create an index tables (and possible its columns as well) and let me ...
1
vote
0answers
35 views
MySQL: Tab-completion not working [closed]
Tab completion in mysql is not working. I tried to start mysql with
mysql --auto-rehash
but it didn't work either. I also tried
mysql> \#
but autocompletion refuses to complete my commands. ...
4
votes
0answers
70 views
How to combine zsh autocomplete for wrapper function arguments and existing command
I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim ...
1
vote
1answer
163 views
Autocomplete server names for SSH and SCP
I have a few servers configured in ~/.ssh/config, such as alpha and beta. How might I configure Bash such that the commands ssh al<tab> and scp file.tgz al<tab> autocomplete the names of ...
4
votes
1answer
102 views
Is there a way to customize “Programmable Completion” in the current session?
If I start typing a command or filename, I can use the tab key to auto-complete my string.
That is well known...
Is there a way to change the behavior of the auto complete for the current bash ...
3
votes
1answer
43 views
Redistributable completion for my bash scripts
Is there a simple way to embed the completion features inside a script, for bash ?
I have a script that I want to redistribute, but I can't ask the people to add something inside their ...
3
votes
0answers
265 views
git completion with zsh: filenames with spaces aren't being escaped properly
Git completion:
I'm having difficulty with git's filename autocompletions on my system. I'm using zsh (5.0.5) with git (1.9.3) on OS X (10.9.3). Both zsh and git have been installed via homebrew. ...
4
votes
2answers
80 views
Is there a workaround for Debian file-completion trashing $_?
I have years of experience on Slackware linux, and have never seen this problem there. Lately I have been administering Debian servers, and this has become an annoyance.
I frequently use "$_" in a ...
0
votes
0answers
39 views
zsh completion doesn't correct ? (question mark) in paths
So, I've been pretty happy with my zsh completion and correction configuration for a while now, with this being a major exception.
Configured as I have it, the shell routinely catches and corrects ...
2
votes
1answer
130 views
Autojump auto-complete feature does not work
On my configuration, autojump autocomplete feature does not seem to work. To be clear, autojump works properly, only the autocomplete feature fails to work.
When I press the <TAB> key, the ...
3
votes
1answer
149 views
Add autocompletion for custom script
I am currently working on a shell script I called makeyourself.sh (linked to /usr/bin/mys) which automatically installs a debian package from source (via apt-get source -b $1).
So I decided to add an ...
5
votes
2answers
138 views
How do I set Zsh autocompletion rules for second argument (of function) to an existing command's rules?
I have a custom Zsh function g:
function g() {
# Handle arguments [...]
}
Within it, I handle short arguments that execute Git commands. For example:
g ls # Executes git ls-files ...
g g # ...
23
votes
1answer
576 views
How do I redirect command completion output?
On the command line, I can redirect or pipe output of a command to a file or another command using the > or | operator after the command. I have come across a less standard situation that I would ...
4
votes
1answer
41 views
Tab-completion within for loops not working
I'm either going crazy or about to ask a stupidly basic question. I appreciate your patience either way.
Tab completion for executable command is not working within interactive for loops in bash. I ...
2
votes
1answer
22 views
autocomplete named directories
Autocompletion of a named directory doesn't seem to work before I use it the first time, as demonstrated by the following session:
% setfoo() { foo=/etc; }
% setfoo
% cd ~fo<Tab> # doesn't ...
3
votes
1answer
331 views
Zsh completion of brew formulas
In OS X, is there any way to have Zsh (I'm using Oh-my-zsh) tab-complete formulas?
E.g.
$ brew install em<TAB>
could expand to:
$ brew install emacs
3
votes
2answers
128 views
Bash autocomplete variables for other commands than cd
I have env variable $SCRIPT. Normaly I can use autocomplete
vim $SC<tab>
and completion works as expected. On some systems it does not work. I have bash completion loaded, but completion in ...
11
votes
1answer
463 views
Bash completion for comma-separated values
I would like to create completion rule for comma-separated parameters list. E.g. I have command which receives list of server names:
myscript -s name1,name2,name3
At this moment I've managed to ...
0
votes
1answer
320 views
Zsh ssh tab completion not working as expected on OS X
I use Zsh on two different machines (OS X and Ubuntu) and the tab completion for ssh does not work the same way. More specifically hosts specified in the file ~/.ssh/config is NOT used on OS X but it ...
3
votes
1answer
180 views
how to edit and color bash's tab completion list
Following is what i would like to have.
When the tab completion is ambiguous, and bash prints the list of possibilities. I would like it to colour the next character I should press inside every word ...
1
vote
1answer
88 views
Add arguments when completing a command name
I am looking for a way to expand some predefined strings in the terminal when tab (or another key combination) is pressed. This is different from tab completion. My terminal already expands ~ to my ...
4
votes
2answers
175 views
Force Bash normal tab completion if intelligent completion fails
Since tab completion became a standard feature in shells I have been a very happy user of it. I even like Bash's intelligent completion (where it only searches for PDF files, if I type evince ...
0
votes
1answer
231 views
ZSH autocompletion gives seemingly random errors after some time
My zsh autocompletion is broken in a strange way. For clean logins everything works but after some time I will get seemingly random autocompletion errors, for different "kinds" of autocompletion. ...
3
votes
0answers
66 views
Call vared and complete files from a different directory
I have the following zsh function which lets me edit symbolic links using the vared ZLE builtin.
function lned {
emulate zsh
setopt err_return extended_glob local_options local_traps
local -a ...
3
votes
1answer
87 views
Bash tab completion stop searching
When I am typing into bash and I press the "tab" key to auto complete, sometimes it takes a significant time. E.g., file IO to read directories takes >5 seconds, and thus I am hung waiting for IO to ...