DEV Community

Yuto
Yuto

Posted on

How to customize Terminal

Introduction

Hi, I'm JavaScript/TypeScript Developer from Japan.
I like Vue.js, React.js etc...

I'd like to share my Terminal setup.
Ese1MIlUUAMXMs-

Install iTerm2

Download here.
https://iterm2.com

Change appearance

Install oh-my-zsh

oh-my-zsh is a setting framework for zsh.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Use Powerlevel 10k

Powerlevel 10k is a pulgin about appearance.

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode

Open .zshrc.

open ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

And edit it like this.

ZSH_THEME="powerlevel10k/powerlevel10k"
Enter fullscreen mode Exit fullscreen mode

Install font

Download here.
https://github.com/powerline/fonts/blob/master/SourceCodePro/Source%20Code%20Pro%20for%20Powerline.otf

And clone.

git clone https://github.com/powerline/fonts.git --depth=1
Enter fullscreen mode Exit fullscreen mode

Next, install it.

cd fonts
Enter fullscreen mode Exit fullscreen mode
./install.sh
Enter fullscreen mode Exit fullscreen mode
cd ..
Enter fullscreen mode Exit fullscreen mode
rm -rf fonts
Enter fullscreen mode Exit fullscreen mode

Set up Terminal

Move to iTerm2, and open Preferences→Profiles→text.
Change Font to Source Code Pro for Powerline.
_2021-01-24_19.30.58

Open Preferences→Profiles→color.
I chose Solarized Dark.
_2021-01-24_19.30.58
Done!

Show predictive completion of commands

Install zsh-autosuggestions.
https://github.com/zsh-users/zsh-autosuggestions

At first, clone it.

git clone [https://github.com/zsh-users/zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) $ZSH_CUSTOM/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode

Next, edit .zshrc and append zsh-autosuggestions.

plugins=(
    git
    zsh-autosuggestions
)
Enter fullscreen mode Exit fullscreen mode

Update your setting.

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Set up alias

Open .zprofile and append an alias.

alias g='git'
Enter fullscreen mode Exit fullscreen mode

You can enter "g" instead of "git".

g push
Enter fullscreen mode Exit fullscreen mode

Next, set the frequently used git command as an alias.
Open .gitconfig and append an alias.

[alias]
    co = checkout
    ps = push
    st = status
    br = branch
Enter fullscreen mode Exit fullscreen mode

For example, you can enter "g ps" instead of "g push".

g ps
Enter fullscreen mode Exit fullscreen mode

Conclusion

For reference, I have published my .gitconfig file.
So please copy and use it.
https://github.com/n199603/dotfiles-public

And please follow me on Twitter.
If you have a project, please contact me on Twitter.
https://twitter.com/n199603

That's how to customize terminal.
Thank you for watching.

Discussion (0)