Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Christopher Maher
Copyright (c) 2024 Christopher Maher

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
74 changes: 24 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,36 @@
# Defilan's dotfiles: Configuration for MacOS Developer Systems
# Defilan's Dotfiles for MacOS

## Usage:
To use Defilan dotfiles, simply clone this repo into a directory of your choice on your Mac:
This repository contains an Ansible playbook for setting up a MacOS development environment. It installs Homebrew, Ansible, and a variety of applications and customizations.

## Usage

To use this setup, clone this repository into a directory of your choice on your Mac:

git clone https://github.com/defilan/dotfiles.git ~/.dotfiles

cd ~/.dotfiles

./install.sh

`install.sh` will start by initializing the submodules used by this repository. Then, it will install all symbolic links into your home directory. Every file with a `.symlink` extension will be symlinked to the home directory with a `.` in front of it. As an example, `vimrc.symlink` will be symlinked in the home directory as `~/.vimrc`. Then, this script will create a `~/.vim-tmp` directory in your home directory, as this is where vim is configured to place its temporary files. Additionally, all files in the `$DOTFILES/config` directory will be symlinked to the `~/.config/` directory for applications that follow the [XDG base directory specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), such as neovim.

Next, the isntall script will perform a check to see if it is running on an OSX machine. If so, it will install Homebrew if it is not currently installed and will install the homebrew packages listed in [`brew.sh`](install/brew.sh). Then, it will run [`osx.sh`](install/osx.sh) and change some OSX configurations. This file is pretty well documented and so it is advised that you __read through and comment out any changes you do not want__. Next, the script will call [`install/nvm.sh`](install/nvm.sh) to install Node.js (stable) using nvm.

## ZSH Setup

ZSH is configured in the `zshrc.symlink` file, which will be symlinked to the home directory. The following occurs in this file:

* set the `EDITOR` to nvim
* Load any `~/.terminfo` setup
* Set the `CODE_DIR` variable, pointing to the location where the code projects exist for exclusive autocompletion with the `c` command
* Recursively search the `$DOTFILES/zsh` directory for files ending in .zsh and source them
* source a `~/.localrc` if it exists so that additional configurations can be made that won't be kept track of in this dotfiles repo. This is good for things like API keys, etc.
* Add the `~/bin` and `$DOTFILES/bin` directories to the path










## Vim and Neovim Setup

[Neovim](https://neovim.io/) is a fork and drop-in replacement for vim. in most cases, you would not notice a difference between the two, other than Neovim allows plugins to run asynchronously so that they do not freeze the editor, which is the main reason I have switched over to it. Vim and Neovim both use Vimscript and most plugins will work in both (all of the plugins I use do work in both Vim and Neovim). For this reason, they share the same configuration files in this setup. Neovim uses the [XDG base directory specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) which means it won't look for a `.vimrc` in your home directory. Instead, its configuration looks like the following:

| | Vim | Neovim |
|-------------------------|------------|---------------------------|
| Main Configuratin File | `~/.vimrc` | `~/.config/nvim/init.vim` |
| Configuration directory | `~/.vim` | `~/.config/nvim` |

### Installation
```bash
git clone https://github.com/defilan/macos-setup.git
cd macos-setup
bash install.sh
```

Vim is likely already installed on your system. If using a Mac, MacVim will be installed from Homebrew. Neovim will also be installed from Homebrew by default on a Mac. For other systems, you may need to install Neovim manually. See their [web site](https://neovim.io) for more information.
### Install Script

[`link.sh`](install/link.sh) will symlink the XDG configuration directory into your home directory and will then create symlinks for `.vimrc` and `.vim` over to the Neovim configuration so that Vim and Neovim will both be configured in the same way from the same files. The benefit of this configuration is that you only have to maintain a single vim configuration for both, so that if Neovim (which is still alpha software) has issues, you can very seamlessly transition back to vim with no big impact to your productivity.
The `install.sh` script performs the following actions:

Inside of [`.zshrc`](zsh/zshrc.symlink), the `EDITOR` shell variable is set to `nvim`, defaulting to Neovim for editor tasks, such as git commit messages. Additionally, I have aliased `vim` to `nvim` in [`aliases.zsh`](zsh/aliases.zsh) You can remove this if you would rather not alias the `vim` command to `nvim`.
- Checks if Homebrew is installed and installs it if not.
- Checks if Ansible is installed and installs it if not.
- Runs the Ansible playbook contained in this repository.

vim and neovim should just work once the correct plugins are installed. To install the plugins, you will need to open Neovim in the following way:
### What does the Ansible playbook do?
#### The Ansible playbook installs a variety of applications and performs some customizations to the MacOS environment. Here's a brief overview:

```bash
Run the following in a terminal to install neovim and vim plugins
nvim +PlugInstall
1. Taps into several Homebrew repositories, including HashiCorp, AWS, and Homebrew's own font cask.
2. Installs a variety of Homebrew packages, including `neovim`, `tmux`, `git-extras`, `thefuck`, `go`, `kubectl`, `skaffold`, `awscli`, `terraform`, `packer`, `aws-sam-cli`, `node`, `redis`, and `molecule`.
3. Installs several Homebrew cask packages, including `arc`, `iterm2`, `visual-studio-code`, `1password`, `rectangle`, `font-hack-nerd-font`, `jetbrains-toolbox`, `nordvpn`, `switchresx`, `discord`, `istat-menus`, `signal`, `docker`, `postman`, `gimp`, `obs`, and `krisp`.
4 . Creates directories at `~/stuffy`, `~/stuffy/code`, and `~/stuffy/playground`.

## Notes

Please note: This configuration is specifically tailored for MacOS systems. Other operating systems are not currently supported. Linux support coming soon.

## License
This project is licensed under the MIT License. See the LICENSE file for details.