3

I'm using OHMYZSH but I'm thinking about building a minimal configuration to Zsh.

So here's the problem. Ohmyzsh has special behaviour for completion. For example: if I'm in my Home Directory and type cd mus and hit a TAB it will expand to cd Music, even I'm typing the sentence with small letters.

I've founded this:

Have zsh return case-insensitive auto-complete matches, but prefer exact matches

Which is my problem but on the contrary. I want to get case insensitive without install OHMYZSH.

Looking at the OHMYZSH structure, I've found this:

. ├── ./cache

├── ./CODE_OF_CONDUCT.md

├── ./CONTRIBUTING.md

├── ./custom

├── ./lib

├── ./LICENSE.txt

├── ./log

├── ./oh-my-zsh.sh

├── ./plugins

├── ./README.md

├── ./templates

├── ./themes

└── ./tools

8 directories, 5 files

Inside the lib folder, there are some config files.

lib

├── bzr.zsh

├── clipboard.zsh

├── cli.zsh

├── compfix.zsh

├── completion.zsh

├── correction.zsh

├── diagnostics.zsh

├── directories.zsh

├── functions.zsh

├── git.zsh

├── grep.zsh

├── history.zsh

├── key-bindings.zsh

├── misc.zsh

├── nvm.zsh

├── prompt_info_functions.zsh

├── spectrum.zsh

├── termsupport.zsh

└── theme-and-appearance.zsh

0 directories, 19 files

I've already tried to source the completion.zsh using Zinit(plugin manager for ZSH which enables load some OHMYZSH stuff) without success. I don't know what is the correct file for the behaviour I want.

This is my config:

#exports
export EDITOR=nvim
export VISUAL=code
export SUDO_EDITOR=nvim

# Theme
ZSH_THEME="spaceship"

#PLUGINS
#==============================================================
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

zinit light zdharma/fast-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-completions
zinit light agkozak/zsh-z

#THIS LINE IS MY ATTEMPT TO load OHMYZSH FILES
zinit snippet OMZL::completion.zsh
#==============================================================
### End of Zinit's installer chunk

What's the correct file to load? Or is there another way to get case insensitive completions?

danronmoon
  • 3,814
  • 5
  • 34
  • 56
Micael Viana
  • 107
  • 8
  • This answer looks like it might work: https://stackoverflow.com/a/69014927/9307265 – Gairfowl Oct 08 '21 at 16:39
  • That worked, I had not seen this part. I cannot mark your comment as an answer, but it is. So I will change the title to [solved]?? I don't know how to proceed. – Micael Viana Oct 10 '21 at 00:55
  • I'm not sure either :). I posted a comment to @AhmadAbdelghany at the linked answer, perhaps they'll see it and post an answer here. – Gairfowl Oct 10 '21 at 04:17
  • 1
    Please do **not** put “[SOLVED]” in the title. Either _close_ your question or add your own answer and accept it. – Marlon Richert Oct 10 '21 at 18:03

1 Answers1

8

After reading some comments I found a solution. Add these two lines to the Zsh config file:

zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
autoload -Uz compinit && compinit
Micael Viana
  • 107
  • 8