How to setup your terminal as a Senior developer

Martin Slaby
6 min readJul 21, 2023

--

Overview:
1. Understanding the Importance of a Well-configured Terminal
2. Navigating the Command Line
3. Customizing with dotfiles
4. Text Editors and Terminal Integration
5. Conclusion

1. Understanding the Importance of a Well-configured Terminal

In the world of development, having a well-configured terminal is almost an essential. The terminal, a text-based interface. Unlike GUI (guided user interface) offers efficiency and complete control over tasks. Although GUI can be much simpler and intuitive for fist-time developers. Mastering your command-line skills will pay-off in the long run.

Its way easier than you think. Open your terminal emulator, and you’re greeted with a simple text prompt, ready for your commands. Choose a suitable terminal emulator for your OS, like “Terminal” for macOS and Linux or “Command Prompt” for Windows.

Mastering the terminal opens up a new level of efficiency and control, streamlining your development workflow and empowering you to become a more proficient web developer. In the following sections, we’ll explore customization and optimization techniques for your terminal setup, helping you make the most of its potential.

2. Navigating the Command Line

When you open up your terminal for the first time, you will typically see a text-based interface with a prompt indicating your current location in the file system. The prompt usually includes the username, the hostname of the computer, and the current directory. It may look something like this:

MacOs terminal app

The symbol $ at the end of the prompt indicates that the terminal is ready to accept commands from the user.

  1. Navigating the File System: The user can start exploring their file system using basic commands like ls to list files and directories, and cd to change directories. They should try navigating to different locations to get familiar with the directory structure.
  2. Learning Basic Commands: It’s essential to learn some basic commands like pwd (to show the current directory), mkdir (to create a new directory), touch (to create a new file), and rm (to remove files or directories). Understanding these commands will help them perform essential tasks.
  3. Getting Help: The terminal offers help and documentation for commands. The user can access a command’s manual by typing man command_name. For instance, man ls will show the manual for the ls command, explaining its options and usage.
  4. Practicing Safe Commands: When starting out, users should be cautious with powerful commands like rm, which can delete files permanently. It's a good practice to use the -i (interactive) option with such commands to confirm their actions before proceeding.

3. Customizing with dotfiles

All modern-day terminals can be used without touching anything out of the box, but their true potential shines when customized to suit your workflow and preferences. One of the most common and efficient ways to achieve this level of customization is through dotfiles.

What are Dotfiles?

Dotfiles are configuration files that start with a dot (e.g., .bashrc, .zshrc, .config/fish/config.fish). These files reside in your home directory and hold various settings and customizations for your shell and other command-line tools. Dotfiles allow you to fine-tune your terminal environment, set aliases, define functions, and change the appearance of your prompt.

Customizing your shell with dotfiles is really just matching your unique needs with your terminal functions. You can turn your shell into a personalized, efficient, and visually appealing environment that suits your workflow and preferences. Here’s what you can achieve with dotfiles:

Aliases and Functions: Dotfiles enable you to create aliases and functions for frequently used commands. Shorten complex commands or chain multiple commands into a single alias for effortless execution. For instance, instead of typing git status, you could create an alias like gs to achieve the same result.

alias cm="git commit -m"
alias ggp='git push origin "$(git symbolic-ref --short HEAD)"'
alias rebase="git fetch && git rebase origin/master"

in code snippet above, you can see how aliases can be usefull when working with Git.

Prompt Customization: Tired of the plain old prompt? With dotfiles, you can transform your terminal prompt into a dynamic and informative space, displaying useful information like the current directory, Git branch, or even system statistics. A customized prompt not only looks stylish but also keeps you informed about your environment, making navigation and Git interactions more efficient.

autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:git:*' formats '| %F{45}%b%f'
setopt PROMPT_SUBST
PROMPT='%n | ${PWD/#$HOME/~} ${vcs_info_msg_0_} > '

In this example you can see, updated command prompt to be showed in this format: "user | current-location | current-git-branch >” + formatted to colour the git branch section.

Colour Schemes: Inject life into your terminal with vibrant color schemes. Dotfiles allow you to change the color palette of your terminal, making it more visually appealing and easier on the eyes. With the right color scheme, you can distinguish between different file types, spot errors more quickly

Choosing already existing dotfile

Creating dotfiles from scratch can be time-consuming, especially if you’re new to terminal customization. Luckily for us, there are many configuration out there, that are already proven to be usefull. For our time's sake, lets list couple of usefull links here:

  1. Git aliases — https://github.com/mdumitru/git-aliases/blob/master/git-aliases.zsh
  2. Awesome dotfiles — https://github.com/webpro/awesome-dotfiles

Where to Find Pre-existing Dotfiles

GitHub, in particular, is a popular repository hosting service for version control using Git. Developers actively share their dotfiles on GitHub, making it an excellent place to search for pre-made configurations. You can find these dotfiles by simply searching for “dotfiles” on GitHub or by adding the specific shell name (e.g., “Bash dotfiles” or “Zsh configurations”) to refine your search.

Another approach is to explore popular developers profiles on GitHub who are known for their dotfiles collections. These repositories often include detailed explanations of their configurations, allowing you to learn from their setups and adopt the parts that resonate with your workflow.

  1. Mathias Bynens: GitHub profilehttps://github.com/mathiasbynens
  2. Paul Irish: GitHub profilehttps://github.com/paulirish
  3. Zach Holman: GitHub profilehttps://github.com/holman

4. Text Editors and Terminal Integration

Visual Studio Code (VSCode) has quickly become one of the most popular code editors among web developers due to its versatility, performance, and extensive ecosystem of extensions. One of important features of VSCode is its seamless integration with the terminal, allowing developers to harness the power of the command line without leaving the comfort of their code editor.

VSCode’s terminal integration goes beyond merely providing an integrated terminal. Developers can take advantage of the terminal split view feature, allowing them to work on their code in one pane and have the terminal open in another pane simultaneously.

This split view enables quick interactions with the terminal while still keeping the code in sight. It’s perfect for debugging or monitoring logs while coding, promoting a more fluid and efficient development experience.

5. Conclusion

A configured terminal is essential for all developers across any point on their career paths, enhancing workflow and productivity. Mastering command-line skills provides complete control over tasks, enabling efficient work. Customizing the terminal with dotfiles creates a personalized environment with aliases, functions, and visually appealing prompts. Integrating VSCode and the terminal streamlines development, enabling seamless switching between coding and executing commands. All of those things combined empower your web development journey.

--

--