Personalize Macos Environment for Your Productivity

MacOS is already a polished environment,

Investing the time to personalize your tools and environment is a smart move, especially if you plan to do your current profession for years to come. With a set of personalized methods and tools, you can make your routine tasks easier and more efficient.

In this guide, we’ll explore methods and tools that can help you personalize your environment to suit your needs as a developer. While not everything may be applicable to you, you’re sure to find some good ideas to steal or improve upon. We’ll go through a list of regular tasks that developers face and show you how customized tools can make your work easier and more enjoyable.

Why?

If you’re already sold to this idea go ahead and start, otherwise keep reading so I can convince you why you might want to start configuring your tools.

I first heard the term Personalized Development Environment in the video tj talks about why configuring Neovim editor for yourself is useful and good investment.

I think this approach works well with other tools too. If you are going to spend 20 years in this profession, you need your customized tools and environment to work with. That’s exactly why you learn touch typing. Being able to use keyboard with the least amount of effort is important.

You can go ahead with default configurations that come out of the box but those are not built for you, they are for everyone. Apple does not know you are going to a lot of meetings everyday and need ready tools to attend them. They don’t know your job involves constantly switching between two windows.

All of these actions have cognitive overhead to do with default settings. This automations are not primarily here to save your time, they are here so you can complete your stuff more easily. If you need to constantly search some documentation while coding, it’s a lot if you have to altTab to your browser find the browser tab and write in the search box, what if you could get a floating window that give you what you need inside the text editor so you don’t loose the focus? or even worse opening the browser and end up scrolling reddit.

How to Start

Since this is all about your own workflow, I can’t give you instructions on what to configure.

But I give you ideas about what can be done, and next time you wish something was easier to do take a look and see which tool can help you with it.

Keyboard

Keyboard is the main input to do your work, there’s not much to customize about the mouse but keyboard has a lot of possibilities.

note that using the following tools without knowing touch typing is not possible.

Remapping

