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
12
votes
2answers
3k views

Can I navigate zsh's tab-completion menu with vi-like hjkl keys?

I use zsh's menu-based tab completion. I press Tab once, and a list of possible completions appears. If I press Tab again, I can navigate this list with the arrow keys. However, is it possible to ...
13
votes
3answers
17k views

Debian - apt (not apt-get) autocompletion not working

I am on Debian Jessie 8.6. I noticed that apt-get gets the expected bash autocompletion when pressing tab for packages and command, but when trying to use it with apt it does not work. I remember ...
1
vote
1answer
71 views

How can I use bash autocomplete functions and filter patterns together?

My bash correctly autocompletes commands (e.g. find, git, etc.), but this seems to break as soon as I use filters to prevent completion of certain file patterns, e.g.: complete -f -X '*.@(cmi|cmo)' ...
1
vote
0answers
170 views

gmrun completion setting

I am using gmrun unter XFCE to start applications through Alt+F2 shortcut. I switched on the completion (TabTimeout = 1) which I find comfortable. As gmrun "simulates" tab press in this case, ...
8
votes
2answers
2k views

How can I configure zsh completion to show hidden files and folders?

Currently when I invoke completion the behaviour is like this: % cd ~/<TAB> Completing directory Desktop/ Downloads/ Pictures/ system/ Videos/ Documents/ Music/ Public/ ...
2
votes
2answers
301 views

vim: manipulate dictionary popup for autocompletion

I would like to tweak vim for using cdo (Climate Data Operators) efficiently. Because I need to use cdo in (bash) scripts, I would like to add an autocomplete matching (implemented!) with small ...
3
votes
1answer
494 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 ...
2
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
2answers
622 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 ...
1
vote
1answer
168 views

How can i get tab autocomplete in maxima or wxmaxima?

I've heard of there being autocomplete on ubuntu, but i'm currently on fedora and there's no autocomplete when i launch maxima. I read somewhere that this might be fixed by launching maxima with a ...
2
votes
1answer
208 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 ...
0
votes
0answers
38 views

Is there an application that could predict what I type and auto-complete my words and sentences?

I use to type a lot of text (in the browser) repeating the same stuff, using the same words and even same sentences over and over again. It would save me a lot of time if the computer could guess what ...
5
votes
1answer
265 views

Shell that tab-completes prefix?

I would like tab completion to behave differently when the cursor is at the beginning of a word than when the cursor is at the end of a word. I've only ever seen shells that tab-complete the suffix, ...
1
vote
0answers
45 views

Completion with wildcards in directory names in bash [duplicate]

I can do: $ cd sources/ar #[TAB] here would complete word 'ar' to 'art' I can do $ cd */art #[enter] here would bring me to sources/art I can do $ cd */art #[TAB] that would expand */art to ...
1
vote
1answer
133 views

Something like $CDPATH that works for all bash commands

I'm trying to figure out if there's a way I can get $CDPATH working for every command-line tool. At the moment, I have a directory in my homedir that's called src/ which contains all of my projects. ...
3
votes
1answer
374 views

zsh completion: menu and unambiguous prefix with a single tab?

I'm in a folder where I have the following files: aaa1 aaa2 aaa3 bbb1 bbb2 bbc1 bbc2 and I have typed cd a at the prompt. Currently, pressing Tab completes to cd aaa then another Tab brings ...
1
vote
1answer
78 views

Autocomplete deletes last character from words sometimes

I have a custom command define that gets words definition from dictionary. I wanted to make an autocomplete script to complete the words I want to define using the list of words found in /usr/share/...
2
votes
2answers
271 views

How to specify protocol prefix containing “:” to bash-completion function _known_hosts_real

I am attempting to use bash-completion for URLs of the form "proto://host". Without the ":", I see expected behavior, with the ":" present, the URL comes out "faulty". Bash completion has a function ...
2
votes
1answer
300 views

Bash completion extra space when adding file directory

I have a script for extending bash-completion for certain commands. If I type command1 and do a tab, it should auto-complete with a file directory (and the files). It works fine expect for one ...
1
vote
1answer
734 views

Colour-coordinate symlinks/softlinks based on where they refer to

Is there any way to colour coordinate symlinks/softlinks based on where they're linked, or maybe by who they 'belong' to (similarly to colouring the output of ls for example)? To give you an example ...
1
vote
1answer
107 views

How to use bash command completion so that only files within a particular directory are completed?

Suppose I have a bash function specialcat that cats a file in the ~/Special directory specialcat () { cat ~/Special/$1 } Suppose the ~/Special directory was set up like so: mkdir ~/Special echo ...
7
votes
1answer
356 views

How can I programmatically access zsh completion?

zsh has a completion system, activated by pressing tab: llama@llama:~$ git st<Tab> Completing main porcelain command stash -- stash away changes to dirty working directory status -- ...
2
votes
1answer
121 views

How to properly use “complete -G”? [duplicate]

I've generated the simplest code I could think of to illustrate my problem. Suppose I want the "foo" command to work with files that end with ".cc". complete -G '*.cc' foo Now let's suppose my ...
1
vote
2answers
964 views

Autocomplete hostnames when using SSH within history file

I'm looking for a feature that help me to autocomplete the servers I "sshed" in sometime and are in my .bash_history file without messing with known_hosts file or /etc/bash_completition, just grab ...
2
votes
0answers
40 views

