dev-shell-essentials icon indicating copy to clipboard operation
dev-shell-essentials copied to clipboard

Does not work with zsh

Open sazzadislam-dsi opened this issue 9 years ago • 2 comments

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

sazzadislam-dsi avatar Oct 20 '16 12:10 sazzadislam-dsi

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"

matiasz8 avatar Mar 22 '21 20:03 matiasz8

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.

alexzanderr avatar Aug 13 '21 08:08 alexzanderr