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
358 views

zsh refusing to accept new autocomplete script

I have a software project that I'm attempting to write zsh completions for. After installing a package that provided a number of pre-made completions, I found they were put here: /usr/share/zsh/site-...
3
votes
3answers
1k views

How to enable local ~ autocompletion for scp?

Too late: The machine, OS and configuration in question is no longer in use, so I can't verify any more suggestions. I have not encountered this problem in Fedora or Arch Linux. If you are having this ...
3
votes
1answer
765 views

Pipe zsh auto completion list to file or less

zsh: do you wish to see all 923 possibilities (462 lines)? Yes please, but in a file or less.
3
votes
2answers
54 views

zsh completion for media player

In my .zshrc, I have menu select disabled globally, except for mpv/mplayer: zstyle ':completion:*' menu select=0 zstyle ':completion::complete:mpv:*' menu yes select This works as expected, but I ...
3
votes
0answers
190 views

Use colon as filename separator in zsh tab completion

I have many programs which take filename arguments as one(or more) of path/to/file scp:path/to/file.ext ark:/abs/path/to/file.ext Is it possible make zsh complete filenames after some keywords ...
3
votes
1answer
66 views

Faster auto-completion for kanjis files/folders, without having to switch IME

I have a project with many Japanese kanji/kana folder and file names, like this: 提案書/ フォルダ/ 工数.sh 設計書.sh It takes so much time to change directories or open a file: Type the first part of the ...
3
votes
0answers
244 views

ZSH custom completion from command output

I am creating a custom completion for my command ipadd which will automatically complete all the network devices for OS X. It has a parameter --device which allows you to specify the network devices ...
3
votes
0answers
52 views

How do I write a custom filename completer for specific directories in zsh?

I've found that file names with dates before the title are difficult to tab-completion. I'd like to write custom completion functions for these directories. How do I specify that the completer should ...
3
votes
0answers
56 views

Bash tab completion for aliases [duplicate]

I define a number of aliases for my git work flow. alias gs='git status' alias ga='git add -u' alias gaa='git add -A' alias gc='git commit' alias gr='git checkout --' alias gu='git reset HEAD' alias ...
3
votes
2answers
353 views

Context-sensitive bash completion changes wildcard behavior

Somewhere along the way I've fallen into the habit of hitting tab twice after using a wildcard in commands like mv or rm, which by default causes bash to show the list of files that would match the ...
3
votes
1answer
649 views

Bash completion - How to get filename completion for suboptions

I have a function which can take main arguments and then sub-arguments. Some of these sub-arguments are filenames. The current completion code I have is as follows. _scm() { local cur prev opts ...
3
votes
0answers
1k views

Making zsh filename completion case-insensitive everywhere

I have the following line in my zshrc to make filename completions case-insensitive: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' This works most of the time but I’ve noticed that if I ...
3
votes
1answer
1k views

How to get the equivalent of tcsh's enhanced completion in bash?

In the tcsh manpage, the effects of set complete = enhance are defined as follows: [...] completion 1) ignores case and 2) considers periods, hyphens and underscores ('.', '-' and '_') to be word ...
3
votes
2answers
864 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 ...
3
votes
0answers
337 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
0answers
125 views

ZSH and completion of files with newline characters

I am experimenting with ZSH on nasty file names, especially file names with the newline character in it. Here is how I create them: $ touch "filename<hit return here> 1" $ touch "filename<...
3
votes
2answers
129 views

Zsh completion for mounts (/run/media/DISK-LABEL)?

I am looking or zsh functionality to expand disk-labels into mountpoins: Example: I have disk with label DISK-LABEL1 mounted on /run/media/god/DISK-LABEL1. Is there a plugin which expands input ...
3
votes
0answers
337 views

Git completions for aliases only available after running `git reflog`

I have a few aliases that I want to autocomplete for git, e.g., the following alias gco="git checkout" When I was attempting to add completions for this alias, I looked around in my path and saw ...
2
votes
2answers
9k views