How did I get the git commits to show up in autocomplete?

Git tab completion on my mac: Git tab completion on my Ubuntu server: On my mac and my Ubuntu server I get very different output from tab completion despite having the same version of zsh, same ...
1
vote
0answers
355 views

Smart case completion in Bash?

In Vim, one can combine the following commands, :set smartcase + :set ignorecase, to make searching case-insensitive unless there is a capitalized letter in the search query, in which case it is case-...
1
vote
0answers
255 views

Can I change how zsh autocomplete works?

I love the zsh autocompletion for navigating in files with commands like cd, but some commands have weird autocompletion, for example: when i type snap ins, bash autocompletes that to snap install, ...
2
votes
1answer
701 views

How to change the key for autocompletion in ZSH?

I'm on Ubuntu Mate 16.04 using terminator as my terminal. And using zsh version 5.1.1. I'd rather change the keybinding to the left arrow key to emulate fish in a way. Anyone know how?
1
vote
1answer
249 views

How to stop bash being too smart restricting completion options?

I often come across bash getting in my way when I'm doing something like this: cmake -DCMAKE_INSTALL_PREFIX=/usr/<TAB><TAB> Apparently, bash doesn't see that cmake can accept paths and I ...
3
votes
0answers
323 views

custom zsh autocomplete

I'd like to write a zsh completion for pytest. Where do I Start? I'm using oh-my-zsh. in .zshrc: fpath=($HOME/.mycompletions $fpath) autoload -U compinit && compinit -u in $HOME/....
4
votes
1answer
296 views

What can bash do: syntax highlighting, git info prompt and autocomplete based on the middle of a word?

I'm using prezto framework for zsh and started wondering if I really need zsh. Main features I really enjoy are: syntax highlighting for commands, fancy prompt when in a git repository and the ...
2
votes
1answer
300 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
294 views

zsh auto completion certain parts of directory

I currently have zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' which will ignore the case when auto completing directories. However is it possible to type a certain part of the directory and ...
5
votes
1answer
224 views

Bash completions -C vs -F

In the bash completion setup (https://github.com/scop/bash-completion) supplied by my system there seems to be an unequivocal preferences towards completing with complete -F as opposed to complete -C. ...
22
votes
1answer
603 views

Completion for the first argument of cd OLD NEW

In zsh, the cd command has a two-argument form: cd OLD NEW changes to ${PWD/OLD/NEW}. With the new-style completion system, zsh is capable of completing NEW: the second argument is completed based on ...
4
votes
1answer
1k views

How to enable bash completion in vi mode on Synology DSM6

When I turned on vi mode in bash by setting set -o vi suddenly the tab completion was broken, and a literal tab was inserted. How can this be fixed?
3
votes
1answer
153 views

How to include all PIDs in tab completion?

When I enter a command that takes a process ID (such as kill and strace -p), ZSH's tab completion offers what looks like the PIDs of the processes running in my current shell session. How can I make ...
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 ...
6
votes
3answers
3k views

zsh fails at path completition when command is vim

When I try to autocomplete files (with vim as argument 0): vim ~/.conf <TAB> It shows: _arguments:450: _vim_files: function definition file not found _arguments:450: _vim_files: function ...
3
votes
1answer
429 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 ~/....
1
vote
0answers
59 views

Can I get zsh to include the directory stack in tab completion for tilde (~)?

I have autocd, autopushd and pushdminus enabled. When I try tab completion with ~: $ ~<Tab> avahi ftp mail redsocks systemd-coredump systemd-timesync bin gdm nm-openvpn ...
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 ...
1
vote
1answer
628 views

Can I selectively disable zsh completions?

I'm using prezto with zsh, and find it a little slow to launch a new shell. (N.B. I'm attempting to optimise on a fast-ish system, before moving my configuration to other, slower systems.) ...
3
votes
1answer
404 views

zsh: menu completion for glob

In zsh, if I type vim *.txt then Tab, it expands to vim f1.txt f2.txt f3.txt. How can I make it show a completion menu listing files matching the pattern, so I can select a single file?
7
votes
1answer
301 views

Why does nullglob affect tab completion?

After shopt -s nullglob, I noticed that tab completion completely stopped working. Why would that be? extglob is apparently benign, what else could nullglob affect? Observed on: Ubuntu 14.04 (bash 4....
1
vote
0answers
654 views

Disable Oh-My-ZSH Completion of Beginning of Filename

I'm starting to use the directory stack in ZSH, but I've run into a problem. In an ideal directory, typing cd -<TAB> gives me the output of dirs -v. However, in some others (i.e. my Downloads ...
9
votes
2answers
1k views

Add trailing slash in bash completion of directory symbolic links

I have a symbolic link for a directory, e.g ln -s /tmp /xxx Now when I type /xx and press tab key, bash would complete the line to /xxx If I press it again it become /xxx/ Now, how can I ask bash ...
7
votes
2answers
1k views

Why does path-completion in bash not always work?

With different bash-environments (different installations) I have different behaviors in terms of path-completion when hitting TAB on the command line after . Where is this handled? One specific ...
5
votes
2answers
3k views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat file0001....
1
vote
0answers
96 views

How to have full completion in a run application dialog?

I've configured XFCE to execute gmrun as run dialog (Alt-F2). It works great with completion on commands but does not propose completion on arguments. How to set up a run dialog with full bash/zsh ...