We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [autocomplete]

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.

Filter by
Sorted by
Tagged with
3
votes
1answer
441 views

How can I autocomplete each parameter in a different way?

I have a function called load_pg, which is defined like this: load_pg () { pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $1 -d $2 $3 } And I'm trying to autocomplete each ...
3
votes
2answers
4k 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 ...
3
votes
1answer
247 views

Prevent completion of files for 'make' command in zsh shell

Context zsh shell, oh-my-zsh framework, no special zsh's configuration (same problem with or without zsh-completions): see .zshrc at the end. Trouble If a directory contains: a makefile with ...
3
votes
2answers
115 views

Treat command like another for completion purposes

My zshrc includes the following function to create a directory and then enter it: function mcd () { mkdir -p "$*" && cd "$*" } The function itself works fine but I get odd behavior with ...
3
votes
1answer
610 views

How to customize bash autocomplete to list the files in another directory

How to customize bash autocomplete to list the files in another directory for only one script option (-seq), for other script options (-speed, -define) default autocomplete is O.K. this is what I ...
3
votes
1answer
2k views

How to diagnose slow tab completion? [duplicate]

There is a certain user who when they press tab key to complete a file path, it takes several seconds for the machine to make the completion. They are using the bash shell. How can I diagnose what ...
3
votes
2answers
2k views

Bash completion for user without access to /etc

I'm using a Chromebook (with a developer mode enabled), and as someone of you may know, there is no write access to the system directories (including /etc/). I'd like to enable the bash-completion ...
3
votes
1answer
435 views

pmount hangs on BASH autocomplete

Whenever I try to use autocompletion in combination with pmount the terminal freezes until I abort via CTRL+C which leads to the autocompletion to actually be executed. Autocompletion works fine in ...
3
votes
1answer
253 views

zsh-completion: Completing two parts of an argument, separated by a colon

I'd like to set up zsh completion for a command which has a single argument of the form scheme:parameter. Suppose I have commands which can return all possible schemes, and all possible parameters. ...
3
votes
1answer
67 views

Autocompletion: curbing the enthusiasm of a program

The people who package programs often seem to have an overly broad opinion as to the types of files their program will be used to open, as shown in the bash autocompletion setup that they create. For ...
3
votes
1answer
376 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 ...
3
votes
1answer
112 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 /etc/...
3
votes
1answer
447 views

Show completions under the prompt in Fish

Is there a way I can get the ultra compact auto-complete function from Zsh in Fish, so If I press Tab it won't write me all the possibilities permanently into my terminal but underneath the prompt?
3
votes
1answer
740 views

Zsh completion of hadoop commands

Hadoop has a range of commands and subcommands to specify different operations on MapReduce, HFS etc. (e.g. hadoop dfs can be followed by any command from this list). Is there any way to enable ...
3
votes
1answer
1k views

Bash remote autocompletion : change the 'starting' directory

I'm regularly downloading files from a remote server, always from the same directory. So I wrote a custom function that I put in my bashrc: download_from_myserver () { for file in "$@" do ...
3
votes
1answer
816 views

Restore default completion

