shellunixfishoh-my-zshoh-my-fish

How do I change the tab completion's behavior of oh-my-fish?


oh-my-zsh and bash's tab completion

In the tab completion of oh-my-zsh and bash, we have typed a command (for example,cut) and we want to a long option (for example,--delimiter) which should have a option's arguments behind it .

If we want using tab completion to help us to input the long option, oh-my-zsh or bash will input the long option with equal sign (for example,--delimiter=).

example

input following chars:

cut --d

if we using oh-my-zsh, and press TAB key,we'll get :

cut --delimiter=

if we using oh-my-fish, and press TAB key,we'll get:

cut --delimiter 

the equal sign(=) is changed into space sign().

Question

How do I change the tab completion's behavior of oh-my-fish to letting oh-my-fish's tab completion have equal sign(=) after a long option which should be followed by arguments.


Solution

  • That is not the responsibility of OMF. Completions are handled by fish. I thought there was an open issue discussing changing the current behavior to include the equal-sign but I can't find it. So feel free to open an issue at https://github.com/fish-shell/fish-shell/issues/new. However since almost all commands use the standard getopt_long() function (or something similar) which allows using either a space or equal-sign to separate the value from the flag you'll need to explain why this change is necessary.