I am attempting to write a shell script utility that wraps other shell utilities into a single CLI and am trying to get shell completion to work in zsh and bash.
For example, let's say the CLI is named util:
util aws [...args] #=> runs aws
util…
I have a problem with the zsh tab completion: After running:
autoload -U compinit
compinit
Git tab completion for files does not work any more. For example if I type git add my_f to complete my_file, nothing happens. The zsh git completion only…
On MacOS Big Sur 11.3, here is my .zshrc. I would like to get the latest modified or create files and directories near to the prompt (sorted from the most recent up to the oldest ones). Here my current config in ~/.zshrc :
# ZSH completion
autoload…
I have a Git alias update that I would like to outfit with branch-name completion. The alias is defined like so:
[alias]
update = "!f() { git push . origin/$1:$1; }; f"
(It updates a local tracking branch with its upstream version, without…
I currently configure my zsh tab completion with:
autoload -U compinit && compinit
zstyle ':completion:*:default' menu select=0
zstyle ':completion:*:default' select-scroll 0
What I like about this is:
unambiguous completions get completed…
I am working on a git project.
Since I have a lot of folder deepness, I would like to improve my auto-completion to work with filenames and not only paths.
Here is an example:
$git status …
Vim has a "smartcase" feature, which makes searching case insensitive, but only if the search contains all lowercase letters. When you search on any uppercase letters, smartcase assumes you want a case sensitive search. Is there a way to get the…
zsh is great but its completion system is very diverse. And the documentation lacks good examples. Is there a template for completing for a specific application. The completion would get its match data from a file, separated by newlines?
I tried…
I've updated git to its latest version (2.29.0) and I'm using ZSH 5.8.
I used to switch between branches with git checkout remote_br to quickly switch between branches, even if the branch is only a remote one atm. I've seen git has made a lot…
Sometimes I want a filename instead of what zsh guesses for me. For example, I have a PNG file without a proper .png suffix, which makes zsh think it isn't a picture and won't list it when I type Tab to complete arguments of display.
I am wondering…
Having been dragged into the 21st century by macOS Catalina now defaulting to zsh instead of bash for its shell, I'm trying to restore some of the bash's line editing behavior. Specifically, if I am at the end of the line:
bash$ ls /foo/bar/baz
and…
Many times I end up writting wrapper function around existing ones, for instance:
function gl {
some_computed_stuff=...
git --no-pager log --reverse $some_computed_stuff "$@"
}
function m {
make "$@" && notify-send success || notify-send…
I've been searching online for a lot of hours, puling an all nighter because i got so lost down this rabbit hole :D but i'm having trouble finding examples with working code.
I have a bash script that is called upon like the following…
I'm using zsh and oh my zsh, and I'm a bit confused about where to put completion files.
For example, when installing kind, I'm doing this:
brew install kind
kind complete zsh > ~/.oh-my-zsh/cache/completions/_kind
And I expect that completions for…
I frequently open applications on my Mac by using the command open -a . I also have been using tab autocompletion more recently to complete my commands. I tried to do this after writing, for example, open -a or open -a Safa, but…