Setting Up My New Laptop - Dotfiles and Shell Configurations

12 June 2024
4.0 min read

When it comes to setting up a development environment, everyone has their own preferences and tools. Recently, I embarked on a quest to refine my setup, and it turned out to be quite an enlightening journey. I sought advice from different sources, including fellow developers and AI assistants like ChatGPT. Here''s a summary of what I found and how I set up my current development environment.

cover

Asking Around

I began by asking various developer channels about their configurations. The responses varied widely. Some developers prefer minimal setups with essential scripts, while others use specialized tools for more elaborate setups.

Many users grow their configurations organically on a per-machine basis. Tools like Dotbot and Ansible were frequently mentioned for facilitating quick setups. There was also a strong emphasis on shell history management and tool versioning through asdf. Most users store their dotfiles on GitHub for easy synchronization and versioning.

Interestingly, most people I talked to preferred other shell customizations instead of default one:

  • Zsh: This was the most popular shell, often used with frameworks like Oh My Zsh and Powerlevel10k for enhanced functionality and aesthetics.
  • Fish: Some users favored Fish for its out-of-the-box usability.

To automate the setup of dotfiles and configurations, tools like Dotbot, Chezmoi, and Ansible were highlighted:

  • Dotbot: Often used for automating the installation of dotfiles.
  • Ansible: Used for more complex setups where multiple configurations need managing across various systems.
  • Chezmoi: Considered for managing dotfiles across multiple machines.

Oh My Zsh came up several times, recommended for its plugins and ease of use. Some users also preferred using Warp terminal combined with Oh My Zsh.

Consulting AI: ChatGPT’s Recommendations

Modern problems require modern solutions, so I asked ChatGPT to recommend open-sourced setups, especially those by frontend engineers. I preferred such focus in hope that it is more relevant for my day-to-day work. Here are the suggestions I got:

All these setups have garnered significant attention on GitHub. However, Mathias’ and Paul’s setups seemed a bit dated, as they do not use Oh My Zsh, which I consider a slight drawback.

I also asked ChatGPT for references from Russian, Ukrainian, or Belarusian developers, hoping to consider setups by the people I know personally or follow for a long time. Quite funny that initially the GPT suggested imaginary people with broken GitHub links. However, after refining my request, it recommended few links and Denys Dovhan’s dotfiles among them. Interestingly, I had used Denys’ setup on my old laptop, though last time I checked it out was in 2020.

Making a Choice

I revisited Denys’ dotfiles, comparing them with other recommendations. The use of Oh My Zsh and fish-like autosuggestions stood out.

The README mentioned that Denys’ setup was inspired by Artem Sapegin’s dotfiles. Artem's setup is actively maintained and includes installing necessary programs via the Homebrew package manager. This goes beyond terminal setup, allowing the installation of browsers, Notion app, GitHub Desktop, and more with a single command. The only missing applications were Figma and Anki, which I installed separately.

Another highlight of Artem's setup is the "Squirrelsong" color theme for various applications. I installed its dark version for iTerm and VSCode. The low contrast is easy on the eyes, making screen time more comfortable.

Ultimately, I went with Denys’ dotfiles. They didn’t require special configuration, but I needed to add some parameters in .zshlocal:

  1. SPACESHIP_DIR_TRUNC_REPO=false: Shows the full path to the directory in a cloned repository.
  2. SPACESHIP_PACKAGE_SHOW_PRIVATE=true: Displays version info for private packages in the prompt.
  3. source "$HOME/.zsh/spaceship/spaceship.zsh": I cloned Spaceship to ~/.zsh instead of the assumed structure, so I sourced it manually.

Spaceship Prompt

All my tweaks revolved around the Spaceship prompt, a minimalistic, powerful, and highly customizable Zsh prompt. The fact that it's a separate, mature project signals excellent solution management.

My Current Setup

The research took about two days, but the installation and tuning only took two hours. This included setting up all applications, not just the dotfiles. Here are the features I enjoy:

  • Oh My Zsh aliases:
    • -cd -
    • mdmkdir -p
    • ...cd ../..
  • Folder shortcuts:
    • dlcd ~/Downloads
    • dtcd ~/Desktop
    • The other shortcuts assume that I follow the suggested directory structure and I didn’t follow this advice. So, it would make me set up my own for quick navigation to the project under development.
  • Git aliases:
    • git agit add
    • git bgit branch
    • git cogit checkout
    • To many other aliases, I haven’t yet used to. But thanks for the tips, I hope to get it soon.
      tip
  • Customized prompt:
    It provides necessary information about the project and its current Git status.
    prompt

Exploring and setting up my development environment was a valuable experience. By combining insights from fellow developers and AI recommendations, I’ve tailored a setup that enhances my productivity and efficiency. Whether you prefer simple scripts or complex tools, there’s always a way to improve your workflow. Don't hesitate to explore different setups and find what works best for you.

Credits

Cover photo by Tracy Adams on Unsplash

Did you notice a typo? Welcome to edit this page on GitHub. Thank you!

You can hire me and the whole Bridge-the-Gap team to set up, manage, develop, and champion your design system. I can align the design and development processes in your organisation for a larger business impact.

© Varya Stepanova 2024