Try remapping the keys that you don’t use often to things that you miss on the keyboard, some examples are:

  • Caps lock: key can be remapped to Esc, especially if you use vim
  • Fn keys: I added media control to stop/play and move between songs
  • §: which I don’t know why is it here in the first place can be mapped to “`”

Karabiner can be used for this purpose.

it supports more complex modifications which include things like adding a shortcut for sleep.

Expanding

Text expanding is writing a small text and then it expands to a bigger text.

For example instead of typing your work mail every time you, can only write ,wm and it expands to your work mail.

TexExpander is the tool I use for this.

Some examples I have are:

  • ,date to current date like 19/02/2023
  • multiple shortcuts to write my email addresses

You can also have macros for run javascript code to format something, for example this snippet and format json in my clipboard for when I need to share something with others:

JSON.stringify(%clipboard, null, 2);

This is so powerful for me, I deal with a lot of json outputs everyday and being able to format it without opening a website and paste the json in and format it to look at what it I can continue my work in my environment.

Raycast

While other suggestions have multiple implementations that you can use, I don’t think there’s a better launcher than Raycast.

What does it do?

It gives a launch bar(like Spotlight) that can open applications, find files and perform actions. I suggest reading through their manual to understand all it can do. With Raycast you can integrate the stuff you need while reading/coding to quickly pull them off without leaving your current work.

Extensions

Raycast is easy to extend yourself, every time you find yourself doing something over an over or need to open something regularly, take a look at it’s store to check if there’s a solution.

After installing the extensions you can configure them or set shortcuts by searching “extensions” in Raycast search bar.

For example these are some of the things I’m using

My Raycast

Notice that you can set hotkeys for most used commands to activate them immediately.

Search bookmarks Start bookmarking any page you need to visit frequently, for example your team Jira board, AWS account, Homepages for your projects, or university portal. Then use this extension to search the page you want to open from bookmarks and open it with.

The reason this is handy is that, first you don’t need to open browser to search and through the history to open frequently visited pages also you don’t have to navigate through the pages to get to where you want. Imagine navigating through Confluence to update some page you have to do everyday.

Clipboard history & edit for traveling trough clipboard and change the content.

Calendar to check the events and join them.

AWS extension to browse resources, everyone knows AWS console sucks and is slow. Fun note: I previously tried to implement the same for slapdash after writing a plugin for them realized their APIs are not developer friendly. And this is a risk because the usefulness of these products are tied to developers.

Github Can be useful if you happen to do open source, it can search repos, and PRs:

Raycast Github

Apps

Another feature is to manage some application windows with hotkeys. This is useful 1,2 applications where you switch them all the time. For example for me it’s terminal and browser:

Raycast Apps

With this setting not only you can launch the app but you can focus the window anywhere with hotkey.

Last feature to setup is QuickLinks, with this you can predefine sites to open with some parameters, this can be used to search google, or translate a word.

Raycast QuickLinks

Automation tools

Hammerspoon

This one’s the most powerful tool, it’s a bridge between MacOS and Lua. You can customize anything with it’s builtin libraries called spoons.

You can take a look at my config for inspirations. The rest are explanations of my config.

One useful feature if you do multiple meetings per day(which you probably do) is it have a global shortcut to mute/unmute your mic to don’t annoy others with noise in the meeting and quickly unmute. I’m doing this with global mute spoon.

Here’s how the configuration looks like

local GlobalMute = hs.loadSpoon("GlobalMute")
GlobalMute:bindHotkeys({
    unmute = { lesshyper, "u" },
    mute   = { lesshyper, "m" },
    toggle = { hyper, "t" }
})

I also use Hammerspoon to set my audio devices when different devices are connected. this one sets my output to speakers when my external mic & speaker is connected:

local function switchOutputAfterExternalMicConnected()
    current = hs.audiodevice.defaultInputDevice():name()
    print("Current device: " .. current)
    if current == "External Microphone" then
      print("Forcing default output to Internal Speakers")
      hs.audiodevice.findOutputByName("MacBook Pro Speakers"):setDefaultOutputDevice()
    end
end

Crontab

If you need to execute something regularly, create a crontab for it. MacOS has crontab which you can use for this.

Also can create push notifications using hammerspoon and calling an API to check for new notifications(for example Github).

Terminal

I assume you do use terminal a lot, otherwise you would not read this far cause developers who don’t use terminal effectively don’t care much about the previous stuff either.

Terminal is designed to be configured with functions for frequent commands.

I’m not gonna talk much about terminal but just make sure to:

  • Use a fuzzy finder for searching directories and history
  • Create a lot of functions for frequent used commands

Create Functions

For example I used to record a lot videos for my team and share them, but had to compress them before so I created this function:

function compress_vid
    ffmpeg -i $argv -vcodec h264 -acodec aac -strict -2 output.mp4
end

Or you might be doing a lot of dynamoDB and Kafka development so have commands to ready your environment for test.

I’m using fish but this can be applied to other shells as well. In case you regularly run particular commands like activating the python virtualenv, use a hook to auto activate it for you. I’m using virtualFish for this.

Fuzzy Finder

After you installed fzf make sure to configure it for these shortcuts:

  • Alt+C for searching and navigating to a directory
  • Ctrl+T to search the current dir and use the path
  • Ctrl+R to search the history

This Alt+C command is really handy for me to navigate and open projects, you can see that I set it to only search my development directory.

Also learn to configure the tools you use often, read their manuals to find out what features they have that might be useful for you.

Configure Git

A good one to start can be git, you can setup global ignore file, aliases and optional configurations for some projects. For example I override some configs when I’m in my company projects folder.

Take advantage of TUI apps like lazy-git, to make your work easier.

IMO the only way to work with git should not be the git client in your text editor. Having to open the text editor for only git operations might take your focus.

Starship

Use Starship, it can give you information about the directory your in, like what git branch are you on or what AWS account is current being used.

I use this setting to have the AWS account name and region

AWS

Since I mentioned AWS, make sure to use one of aws-vault or aws-sso-util to switch AWS accounts. You should be able to switch quickly for your testing and development, and this does not have to involve going to console and copying credentials every time.

Neovim

There are a lot of guides to configure and work with Neovim, I suggest this and this. You can also find the plugins/tools I use or think is interesting to check in my stars list.

Learn Your Code Editor

Even if you don’t use something like Neovim, your editor supports a lot of customizations, and should be customized. When you find some action requires a lot of effort, try to customize it in your Editor.

For example, most of the time I stage part of the file I’m editing for commits. In VSCode you need to open the version control panel, scroll through the file and right click to select stage selected. This is super hard if you have to do it 20 times in a productive day. I have a config in my vim to directly stage hunks in my editor to commit, but I’m sure you can find a VSCode equivalent.

The moral of this part is, no matter what editor you use after you realized some set of actions are the ones you do more than others try to customize your editor to allow those actions to be done more easily, without taking you out of the zone.

Conclusion

This was a long post, I wanted to go through my own configuration and update some stuff so decided to share it here as well.

Hope it’s useful for you and don’t forget the main point, customize your tools for your job to be able to get things done with less thinking.

If you use other tools customizations I’ll be happy to hear them.