zsh: command not found: {compinstall,compinit,compdef}

The zshcompsys man-page says: INITIALIZATION If the system was installed completely, it should be enough to call the shell function compinit from your initialization file; see the next ...
2
votes
1answer
82 views

Documentation on bash completion

I've been unable to find complete documentation for the complete and compgen bash builtin commands. I'm on a Macintosh and help complete produces complete: complete [-abcdefgjksuv] [-pr] [-o option] ...
2
votes
1answer
49 views

How to associate exstension with program so that it works with tab complete

I use texmaker to edit my LaTeX (.tex) documents. I also use texmaker for other things, but 90% of the time I just want to open a .tex document. If I want to open document.tex, I usually just write ...
2
votes
1answer
1k views

Tab to show directory contents

I use the terminal app on OSX. Whenever I cd into a deep directory I find it useful to display the successive directory contents as I go. By tapping tab when typing the filepath, it lets me see the ...
2
votes
1answer
1k views

Configure autocomplete for the first argument, leave the others alone

I have a utility that takes a load of different arguments. For now, I want to autocomplete the first argument, but leave all the others to fall through to normal autocompletion. How do I do that? ...
2
votes
1answer
64 views

How to look up zsh completion definitions

Is there a way to lookup (just print the completion definition to stdout) currently loaded zsh completion functions. I understand that they are stored somewhere on my fpath and I could do something ...
2
votes
2answers
146 views

Custom bash tab completion showing possible completions, but not actually completing input

I have tried very hard to figure this one out before actually posting here, but I can't seem to find any other examples of people solving this particular issue. I am running Ubuntu 17.10 I have ...
2
votes
1answer
808 views

Smart Bash Completion Depending on Argument position

I have a simple bash function, a wrapper around scp basically. Invoked using copytomachine <Machine> <File> I have set up some simple auto complete such that when I type copytomachine &...
2
votes
1answer
105 views

What is the command line equivalent of kupfer/quicksilver/synapse quick starter?

I want a way to quickly launch programs while I'm in an SSH terminal. But I don't want to have to remember the exact command. For example, if I type "fox" into kupfer/synapse/quicksilver or unity ...
2
votes
1answer
238 views

How do certain commands change the tabbed autocomplete criteria?

