Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with zsh #5

Open
sazzadislam-dsi opened this issue Oct 20, 2016 · 2 comments
Open

Does not work with zsh #5

sazzadislam-dsi opened this issue Oct 20, 2016 · 2 comments

Comments

@sazzadislam-dsi
Copy link

can you add support for zsh specially with oh-my-zsh

@matiasz8
Copy link

matiasz8 commented Mar 22, 2021

I was going to write the same, the workaround for it that I found is copied / pasted the highlighting function in my zshrc.
Then just reload: $ source ~/.zshrc
And finally you can try:
$ ls | hightlight green "Doc"

@alexzanderr
Copy link

yes. i did the same. just copy the function into .zshrc. its more simpler than installing with oh-my-zsh

function highlight() {
	declare -A fg_color_map
	fg_color_map[black]=30
	fg_color_map[red]=31
	fg_color_map[green]=32
	fg_color_map[yellow]=33
	fg_color_map[blue]=34
	fg_color_map[magenta]=35
	fg_color_map[cyan]=36
	 
	fg_c=$(echo -e "\e[1;${fg_color_map[$1]}m")
	c_rs=$'\e[0m'
	sed -u s"/$2/$fg_c\0$c_rs/g"
}

works like a charm. because its has no dependencies.

afmpjr added a commit to afmpjr/dev-shell-essentials that referenced this issue May 17, 2024
- added quick fix to install command snippet
- added workaround for zsh

This resolves the issue [Does not work with zsh kepkin#5
](kepkin#5)
@afmpjr afmpjr mentioned this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants