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.

learn more… | top users | synonyms (2)

1
vote
1answer
77 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 ...
5
votes
2answers
52 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
282 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 ...
2
votes
1answer
213 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 ...
1
vote
1answer
46 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 ...
7
votes
2answers
310 views

Need help on this bash auto completion script

I'm trying to setup autocompletion for a command, which takes only one parameter, a folder name, In /secure/kernel_builds/, I have the three following subfolder: 3.5.6/ 3.6.2/ source/ Now I want ...
3
votes
2answers
272 views

Trouble w/ bash programmable completion of filenames matching patterns

I've got a simple command named th. I've got a bash-completion file for it that goes as follows: _th() { COMPREPLY=() local curr=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $(compgen -f -X ...
4
votes
0answers
237 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 ...
3
votes
1answer
235 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 ...
3
votes
2answers
149 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 ...
2
votes
2answers
88 views

How to add all binaries to bash tab completion for some command?

I've installed program trickle that allow to throttle the net for specified command like: trickle -u10 -d10 <COMMAND> How to add bash completion for all binaries to trickle command?
2
votes
0answers
109 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 ...
11
votes
1answer
531 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 ...
1
vote
3answers
805 views

vi <TAB> completes only directories in bash

In a directory I type vi and then tab (twice), this gives me user$ vi CMakeFiles/ global/ libs/ whereas ls followed by 2 tabs gives me user$ ls ! core.log CMakeFiles/ global/ libs/ ...
3
votes
2answers
90 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
305 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 ...
6
votes
3answers
205 views

How to order files by date in tab completion list

$ 7z l ~/Downloads/Tab How to make the resulting list to be sorted by date, not by name? I currently use special script to list N most recent files in a given directory (and copy the filename ...
4
votes
2answers
309 views

Completion of words on the screen as in VIM (Bash or Tmux)

How can I configure Bash, Zsh or Tmux to complete the last matching identifier on the screen? Consider this common scenario: $ git fetch remote: Counting objects: 16, done. remote: Compressing ...
2
votes
0answers
41 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
42 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
1answer
106 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 ...
4
votes
0answers
93 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 ...
3
votes
1answer
688 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 ...
3
votes
1answer
48 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 ...
5
votes
2answers
1k views

is there a way to set coloring for cd tab complete?

I use ubuntu 11.04. Is there a way to set coloring for output after tab completion listing of a cd, ls, or etc. ? i.e. myshell@root$ cd ~/user/files/ I hit tab... myfile myfoo mybar <-- this ...
3
votes
0answers
411 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. ...
2
votes
1answer
1k views

zsh completion installations (autojump) - How to use them?

I just installed autojump and have oh-my-zsh installed in my system. I have included the log of the installation at the bottom of this post. Note that at the end it says: zsh completion has been ...
4
votes
2answers
91 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
61 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 ...
5
votes
3answers
551 views

Custom autocomplete: deal with spaces in filenames

A bit of context, this question is a follow-up of this one: Bash remote autocompletion : change the 'starting' directory Anyway, I'm writing my custom autocompletion bash script: I want the ...
4
votes
2answers
245 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
2answers
797 views

Phrase Express Equivalent for Linux?

Is there some sort of auto text-insertion program with macros, similar to PhraseExpress for Windows in Linux? In case you've never seen this application it offers the following features: Organize ...
5
votes
2answers
238 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
600 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
47 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
28 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
690 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
1k views

Bash and Tab Auto-complete

I recently put Fedora Core 15 on my system, and I've had a behaviour change that I can't figure out. Using Tab-Complete in the BASH shell works fine except when I use the $HOME variable. If I type cd ...
3
votes
1answer
132 views

compgen warning: -C option not working as I expected

What is the correct way to use the compgen -C option? I'm trying to learn about Bash programmable completion, and in particular the compgen builtin function. I'm experimenting with the different ...
0
votes
1answer
404 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
4answers
453 views

How to set proper monitoring of my services in a automated way? So that if one crash it auto on the fly restarts?

How can i setup monitoring to my system services? Either using automated script which scan every moment, if httpd, mysqld, and my custom daemon is running or not, if not running it will automatically ...
1
vote
1answer
105 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 ...
3
votes
2answers
777 views

How to change the target directory for tab completion?

I found a short script to enable note-taking on onethingwell, which includes this: function n { nano ~/n/$1.txt } I'd like to extend it to do tab completion, so that if I want to edit the ...
0
votes
1answer
347 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. ...
9
votes
2answers
1k views

Command line prediction

I've found an interesting paper: Predicting UNIX Command Lines about command-line prediction (based on user past activity), and I wonder if any actual implementation of such thing exists?
3
votes
0answers
79 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
101 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 ...
1
vote
0answers
25 views

Manual tab completions in zsh

I would like nm[TAB] to expand to node_modules in zsh. Is this possible? How can it be done? Ideally, it wouldn't be triggered if there is another completion available, such as an already existing nm ...
4
votes
2answers
545 views

Command completion does not complete the files in the current directory

Something is wrong with my tab completion. Let's say I do this: cd test // works fine, go into test directory ls // works fine, displays all of the files Let's assume I have the following files: ...
3
votes
1answer
418 views

Bash autocompletion for an environment variable holding a directory name

I'm using, among other things, bash 4.2.37 on Linux Mint 14. When I autocomplete the name of an environment variable by typing Tab, it expands to the name of the variable followed by a space. If the ...