Skip to main content
99 votes

How can I make zsh tab completion fix capitalization errors for directories and files?

TL;DR: This is possible if you put these lines in your zsh config file, usually ~/.zshrc: autoload -Uz compinit && compinit zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' A little bit ...
mpy's user avatar
  • 28k
22 votes

Completion stops working in /root directory

Tab-completion of file names isn't done by asking "sudo cat" to provide suggestions; it's done directly by the shell that you're currently typing commands into. And since that's not running ...
grawity_u1686's user avatar
9 votes
Accepted

Tab completion for command arguments fail in Cygwin due to `.exe` extension

It turns out that there is a configuration option in Cygwin that configures Bash to not include a filename’s .exe extension when it completes the name of a command. Enabling the completion_strip_exe ...
Anthony Geoghegan's user avatar
8 votes
Accepted

Tab completion closes SSH connection

I assume the shell is bash. Hypothesis There is set -e in one of your startup scripts. Then Tab may trigger this: Enabling set -e in the shell causes bash-completion to terminate the shell. This is ...
Kamil Maciorowski's user avatar
7 votes

How can I get bash to perform tab-completion for my aliases?

This is the manual way, for those that are looking for this. First, look up the original completion command. Example: $ complete | grep git complete -o bashdefault -o default -o nospace -F ...
wisbucky's user avatar
  • 3,166
7 votes

How can I get bash to perform tab-completion for my aliases?

Is there a way to generically/programmatically get all of my completion scripts to work with my aliases? Yes, here is the complete-alias project which solves your problem exactly. It provides generic ...
Cyker's user avatar
  • 391
6 votes
Accepted

How do I make bash completion behave like this?

Setting these options in .inputrc is close: set show-all-if-ambiguous on set menu-complete-display-prefix on TAB: menu-complete set colored-completion-prefix on set colored-stats on It combines step ...
Zbyněk Winkler's user avatar
5 votes
Accepted

zsh: Select menu auto-completion with single Enter/Return press

Turns out I was missing this line in my ~/.zshrc: zmodload -i zsh/complist (should be placed before bindkey -M menuselect '^M' .accept-line) Solved in this github gist by github.com/okapia <3 ...
Kipras's user avatar
  • 191
5 votes

Bash partial glob expansion

The best method to simulate this auto-completion behavior is to enable the show-all-if-ambiguous readline variable (to display the possible completions if more than one match is found), then invoke ...
Travis Clarke's user avatar
4 votes
Accepted

How do I get zsh tab completion to "vi **/foo<TAB>" to match and complete the first file matching "foo*" anywhere under the current directory?

Add the following to your ~/.zshrc file (or paste it into the command line, to try it out): # Load Zsh's new completion system. autoload -Uz compinit && compinit # Bind Tab to complete-word ...
Marlon Richert's user avatar
4 votes

Bash Autocomplete Subdirectory for Custom Command

That's right, bash_completion is a solution. I can tell you what I have in my Ubuntu. I hope things are at least similar on Mac. There is /etc/bash_completion file which sources /usr/share/bash-...
Kamil Maciorowski's user avatar
4 votes
Accepted

Why would bash refuse to be case-insensitive?

I suggest: bind 'set completion-ignore-case on'
Cyrus's user avatar
  • 5,601
4 votes

zsh completion list-colors - partial colouring issue

Quoting a very helpful zsh-users mailing list post: [...] list-colors patterns have to be able to properly color completions (alone), descriptions (alone but with lots of trailing whitespace), ...
Orangenhain's user avatar
3 votes

Tab completion for .bat files in Git-for-Windows Bash

I've manged to get this working, I found a post about getting .sh files to work in Git Bash using this on the first line of the file: #!/bin/sh This also works when placed on the first line of ....
The Coder's user avatar
  • 151
3 votes
Accepted

Run command on tab completion in zsh

I'd suggest to write a completion function for your cdgit function. Put this file named _cdgit into a directory which is in your $fpath, e.g. /usr/share/zsh/site-functions, then start a new shell ...
mpy's user avatar
  • 28k
3 votes
Accepted

Add strings to zsh tab completion for all commands and arguments

