Hi! Today I'm gonna talk about my daily developer workflow and all the tools I use to set up a productive enviroment for coding. I think having a nice looking terminal and some tools to save time are really helpful to keep you productive in daily coding sessions.
Operating System
I use Windows and it's pretty much unusable for programming. Thankfully Microsoft understood that and made Windows Subsystem for Linux also known as WSL
in short. It lets you run a Linux distribution inside of Windows.
I use Ubuntu, it's the default distribution that is installed with WSL
. Ubuntu is really simple to use and has a huge community so getting support is very easy. I highly recommend it for anyone who wants to start using Linux and get familiar with basic Linux commands.
Shell
Ubuntu by default comes with the bash shell. Bash is great but I personally find it harder to customize. That is why I use Z shell, more commonly known as zsh
. To manage my zsh
configuration, I use Oh My Zsh. It has a huge community and makes it trivial to install and use plugins.
I used to use fish which is also a great shell. It has very sensible defaults and comes with a lot of cool features like autosuggestions, tab completions, etc. out of the box without the need to set up anything. The only problem with fish is that it is not POSIX-compliant
. POSIX is a set of standards that define how to develop programs for UNIX based operating systems. So in fish, things like bash scripts do not work. They have their own scripting language.
zsh
on the other hand is fully POSIX-compliant. This is why I switched to zsh
and I'm quite happy with it so far.
Prompt
I use Starship for my prompt and it is AMAZING. Written in Rust, Starship is a minimal, highly customizable and super fast prompt. The default look of it is really good but literally every little detail is customizable to your liking. To install Starship refer to these docs.
The configuration file for Starship lives in ~/.config/starship.toml
. Here's my starship.toml
.
# ~/.config/starship.toml
[aws]
symbol = " "
[conda]
symbol = " "
[dart]
symbol = " "
format = "via [$symbol]($style)"
[directory]
read_only = " "
truncation_length = 1
[docker_context]
symbol = " "
[elixir]
symbol = " "
format = 'via [$symbol]($style)'
[elm]
symbol = " "
[git_branch]
symbol = " "
[golang]
symbol = " "
format = 'via [$symbol]($style)'
[hg_branch]
symbol = " "
[java]
symbol = " "
format = 'via [$symbol]($style)'
[julia]
symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
format = 'via [$symbol]($style)'
[package]
symbol = " "
[perl]
symbol = " "
[php]
symbol = " "
[python]
symbol = " "
format = 'via [$symbol]($style)'
[ruby]
symbol = " "
[rust]
format = 'via [$symbol]($style)'
[scala]
symbol = " "
[shlvl]
symbol = " "
[swift]
symbol = "ﯣ "
format = 'via [$symbol]($style)'
[git_status]
disabled = true
The icons aren't showing up here because you need a nerd font for that. If you set up a Nerd Font (I recommend JetBrains Mono), and copy this configuration, you'll get a very minimal looking prompt like this. For more information on configuring Starship, you can look at the docs here.
Having a nice looking terminal always helps!
Persistent Terminal Sessions with tmux
tmux is a terminal multiplexer. It lets you have multiple persistent terminal sessions and come back to them without terminating the existing running processes. So you can return to a workspace, exactly where you left it. It also allows you to manage multiple windows and panes inside a session.
For example, to go to my website's workspace, I just have to type website
and I'm there.
Here website
is an alias I've set up to open the website
tmux session.
# .zshrc
alias website="tmux attach-session -t website"
This way I can jump into any one of my workspaces really quickly and start coding. It also helps that I'm exactly where I left off. I highly recommend tmux for local development, it has changed how I work and increased my productivity by a massive amount.
Neovim
I had been using VSCode as my code editor since the first day I started learning programming, but recently I have switched to Neovim. It is a modern version of Vim.
Neovim is the best code editor for me because of its speed and ease of customization. All the configuration is written in Lua, which is very easy to learn and write. It helps me be really fast and productive because I never have to take my hands off of my keyboard.
You can find my Neovim configuration here. It's just a fork of craftzdog's configuration.
zoxide
You might have seen in some of the screenshots that I just have to run z license-generator
to jump to that directory. That is zoxide
. Also written in Rust, it's a smarted cd
command that remembers which directories you visit frequently, so you can jump to those directories with just one command.
The above GIF is from the zoxide
GitHub repository. Use zoxide
to never go back to cd
hell again.
exa
exa
is a modern replacement of the ls
command. I always find myself using exa
to get familiar with the files in a new codebase.
As you can see in the screenshot, exa
has a more readable output with colors and icons which you can look at and instantly know the filetypes of different files. It is also noticeably faster than ls
.
It also has a lot of flags which display the data is different formats. Here are the aliases I've set up for exa
.
Conclusion
That was a quick overview of all the tools I use on a day-to-day basis for coding. I think it's really important to spend some time working on your workflow and coding setup, it will make you faster over time. I hope you found the tools I listed useful and will incorporate them in your workflow too!
Thanks for reading!
Latest comments (45)
Thanks so much for your inspiring post!
Just curious why are you using windows?
Can't use linux at the moment because of some school specific software. Hoping to switch to a mac next year in college though.
I had a similar experience to you. I have been using windows for more than 20 years, then switched to mac several years ago, like moving to the Garden of Eden. I hope you will get that soon!
I did try to use WSL for a while but finally quit due to no GUI support. So Admire your Adaptability!
very nice config
But i have an issue. Lsp didnt attach when i am using mnt/d/
Do you have the solution
Thank you!
oww,, awesome article
Love the article. Thanks for introducing me to
exa
. This thing is great.Glad you like it!
Hello, I am having some problems when I tried to copy your configuration. First one is colorscheme not found, I tried to do as suggested on github repo of shaunsingh, but not worked. Second, I use cpp, and have clangd installed as language server, how to set that. Thank You fot the amazing article.
We have very similar setups. Which plugins do you use in your tmux?
I use just tmux-resurrect to store tmux sessions even after rebooting.
I recommend to use ubuntu or mint. I tried to use windows after 4 years :S I switch back to linux 3 days later :))
Def looking to switch to endeavour os when I go to college!
don't do endeavour. try to install Arch from scratch so you can learn the in and out of setting all the configs. After you are done, then go with whatever distro of arch.
I've installed arch before on a very old laptop. It wasn't fun to say the least 🤣
Time to switch to Linux. Btw I use arch.
I agree, I wanna switch to endeavour os when i go to college
Nice workflow and setup, especially since you're running inside of Windows and not in a barebone Linux! 👍🏻