Skip to content

Zsh, Karabiner, VS Code, Sublime, Neovim, Nix, Hammerspoon

License

Notifications You must be signed in to change notification settings

johnnypea/dotfiles

 
 

Repository files navigation

My configuration files for macOS Thanks

Zsh, Karabiner, VS Code, Sublime, Neovim, Nix, Hammerspoon

These are the various configuration files I use on macOS. I wrote about how you can customize your shell experience in an article here.

You can also see my top used applications, Safari extensions and Alfred workflows I use here.

Contents

Install

I use Nix Darwin with Nix to manage my system configuration. Nix is a declarative language and you can read through my configuration file to see what settings it applies and what programs it installs.

Assuming you have Nix Darwin installed and this dotfiles repo cloned to ~/.dotfiles, you should first run /run/current-system/sw/bin/darwin-rebuild switch -I darwin-config=$HOME/.dotfiles/nix/darwin.nix. This lets Nix Darwin know that the configuration file it should read is placed inside ~/.dotfiles/darwin.nix.

You can then run darwin-rebuild switch to apply my configuration on your system.

I also use Dotbot to apply appropriate symlinks so that I can keep the original files in this one dotfiles dir. Look here for what exactly it will do. Place this cloned dotfiles repo in ~/.dotfiles/ and run ./install inside it.

Clean install everything

  1. Boot fresh macOS copy.
  2. Go through preferences & set everything up.
  3. Download & install apps from my macOS.
  4. Download dotfiles & set everything up (instructions above).
  5. Download Alfred workflows.
  6. Download KM macros.

I describe my custom configuration I use below. It is heavily tailored to my own workflow so it is best you take ideas from it rather than copying the entire config.

Karabiner

img

The most exciting thing in here is probably how I utilize Karabiner. It has absolutely transformed the way I interact with my computer and there is no going back now.

I go over how I use Karabiner in detail here. I generate my config for it with Goku.

Neovim

Vim language is the best text editing experience you will ever get. It is worth learning it as you will start thinking about text editing differently.

My Neovim config can be seen here. I use Monokai Night theme with many plugins. Here is how it looks:

VS Code

My main editor of choice is VS Code since it has well built vim mode.

Configs I use for it can be seen here. And here is a list of extensions I use.

Sublime Text

I use it primarily to edit markdown files like my wiki. I also edit config files and open large and small files for quick edits.

I use many plugins together with Ayu theme.

Hammerspoon

I don't use Hammerspoon as extensively however I am looking into implementing more of its features into my workflow.

Zsh

I am using Zsh as my shell and Antibody to install all my Zsh plugins.

I am also using Monokai Night theme I made for iTerm. Here is how my prompt looks:

Aliases and functions

I use many aliases to get around my system as fast as possible. You can view them all here.

There is a lot of awesome programs I use from my command line. You can see here for all of them.

I also love customizing my shell experience with various aliases and Zsh functions. Here are some that I like and use often:

Commit and push repository to GitHub

ggi() {
    git init
    mit
    git add .
    git commit -m "Init"
    git remote add origin $(osascript -e 'tell application "Safari" to return URL of front document')
    git push -u origin master
}

Say I created some project and wrote some code in it or added a simple README with some text in it. I then go on to create a new GitHub repository and give it a name. After that I just run this ggi command.

It will initialize my current directory with git if it wasn't already. It will then call this function:

mit() {
  license-up mit Nikita Voloboev nikitavoloboev.xyz
  git add LICENSE
}

Which using this CLI tool, will create a license file and git add it. It will then take the URL of my current browser window which will be at the newly created repository, point the local git repo to push there and push it.

And thus in one command I initialized and pushed the repo. To create a new repo quickly I use this Alfred workflow.

Commit all with generic update message

I use this command when I find no commit message is necessary.

ggs() {
    git add .
    git commit . -m 'update'
    git push
}

Clone current URL in clipboard

gll(){
    git clone "$(pbpaste)"
}

I use this often to quickly clone the URL that I copied from GitHub.

Trash files / folders

A lot safer than to rm -rf files as you can always check out ~/.Trash in cases of emergency or mistakes.

re(){
  mv "$1" ~/.Trash
}

FZF

FZF is a command line tool that lets you fuzzy search on text. I use it often now for fuzzy searching for files to open with neovim, or fuzzy searching through my commit messages and more. Here are all the functions I use with it.

Interesting dotfiles

These are dotfiles I got many ideas from and liked.

I also mention Nix configurations I liked in my wiki.

Contributing

Suggestions on how I can improve the structure of these dotfiles as well as suggesting new and awesome tools are welcome.

Thank you

You can support me on Patreon or look into other projects I shared.

MIT Twitter

About

Zsh, Karabiner, VS Code, Sublime, Neovim, Nix, Hammerspoon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 65.2%
  • Shell 30.0%
  • Nix 1.7%
  • Lua 1.7%
  • Python 1.4%