Make Your Linux Terminal Enjoyable to Use

Daffa Haj Tsaqif - Dec 30 '23 - - Dev Community

At some point, we as Linux users or even Mac need to use a terminal at some point, whether to install something or do a software engineer task, or whatever it is. but you know, the terminal is boring and often becomes the main point of why people are afraid of Linux in general.

"Oh oh, it's scary, it's hard to use, I don't know these commands and stuff"

No more scared of terminals or using boring terminals that are a pain to use

I can't help with the scary commands because I think that's something that we need to learn along the way, but I guess I can help to make it a bit more bearable.

Okay, let's go!

Warning: this stuff needs quite a bit of resources compared to your stock one of course, so if your PC is a real potato you might want to back off a little bit I'm sorry

Ditch Bash to Use ZSH

Dont uninstall of course are you crazy? just add a new shell for your computer, we are going to install zsh to enable us to add fancy toys.

Mac users rejoice because iirc you guys have it by default

first, the installation is like the usual in your terminal, I use an Arch-based Linux distro, so it is going to be

sudo pacman -S zsh

If your shell doesn't change to zsh, type zsh then you should have something like this, standard zsh.

Standard zsh

OH...MY...ZSH!!

After this you going to visit Oh-My-Zsh which is where the magic will happen.

Oh My Zsh is an open-source, community-driven framework for managing your zsh configuration.

To install it you can use curl, wget, or fetch. I usually go with curl, so it's simply

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

After that, it will do its thing like moving your old zshrc to zshrc.pre-oh-my-zsh or some other thing but then you can have your zsh ready to go, and looks good.

Example of OMZ-Infused Zsh

you can check around the documentation, change the theme, add provided plugins on to your zshrc.

Custom Plugins

This is gonna be the main sauce, custom plugins, personally, I have 4 installed on my setup.

Syntax highlighting

This one helps you to syntax highlight your shell commands, giving clarity, and maybe help spot mistakes like missing quote opening.

git clone --depth 1 "https://github.com/zsh-users/zsh-syntax-highlighting.git" $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

Auto Suggestion

This is different from autocomplete since it suggests based on your previous commands, quicker if you want to use the command you used before

git clone --depth 1 "https://github.com/zsh-users/zsh-autosuggestions.git" $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions

Autocomplete

This one is probably still underutilized in my end but it's simply the most powerful plugin there

git clone --depth 1 "https://github.com/marlonrichert/zsh-autocomplete.git" $HOME/.oh-my-zsh/custom/plugins/zsh-autocomplete

History Substring Search

This is quite difficult to explain, the best I can explain is I can type git then I press up-arrow then it going to present me with my history git command I do, I use it extensively when I want to make a script or documentation.

git clone --depth 1 "https://github.com/zsh-users/zsh-history-substring-search" $HOME/.oh-my-zsh/custom/plugins/zsh-history-substring-search

Custom theme

This one is not needed if you already like the theme they have, but if you like me who I WANT MORE!! You can use powerlevel10k

This one is like a framework by itself so I will leave the git repo instead https://github.com/romkatv/powerlevel10k?tab=readme-ov-file

KABLAM!

Image description

There's more??

To be honest, we can go more, but some of this needs us to use a terminal often

"Alias" for example, is just a bunch of commands that we use often but too long, so we make short and easy-to-remember aliases so we can reduce our type or just make it easy to remember

These are some of the popular aliases there, provided excellently by Marius Colacioiu

This one is mine, saved as .aliases.sh then sourced it on my zshrc

Image description

What else??

What else we can add?? I guess it depends on our imagination no? Let me know in the comments what can I add here.

Cheers

EDIT: adding credit to the gist provider

. . . . . . . . .
Terabox Video Player