Suppose I am in a directory like this: :mydirectory$ ls foo.txt That only file. If I type a command like cat and then I tab to autocomplete (assume the ‸ character is actually the caret position ...
2
votes
1answer
786 views

Zsh's standard completion works fine, so why do people recommend to load compinit module?

If I put these lines and nothing else in my ~/.zshrc I get all the completion features I expected. # For autocompletion with an arrow-key driven interface zstyle ':completion:*' menu select # ...
2
votes
1answer
461 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 ...
2
votes
2answers
586 views

Make zsh show autocomplete choices even when a possible match is entered

On my current system (openSUSE 12.3 with zsh 5.0.2) the autocomplete function does not give me a choice of possible completions if I have already entered a possible completion match. For example, if ...
2
votes
2answers
1k views

zsh expand-or-complete for all files regardless of command/context

zsh has a feature where command line tab-completion performs context-aware completions, so you can do things like: # Good: $ wget g<tab> # becomes: $ wget gopher:// $ wget --hea<tab> ...
2
votes
1answer
131 views

Directory stack order discrepancy in zsh

I am working on Zsh 5.0.2 (latest stable version), and I noticed that: dirs -v and cd -<TAB> show a different list of directories (or at least directories in different order). Moreover, ...
2
votes
2answers
196 views

Expand less-than sign when using multios and brace expand

With zsh multios set (setopt multios) it's possible to do things like: < in1 < in2 > out and: < in > out1 > out2 which is very convenient. I want to combine this feature with ...
2
votes
1answer
354 views

How ignore PATH with `source` completion

I can't find any 'detailed enough' documentation about zstyle, and I'm surprised that no one faced this problem before: here is what I get with tab completion: source l<TAB> l2ping* ...
2
votes
1answer
231 views

Files with no .sh extension not considered for autocompletion in zsh

I have noticed that unless I add an .sh extension to my shell scripts, Zsh does not suggest them for autocompletion for execution despite having them in my PATH. I have the same problem if I cd into ...
2
votes
1answer
6k views

Terminal does not source .zshrc with custom colors for ls and cd command

I customized the directory and file colors for ls and cd + TAB. Here is my configuration. My configuration My system environment. Ubuntu 10.10 zsh 4.3.10 (x86_64-unknown-linux-gnu) oh-my-zsh // ...
2
votes
3answers
987 views

Remove zsh autocomplete suggestion

When I type cd l and hit tab, zsh autocompletes to cd lightdm/ this is not a directory that is available to me (in fact I've uninstalled lightdm). How do I stop this from happening? I have ...
2
votes
1answer
189 views

Bash completion won't work if calling application with the absolute path

Not knowing why, but the bash completion won't work if I call application in the absolute path. For example, I have file1 & file2 under the current directory [zhengw@localhost ~]$ rm -f file<...
2
votes
1answer
304 views

Bash completion extra words Fedora 23

Today I noticed some extra words when TAB completing dnf search. Anyone has any idea what is causing this behaviour? Tried to dnf clean all and then reinstall bash_completion and dnf update. It didn'...
2
votes
1answer
149 views

Bash tab complete with non-first token in command substitution $(…) throws error

Using tab completion on the first command in $(...) cat $(w When I hit tab I get potential completions as usual. $ cat $(w w wc which wicd-client ...
2
votes
1answer
1k views

Run a command in background that sets env var or define function

> export foo=1 & [1] 9016 [1] + done export foo=1 > echo $foo > I know when running a command with & you spawn a new process and the export foo=1 is not setting env vars in the ...
2
votes
2answers
544 views

why completion does not work for all aliases?

In my .bash_aliases file I have couple of aliases, like -- shopt -s expand_aliases alias emx='emacs' alias em='emacs -nw' alias gv='gvim' alias v='vi' alias ev='evince' when I use them and press [...
2
votes
4answers
979 views

How do I store long hostnames list for SSH quick usage?

I have an SSH access to a lot of servers. And all that hostnames (and sometimes usernames) are long and hard to remember. Also even if I tweak my Terminal to keep eternal bash history, the using of ...
2
votes
2answers
4k views

How to fix Linux filename tab autocomplete that is appending a space instead of trailing slash on directories?

For some strange reason my filename autocomplete is behaving differently than normal. Given the following file structure ./foobar/file.txt, if I want to delete file.txt, I type rm foob<TAB><...
2
votes
1answer
59 views

I have a tab completion that hangs, is it possible to use strace to find out what is going on?

In my example I start typing sudo su dkay...<tab>... and the command hangs for about a minute before tab completing to sudo su dkayton. I got advised to use strace to find out what is happening....
2
votes
1answer
770 views

How to enable tab auto completion linux subsystem windows 10

I have installed kali linux subsystem on my windows 10 machine. When ever i hit tab button in linux bash i hear some annoying sound and apt-get install ph doesn't give me any suggestion of ...
2
votes
1answer
682 views

Auto complete not working on Fedora

I am using Fedora 25. Seem the autocomplete on terminal using tab key is not working.. For example, I got this message when I want autocomplete my command: sudo systemctl start httpd.serUnit ...
2
votes
2answers
241 views

force loading completion function for zsh (without forcing its execution by hitting tab)

I want to replace an existing zsh completion function and keep a reference to the original (from here). E.g. to make tab completion always suggest nice as first word in a command line: eval "$(...
2
votes
1answer
99 views

How can I tab-complete umount, restricting to volumes in a specific directory?

I use zsh with zim, which is generally excellent. Ideally, I'd want to umount's tab completion to only suggest items in /run/media/$USER. In the following example, this is a single volume named ...