Had to dig through the zshcompsys manual to find out the right commands The below code at the end of ~/.zshrc works for me function _my_completions() { local -a mywords mywords=( foo bar ) ...
woodstok's user avatar
  • 981
3 votes

How can I turn off completion cycling in zsh?

What you're looking for is setopt noautomenu See https://serverfault.com/questions/109207/how-do-i-make-zsh-completion-act-more-like-bash-completion for a full list of options
Matt's user avatar
  • 131
3 votes
Accepted

Is it possible in bash to complete the middle of a word?

From the bash man page: compgen [option] [word] ... If word is specified, only those completions matching word will be displayed. You're already filtering the list with grep, so to get the ...
DMN's user avatar
  • 46
2 votes

Can you get rid of file extensions for bash commands in cygwin?

Enabling the completion_strip_exe option (specific to the Cygwin port of Bash) does what you want: shopt -s completion_strip_exe For more details, see my answer to a similar question.
Anthony Geoghegan's user avatar
2 votes
Accepted

Bash Autocomplete Subdirectory for Custom Command

This is an enhancement of Kamil’s excellent answer that strips the hyphen from the -module part of each sub-directory name. bugfix) curdir=$(pwd) cd public/submodules/ 2>/dev/null &&...
Anthony Geoghegan's user avatar
2 votes

How to Expand Abbreviations Inline in Fish Shell?

Fish currently only allows abbreviation expansion in the command position. Which means, for example, it works after the | (pipe) symbol but not in the middle of a command. There have been many issues ...
Kurtis Rader's user avatar
  • 1,537
2 votes
Accepted

Why does a value '-' (hyphen) in "tag-order" style prevent matching of the "executables" tag even if that tag is explicitly specified?

The executable tag invokes _files -g '*(-*) in this case. Then _files calls more _tags, so it would be necessary to specify these implicitly specified tags in the completion functions, too. zstyle -e ...
hchbaw's user avatar
  • 536
1 vote
Accepted

Git not autocompleting with the switch command

Git for Windows does not ship with tab completion support for PowerShell. You had an outdated version of Posh-Git installed, a third-party package that provides tab completion for Git in PowerShell. ...
Daniel B's user avatar
  • 63.8k
1 vote

How do I resolve a keybinding conflict with coc for vim?

The tab key mapping in vimwiki was conflicting with my coc.nvim autocomplete too, add this in your init.vim au filetype vimwiki silent! iunmap <buffer> <Tab>
user1268420's user avatar
1 vote
Accepted

Tab doesn't expand the path when using $_ to access the previously typed path

zsh When you type cp $_Tab (note there is neither space nor / after _), the shell is able to expand $_; but most likely there are more variables that start with _ and the shell cannot be sure you're ...
Kamil Maciorowski's user avatar
1 vote
Accepted

Enable all defined bash completion after a custom command

You basically want completions after oEd to behave like after exec. Let's copy this behavior. This is how you can find it: complete -p exec In my Ubuntu the output is complete -F _command exec. You ...
Kamil Maciorowski's user avatar
1 vote

Tab completion for .bat files in Git-for-Windows Bash

I can at least provide a workaround for those interested. I start with typing vi or ls followed by ./ and from there tab completion works then I just move the cursor to the start of the line with Home ...
Kasper-34's user avatar
1 vote

How can I turn off completion cycling in zsh?

If you have a clean Zsh installation with only this in your ~/.zshrc file autoload -Uz compinit && compinit -C then it shows a list of completions the first time you press tab. However, if ...
Marlon Richert's user avatar
1 vote

tmux completion (not shell completion)

Here is the thing I have found: https://tmux.reconquest.io I tried it. Basically you bind a key to their autocompletion. When you invoke that key, it will use the (part of) the word behind your ...
EfForEffort's user avatar
1 vote

How can I get bash to perform tab-completion for my aliases?

The answer given previously by kopischke works like a charm on Debian 10 only if you delete the alias_completion at the end Here is the correct snippet to paste in your ~/.bashrc: # Automatically add ...
roneo.org's user avatar
  • 196

Only top scored, non community-wiki answers of a minimum length are eligible