Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save n1snt/454b879b8f0b7995740ae04c5fb5b7df to your computer and use it in GitHub Desktop.
Save n1snt/454b879b8f0b7995740ae04c5fb5b7df to your computer and use it in GitHub Desktop.
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install plugins.

  • autosuggesions plugin

    git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

  • zsh-syntax-highlighting plugin

    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

  • zsh-fast-syntax-highlighting plugin

    git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting

  • zsh-autocomplete plugin

    git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete

Enable plugins by adding them to .zshrc.

  • Open .zshrc

    nvim ~/.zshrc

  • Find the line which says plugins=(git).

  • Replace that line with plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)

References

@UmairZahid490
Copy link

Jazak Allah

@UmairZahid490
Copy link

may Allah guide you about right path (Islam)

@mazyvan
Copy link

mazyvan commented Sep 8, 2023

This is great, thanks @n1snt

@rayyandeveloper
Copy link

Mashaalloh

@radomir-mijovic
Copy link

Thanks man!

@nicolasassi
Copy link

they don't work properly together! my terminal randomly crashes and i dont know why i guess zsh-autocomplete has conflict with others specifically when i push the up arrow for previous command sometimes the whole terminal crashes i dont know exactly but the problem it might be from fast-syntax-highlighting

Had the same problem and stop using the plugins all together which is a shame because when working as expected its awsome 😢

@yuanshanhshan
Copy link

nice

@Kana-fi
Copy link

Kana-fi commented Nov 18, 2023

I did as it says, now can't open nvim via iterm2 + the which command doesn't work, I tried which fish, which nvim - nvim not found, fish not found. But it works in native terminal, how to fix it

@Mr-NI
Copy link

Mr-NI commented Nov 21, 2023

I did as it says, now can't open nvim via iterm2 + the which command doesn't work, I tried which fish, which nvim - nvim not found, fish not found. But it works in native terminal, how to fix it

that because nvim is neovim, you can use nano, vim, emacs or any other text editor

@Kana-fi
Copy link

Kana-fi commented Nov 23, 2023

I did as it says, now can't open nvim via iterm2 + the which command doesn't work, I tried which fish, which nvim - nvim not found, fish not found. But it works in native terminal, how to fix it

that because nvim is neovim, you can use nano, vim, emacs or any other text editor

Seems to me you sound mean, relax pal🗿, you can clearly see I’m not really familiar to vim.

@juliancorrea
Copy link

does make sense to use fast-syntax-highlighting and zsh-syntax-highlighting together?

@zukonarya
Copy link

this is awesome

@hkhelif
Copy link

hkhelif commented Dec 13, 2023

This is cool, this is the closest thing to fig.io IMO while registrations are still closed

@mpartipilo
Copy link

I don't think I can ever use a terminal without this. Thanks!

@deulizealand
Copy link

zsh-autocompleete break the up arrow ( doesnt display all history ) on tilix terminal. any help about this ?

@Arlen-LT
Copy link

他们不能正常工作! 我的终端随机崩溃,我不知道为什么 我猜 zsh-autocomplete 与其他终端冲突, 特别是当我按下上一个命令的向上箭头时,有时整个终端崩溃, 我不确切知道,但问题可能来自快速语法突出显示

follow these steps:

  1. cd $ZSH_CUSTOM/plugins/zsh-autocomplete
  2. git pull --tags
  3. git reset --hard 23.05.24

This is a bug of zsh-autocomplete, see issue marlonrichert/zsh-autocomplete#645 and do not use the main/HEAD until a fix.

@Daviteusz
Copy link

After installing this, home and end buttons (and maybe more) stopped working for me.

Fast fix for home & end buttons:

cat <<EOF >> ~/.zshrc

# home & end buttons fix
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
EOF

@PleahMaCaka
Copy link

You have no idea how grateful I am to you

@yaozzzhao
Copy link

This is the best tutorial I've seen for zsh configuration so far. Thanks!

@dev4lentinho
Copy link

thanksssssssssssssssssssssssssssssssss

@pvbcoelho
Copy link

Niiiice!

@dgongut
Copy link

dgongut commented Feb 13, 2024

It works perfectly! Thanks!!

@benyaminbeyzaie
Copy link

That was great! Thanks!

@Simatwa
Copy link

Simatwa commented Feb 25, 2024

This is really cool.

One liner :

bash -c "$(curl -fsSL 'https://github.com/Simatwa/style-zsh/blob/main/style-zsh.sh?raw=true')"

@El-khamisi
Copy link

what a quick reference thanks

@mpartipilo
Copy link

mpartipilo commented Mar 4, 2024

If I may have everyone's attention, I'm looking for a way to have aliases being suggested to me while I'm typing a full command. Does anyone know a way to do this? So far I have only found omz plugins alias-tips and alias-finder, but those only show the alias tips after the command has been executed, which usually goes off screen with the command's output and requires scrolling back to see them.

e.g.

 ↳  git
Alias tips:
g=git
ga='git add'
gb='git branch'
gc='git commit --verbose'
gd='git diff'
gf='git fetch'
gg='git gui citool'
gl='git pull'
gm='git merge'
gp='git push'
gr='git remote'

@pratik-mahalle
Copy link

Thanks

@ogoes
Copy link

ogoes commented Apr 9, 2024

That is awesome! Thanks

@chill-patel
Copy link

Thanks

@glsconsulting
Copy link

Perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment