Having a well-configured terminal setup can significantly enhance your productivity and make your development or command-line tasks more enjoyable. In this article, I'll walk you through my personal terminal setup, covering the font, theme, prompt, ZSH framework, essential tools/packages, and useful aliases and plugins.
While some users prefer terminal emulators like iTerm2 or Warp (it's just amazing) for their extensive feature sets, I have chosen to stick with my native terminal for a specific reason - the seamless integration with Visual Studio Code. As a developer, VSCode is my primary coding environment, and having a native terminal ensures a smooth and hassle-free experience.
I prioritize both aesthetics and functionality. To achieve this, I use the FiraCode Nerd Font in size 12, which is patched by Nerd Font to include various programming ligatures and icons. The inclusion of icons enhances the visual appeal and helps quickly identify different file types.
For the theme, I've opted for the "Pro Theme" which provides a professional and minimalistic look, making it easier to focus on the content.
To unlock the full potential of ZSH (Z Shell), I rely on the Oh My Zsh framework. It is a community-driven framework that offers a plethora of plugins, themes, and configurations to supercharge your ZSH experience.
The prompt (also known as the shell prompt) defines how the terminal prompt looks and behaves. Starship written in Rust, allows you to customize the prompt according to your preferences and displays relevant information like the current Git branch, package version, and system information.
Fig is a fantastic tool that enhances your shell autocompletion. It learns from your previous commands and suggests completions for commands, options, and arguments, saving you time and reducing typing errors.
Keeping your system and tools up-to-date is crucial for security and performance reasons. Topgrade is a fantastic tool that automates the update process for various package managers, including system packages, language-specific tools, and even GUI applications. With a single command, I can ensure everything is up to date effortlessly.
Exa is a modern replacement for the classic 'ls' command. It adds color to the output, displays icons for different file types, and offers a more feature-rich and user-friendly listing of directories and files.
Bat is a highly improved alternative to the 'cat' command. It not only displays the content of files but also adds syntax highlighting and line numbering, making code and text files more readable.
Aliases are shortcuts for commands, making them easier to remember and type. You can add aliases by editing your .zshrc file. Here are some of the aliases I use:
alias ls='exa --icons -a --group-directories-first': This alias replaces the traditional 'ls' command with 'exa', adding icons, showing hidden files, and grouping directories first.
alias cat='bat': By setting this alias, whenever I use 'cat' to view file contents, it automatically invokes 'bat'.
ZSH plugins provide additional functionality to the shell, making tasks more efficient and convenient. Here are some of the plugins I have integrated into my terminal setup:
- zsh-syntax-highlighting: Highlights the syntax of commands as you type, catching potential errors early on.
- zsh-autosuggestions: Suggests commands based on your history and current input, speeding up your workflow.
- colored-man-pages: Provides colored output for man pages, making them easier to read and understand.
- vscode: Provides several aliases for various VS Code commands.
- pnpm, yarn, npm: Aliases for package managers. For example, instead of typing 'pnpm install', I can simply type 'pin'.
- you-should-use: This reminds you that you should use one of your existing aliases for a command you just typed.
- command-not-found: Provide suggested packages to be installed if a command cannot be found.
With this finely tuned terminal setup, I can breeze through my daily tasks, whether it's coding, system administration, or just exploring the file system. By carefully selecting the right tools, fonts, themes, and plugins, you can create a terminal environment that aligns with your workflow and makes working in the command line a joyous experience. Happy coding!
Credit for the videos goes to the respective projects.