I use compgen when $COMP_WORD equals 1, now I want to restore default completion when otherwise, Right now I have, _rr() { case $COMP_CWORD in 1) COMPREPLY=($(compgen -W "A ...
3
votes
1answer
499 views

Change completion behaviour with brace expansion in zsh

I have got used to using tab-autocompleting inside braces without expanding in zsh. This was possible, while I used zsh with a basic grml-config. Since I migrated to oh-my-zsh, I can't reproduce this ...
3
votes
1answer
137 views

Autocomplete not working while exporting environment variable in bash

Suppose I wish to export an environment variable named MYPATH holding following 2 paths: /full/path/to/fileA /another/full/path/to/fileB So, I think it should be done like this in bash: $export ...
3
votes
1answer
250 views

How to properly make custom zsh completions “just work”?

Please forgive me if I'm doing something stupid here, the documentation is huge and searching didn't turn up anything yet. I'm trying to create shell completions for my custom script called fab. For ...
3
votes
1answer
57 views

2nd configuration for Bash complete to work independently of TAB completion

Is it possible to have a second configuration for Bash's complete which operates independently of the standard TAB triggered one? I've written a Bash filename completion script tailored specifically ...
3
votes
1answer
88 views

Managing trailing characters using zsh autoloaded completion

I'm trying to create an autoloaded completion file for zsh. To do so, I've added a _myprog file in a folder that is in my fpath. This file goes roughly like this: #compdef myprog _myprog () { ...
3
votes
1answer
308 views

How to enable up-arrow command history and command completion in sftp on Gentoo?

When I try to use up-arrow command history via sftp to my CentOS 7 server it just prints ASCII characters to the output instead of recalling recent commands: sftp> ^[[A It's very time consuming ...
3
votes
2answers
118 views

How to get bash completion settings to be inherited by child shells?

I have a project-specific setup file that I source right before running gnu screen. In that file, I set up bash completion for my test command and the related tests. That looks like this: $...
3
votes
2answers
411 views

Zsh git filename completion with “--git-dir=… --work-tree=…”: not a git repository

I track my dotfiles using this method: A bare repository resides in $HOME/repos/dotfiles. All my dotfiles reside in their normal location, e.g. $HOME/.vim/vimrc, not $HOME/repos/dotfiles/vimrc. I run ...
3
votes
2answers
706 views

Is it possible to manually invoke a zsh completion function?

If I am at a zsh prompt and I have the current "context" (partially completed command-line command) % man gr_ ^ here I have used _ to represent the cursor If I then invoke the ...
3
votes
1answer
1k views

Bash script - auto complete for user input based on array data

In a bash script I'm reading some user input with read. Now I want to provide the possibility to auto-complete the input by hitting the Tab key. Easy example: Let's say, the user shall type in a name ...
3
votes
2answers
505 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
3
votes
1answer
745 views

Zsh gpg2 autocompletion

I am using zsh with oh-my-zsh on OSX. I installed gnupg2 from homebrew giving me the executable gpg2. Unfortunately zsh auto completion appears to only support gpg (even though that executable is not ...
3
votes
2answers
650 views

Seeing file names in SCP

I'm using scp to copy files from a remote server to a local one. What's really uncomfortable is that I need to type the file path precisely. I'm used to relying on autocompletion, because file names ...
3
votes
1answer
931 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: ...
3
votes
2answers
6k 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 ...
3
votes
1answer
469 views

variable name lost when tab completing to export an environment variable with a path

I'm trying to setup an environment variable using tab completion, e.g. snowch$ export JAVA_HOME=/usr/lib/jvm/java-6-oracle/ I used to be able to tab complete the folders after typing the export ...
3
votes
1answer
218 views

Complete only at the beginning of the word

I've got an issue with ZSH autocompletion, and I can't find the right keyworks to get rid of it. For instance, with files like $ ls Accelion, titi toto tata I would like to write: $ ls cc<TAB&...
3
votes
2answers
168 views

Hiding a zsh completion

I just switched to zsh (from tcsh) and have only run into one serious frustration: There are multiple completions for push — pushd and pushln. I’d really like to only have pushd available, since ...
3
votes
1answer
2k views

ZSH autocomplete

How do I make zsh give me the autcomplete options but not fill in the prompt line with the first result? For example, this is the behavior I'm seeing: $ ifc{tab} $ ifcfg external command ifcfg ...
3
votes
1answer
28 views

How to disable completion entirely for a specific shell command or alias?

I have the following Bash alias which doesn't take any arguments. alias b='cd ..' Typing b<space> and then pressing <tab> brings up completion results for any paths in the current ...
3
votes
2answers
236 views

Read /dev/tty from within a completion function

Why is the following code not working for completion of the foo command? When I source it then type foo <Tab>, the shell hangs and doesn't take any input until I press ^C (which exits the ...
3
votes
1answer
732 views

Disable completion of substrings in zsh

I to disable the following behaviour: cd deo<Tab> --> cd Videos I'm using zsh 5.3.1 on macOS, with oh-my-zsh.
3
votes
2answers
2k views

Using zsh autocompletion for alias

I have created a few aliases for git in zsh, for example gch = git checkout, grb = git rebase --committer-date-is-author-date and some more complex useful zsh functions for git commands. But how can I ...
3
votes
1answer
1k views

zsh completion for ssh confuses hostnames with local files

suppose I have following entry in my /etc/hosts 192.168.1.10 server1.mydomain.com and I have a directory SERVER-FILES in current dir. I want to scp the directory SERVER-FILES somewhere. I type ...
3
votes
2answers
980 views

Disable prompt for authentication on autocompletion of a command which needs root privileges

When I use e.g. firewall-cmd, which correctly needs root privileges to execute, I get prompted in a window (so not in the terminal as with sudo) to give my password when I try to autocomplete an ...
3
votes
1answer
570 views

autocompletion with wildcards for cd in bash

Using bash on ubuntu (debian jessie/sid) I'm not sure why I can't do tab completion of a wildcard with a builtin command. for example, suppose my current working directory contains the following ...
3
votes
1answer
1k views

Tmux autocomplete internal commands

Does anyone know a way to autocomplete tmux internal commands? For example, inside tmux I type bind-key + : then type ren... and expect to get rename-window or similar by pressing Tab.
3
votes
1answer
494 views

How can I use a key other than <ENTER> to exit zsh's completion menu/widget?

Like a lot of zsh users, I have completion configured so that when I am at a command prompt and I invoke completion, a menu appears that can be navigated with the directional arrow keys. i.e. in my ~/....
3
votes
3answers
2k views

Autocomplete of a file name in bash prompt

I usually put a date before a file or directory name similar to 2014-04-20 file_name.doc. So, in a folder there is usually a bunch of files and directories starting with a date. But when accessing ...
3
votes
1answer
215 views

zsh completion and unknow bzr commands

ZSH's Bazaar completion does not offer any expansion/completion when it does not know the bzr subcommand I am using. In my case, I use bzr qlog but ZSH's /usr/share/zsh/5.0.2/functions/_bzr does not ...
3
votes
1answer
299 views

code review: automatic completion for bash aliases

I was reading How do I get bash completion for command aliases? and I thought, that the answer by Shawn J. Goff needed a little something: less user setup so I wrote a little script that is intended ...
3
votes
2answers
1k views

Enable Bash-Completion to expand Superuser executables to full path

I'm running OpenSUSE 12.3 (and have seen the behavior since 11), and have found that I can't call Superuser programs (e.g. shutdown, reboot) without using the full path. For me, many of these ...
3
votes
1answer
76 views

Is there an easy way to change bash suggestions?

I've noticed that some console commands (like sudo or xargs) are using different kind of suggestions when I press Tab (they suggest programs instead of files). Is there a way to mimic that kind of ...
3
votes
1answer
621 views

Autocompletion of email addresses in vim

I'm playing around with various bits of an email solution, including notmuch and alot. I write my emails in vim and I'd like to have tab completion of email addresses while writing email. Is there a ...