- There are a ton of dotfiles on the web, and many of them are far more detailed than mine View them all here
- The point of dotfiles is if you get a new computer or move to a new computer you can get all the settings you like on that computer... and get them on that computer quickly.
- I got tired of spending 2 hours setting up a new computer. There has to be a better way, and dotfiles are a better way
- This is for only Mac users
- I use this repo to add the exact setup I prefer to any Mac computer
- This means I can have the same workflow and tools on any Mac computer I use, my laptop, work computer, a school computer
- To set this up manually would probably take me 2 hours, and dotfile helps me install all this stuff in under 15 minutes
$ xcode-select --install
- If you don't, you'll get an error similar to this
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- I tried to use my old dotfiles with a new Mac computer with the M1 chip, and it made me have to update these dotfiles
- To get them to play nice, you need to:
Running x86 Apps Homebrew Apps
The developers behind the Notion app for Macs shared a blog post on getting homebrew or other terminal apps that don't have Arm support to run on an Apple Silicon Mac. The steps are as follows:
1. Create a duplicate of the Terminal app in the Utilities folder
2. Right-click on the app and choose Get Info
3. Rename the other version of the app into something recognizable (like "Rosetta Terminal")
4. Check off the "Open using Rosetta" option
That's all there is to it.
Once Open using Rosetta is selected, homebrew apps can be run in the Terminal on Apple Silicon Macs.
homebrew,
cask
andbundle
that make it possible to install all this stuff quicklynode
(and that comes withnpm
baked in)- I gave up on
yarn
:(
- I gave up on
git
for version controlhub
andgh
enables you to create Github repos directly from the terminal- Now, with The Github CLI, we may soon be able to put
hub
out to pasture, but as it stands right now, I use them both
- Now, with The Github CLI, we may soon be able to put
tree
shows you your file/folder structure- And I have a nice function that works well with this to ignore
node_modules
and other stuff you don't want to see when you're searching through folder structures
- And I have a nice function that works well with this to ignore
trash
a better way to delete files than$ rm -rf
because if you delete with$ rm -rf
, stuff is gone foreverrectangle
app which gives you great window management- Rectangle docs
- Here is a screenshot of my Rectangle settings to give you an idea of how I use the keyboard to control my windows (Rectangle makes migrating from Spectacle super simple)
firefox
andchrome
browsersalacritty
andiTerm
terminals (Both are way better than the default Terminal that ships with mac, and Alacritty is my current terminal - using this with Tmux is very powerful)tmux
- terminal multiplexer (If you never heard of this, dig in and check it out - very cool)vscodium
a duplicate of Visual Studio Code but works well with neovimSlack
mac2imgur
- I use this for saving screenshots as a URL to add to my markdown notes easilycaffeine
- keeps my computer from going to sleepzsh
is my preferred shellkarabiner-elements
- This is a great add on to get control of your keys and key mapping
- docs
docker
insomnia
andpostman
for RESTful API helpmysqlworkbench
for MySQL stuffgrammarly
- makes your writing so much more professional lookingdropbox
- I used dropbox to sync my Alfred settings from the old computer to the new computer
Brewfile
is a list of all the apps that I recommend installing- I commented out ones that I don't always use but just removed the comment
#
if you want to install - Review the Brewfile and adjust it as you need it (before running the install)
- There is a ton of Mac-specific stuff in this file
- I recommend going through this with a fine-tooth come to make sure you know what the changes are and you are cool with those changes
- This file has settings
.macos
file is a bunch of mac settings I recommend setting up- Show hidden files
- If you want to show hidden files (by default they are the hidden files are hidden :) )
- If I want to download NerdFonts I need to see a hidden file
~/.local/share/fonts
$ defaults write com.apple.Finder AppleShowAllFiles true
$ killall Finder
- Do the same two lines but set
true
tofalse
to hide hidden files again
prettier
(formats your code nicely)Sublime Text
- This will set it up how I like to use it with all the
preferences,
key bindings
andpackages
- This will set it up how I like to use it with all the
VS Code
- I switched from Vim to Neovim
- If you'd like to use Neovim, I highly recommend watching all of these videos, so you understand the setup and the plugins (big props to ChrisAtMachine!)
- Create
/.config
and clone my Neovim repo into it
- ignore this if you don't want to use neovim with VS Codium
- Neovim nightly 0.5.0 - I want to use the neovim plugin for VS Codium because it is a requirement for neovim to work in VS Codium
$ brew install --HEAD neovim
- caution This may lead to some issues upgrading to the latest version of neovim
- I received an error, and this neovim issue helped
- Once you clone nvim, you need to install all the plugins
- You may need to install python 3 need to add python3 via Homebrew
- Remember all Homebrew installs must be done through the Rosetta terminal
$ git clone git@github.com:kingluddite/dot-tmux.git ~/.tmux`
$ ln -s ~/.tmux/tmux.conf ~/.tmux.conf
- Now the moment you've all been waiting for...
- It is important you install the
dotfiles
in your$HOME
directory - This means you open your terminal and type
$ cd
and it will automatically take you to your$HOME
- FYI
$HOME
and~
both signify the "home" directory
- FYI
- Change to your home directory
$ cd
- Clone my dotfiles to your $HOME
$ git clone https://github.com/kingluddite/dotfiles.git
- Change into the cloned
dotfiles
directory now in your $HOME directory
$ cd dotfiles
- This is an important step
- IMPORTANT You need to do this because if you don't and you recently updated your OS, you will have to do these instructions all over again
- note Most likely, this will already be installed, but it doesn't hurt to try it
$ xcode-select --install
- Yes, I told you before to install them but it can't hurt to remind you :)
$ ./install.sh
- If you have an app already installed, this program will skip over it and not install it again, so running
./install.sh
again won't cause a problem
- The default install for neovim is
~/.config
- Create that directory and change into it:
$ cd && mkdir .config && cd .config
- Clone my repo inside
.config
$ git clone https://github.com/neovim/homebrew-neovim
- What is oh my zsh?
- "Oh My Zsh is a delightful, open-source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout... "Oh My ZSH!"
- oh-my-zsh docs
$ cd
(go back to $HOME)$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- This lets you know if you are typing a:
- A valid command (green)
- Or an invalid command (red)
- Clone this repository in oh-my-zsh's plugins directory (on your local machine):
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- Refresh with
$ zfrash
(my alias)
- "Frecent" (Fun made-up word that combines
frequently
andrecently
- and this is a way to see what files you were recently using) - This is a great program that will help you quickly navigate files and folders on your machine
- Here is a Wes Bos video showing you how production
z
can make you
- You will see a warning that your
.zshrc
can't find thez.sh
file
- Move the
z.sh
file fromdotfiles
to your$HOME
directory
$ dotf
(alias takes you to ~/dotfiles)
$ mv z.sh ~/
(Moves z.sh
to $HOME)
$ zfrash
(Using another alias
to refresh your .zshrc
shell config file)
- You may get an error similar to:
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 7 USERNAMEHERE admin 224 Nov 20 20:29 /usr/local/share/zsh
drwxrwxr-x 7 USERNAMEHERE admin 224 Nov 20 20:30 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions, you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w
[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
- this GitHub issue for OMZ fixed it
- Just change permissions by typing this:
$ chmod 755 /usr/local/share/zsh
$ chmod 755 /usr/local/share/zsh/site-functions
- What are symlinks?
- note Make sure you are inside the
dotfiles
directory when you run this - You will see if you view
'$HOME
with$ ls -la
and you'll see all the usual config dotfiles like.vimrc
and.zshrc
and now they have symlinks pointing to thedotfiles
directory
$ cd dotfiles
$ ./makesymlinks.sh
$ source zshrc
(Make sure you are inside dotfiles
)
- Or you could also use the
$ zfrash
alias
- Try out two of my aliases to see if it is working
$ desk
- Takes you to the Desktop
$ dotf
- Takes you to the dotfiles
directory
- This will add my iTerm2 Preferences
- You first remove the existing iterm preferences with:
$ rm ~/Library/Preferences/com.googlecode.iterm2.plist
- Create a symlink from dotfiles to the iTerm2 spot for iTerm2 preferences
- This will save you from having to make all the iterm2 config changes manually
- Here is the symlink that adds my suggested
iTerm2
preferences to your iTerm2 - IMPORTANT The following code you type in the terminal is all ONE LINE
$ ln -s ~/dotfiles/init/com.googlecode.iterm2.plist ~/Library/Preferences/com.googlecode.iterm2.plist
- note This installs
fira code
font for Nerdtree and Vim by default, but if this is not what you want, you can override it in the text settings of the profile tab of iterm and choose what font and size you want for your text- I also show how to install Powerline font below as that is another font that many developers prefer
- Web Bos
cobalt2
zsh theme - If you want your terminal to look wicked cool, follow these steps
- This is the prompt theme I like to use for zsh
- Here is a free set of videos from Wes Bos that are well worth your time and explain iTerm and the cobalt2 theme and how to install it
- Move the cobalt zsh theme to the proper folder
$ cp -R init/cobalt2.zsh-theme ~/.oh-my-zsh/themes
- Import the
cobalt2
color scheme into iTerm2 using:
Preferences > Profile > Colors
- And point to:
$HOME/dotfiles/init/cobalt2.itermcolors
- Refresh your shell to accept the changes with:
$ source ~/.zshrc
(or use $ zfrash
alias)
- Right now, if you look at your prompt, you will see the cool cobalt2 colors, but you will also see strange question mark icons and this is because our prompt is trying to render fonts that are not installed on your machine yet
- Let's add those fonts now
- Pip is a python program that we need to install these special type of fonts
$ sudo easy_install pip
- Let's save these fonts temporarily to our Desktop
$ cd ~/Desktop
- Grab the fonts from the Powerline Github repo and clone them to our Desktop
$ git clone https://github.com/powerline/fonts
- Change into our new font folder
$ cd ~/Desktop/fonts
- Install the fonts
$ ./install.sh
- Remove the fonts (Awesome polite to clean up after ourselves :) )
$ rm -rf ~/Desktop/fonts
- Make the iTerm2 font settings look like this:
- The important part is to make sure you go into iterm2
Preferences > Profiles > Text tab
and change the font to 18pt Inconsolata for Powerline
- Problem with iTerm2 autosuggest - the color is hard to see
for powerline in the text tab
Solution
: Check the "use built-in Powerline glyphs" checkbox
- Problem with
autosuggest
color (hard to read) adjust selection text color and drag up the minimum contrast so you can see it better (here are what my settings look like)
![iTerm2 window restoration disabled warning](https://i.imgur.com/r12EEfg.png (need to uncheck close windows when closing an app)
- This is a free editor; I bought a license a long time ago, and it still works like a charm
- This is a great, fast editor
- note If you don't pay for a license, it will remind you every so often that you don't have a license with an alert window
- Turn on Spell check
- important Make sure you Install package control
ctl + shift + p
and select "Install Package control"
- note You will get a ton of alert window errors of empty packages trying to install themselves; close those windows (there is probably a better way to solve this problem, but I'm too lazy - let me know if you have a better solution)
- note - We already installed Sublime Text with our installer file
- And even added some config preferences but let's now add all the packages and themes I recommend as well as the key bindings
$ dotf
(alias moves you to $ cd ~/dotfiles
)
$ cd user-settings
$ cp -R Package\ Control.sublime-settings ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
- That moves a file that contains all the packages I recommend you install for use with Sublime Text
- To make this work, you need to shut Sublime Text down and reopen it
- When you do wait a minute, and you should see a bunch of packages gets installed
- You may see some error alert windows, but you can close them
$ cp -R Default\ \(OSX\).sublime-keymap ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
- This adds the keybindings, which is essentially
j
+k
keyboard shortcut that quickly switches you into Vintage Mode (for Vim mode inside Sublime Text) - This converts Sublime Text to Vim (kind of) and helps you start using Vim so that you can one day jump to Vim, the greatest text editor on the planet (IMHO)
- And now Neovim is what I believe the greatest text editor on the planet :)
$ cp -R Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
- This spruces up our Sublime Text settings and makes you feel like you coding on a spaceship (thanks to Seti_UI)
- There are other Vim setups for ST3 - I am happy with Vintage mode
- But sometimes it breaks and deleting in vim, got to the end of the line, takes forever. If this happens reset ST3
- When ST3 "breaks" (every now and then) it takes me a couple hours to fix it
- The key bindings are messed up, I have to type
d
3 times to delete a line, appending adds ana
at the end, it just becomes a terrible user experience and you need a fresh install of ST3 to get it back to work properly
- The key bindings are messed up, I have to type
- Do this the next time this happens
- https://www.sublimetext.com/docs/3/revert.html
OS X: ~/Library/Application Support/Sublime Text 3
Grab everything and put in a backup folder on your desktop (just grab all the stuff in that folder and put it somewhere safe in case you need it). We are just going to repopulate ST3 like we did before and vintage should work as we expect (if all is good you can blow up your backup settings unless there was custom work you want to retain like packages and bindings)s Go to my dot files
- Go into your dotfiles locally (like you did before) and and follow the three "cp -R instructions" above to get ST3 and vintange working well again
- Vim is a super awesome text editor that has a huge learning curve but well worth the time to learn it
- I have set it up with all the packages I like and feel free to dig in, but I also have a config setup for Sublime Text, which might be a better choice for newbies
- I am using Plug to install plugins (switched from Vundle)
- note I am no longer using Vim but now switched to Neovim - If you want to use Vim, you may want to check out MacVim
- I love Sublime Text for taking markdown notes. I've been doing it for years and love it's speed and I just am used to it
- I invested a lot of time learning Vim but saw the community kind of move towards Neovim and after watching the ChristAtMachine neovim youtube series, I jumped to Neovim
- I teach and need to use VS Code in the classroom. Why not make VS Code work like Neovim and that's what I'm trying to do (I also have Sublime Text using Vim like stuff and the goal is just to keep typing all my neovim keyboard shortcuts everywhere so I get better and faster)
- When you run the databases decide if you want to run them as services (if you do, they will start automatically on a cold reboot)
- If you get this error🔛
- Just run
$ brew services start mongodb-community
to start mongodb as a service
- MySQL Workbench (IDE for working with MySQL)
- To avoid a pesky error "Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock" start mysql as a server with
$ brew services start mysql
and just run$ mysql -uroot
and you can run without a password. I find developing it is easier to just use no password, enter an empty string as a password for connecting to mysql
- https://stackoverflow.com/questions/59232089/how-to-install-gnu-grep-on-mac-os
- Why did we install grep with Homebrew?
- I like using
Rectangle
for window management (I used to use Spectacle, but it is no longer being maintained, and they recommended checking out Rectangle, and it works just as well as Spectacle with even more options - and it's free) - Uninstall Spectacle and use Rectangle as replacement
- Here are my current Rectangle settings
- Open the mac2imgur app and sign in (_ This app allows you to save screenshots on imgur_)
- I love Alfred App
- I paid for the Powerpack and used Snippets for productivity (I used to use TextExpander, but they kept charging me for upgrades, so I just stuck with Alfred App - there is a ton to this, so do your research on this - well worth the time invested)
- If you buy Powerpack (or bought it before), remember to add the Powerpack license to Alfred App
- You should also check out Alfred app Workflows for productivity improvements
- Sync Alfred app with an old and new computer (If you want to migrate your Alfred configurations from one to computer to your new computer, this will save you time!)
- Also, don't forget this step
- Alfred app
preferences
>features
>snippets
(and check "Automatically expand snippets by keyword")
- Alfred app
- (or any browser) - I like to have the browser ask me where to save downloads instead of just putting it directly inside Downloads automatically
- Each browser has it's own setting for this, this is how to do it inside Chrome
- source
- Remember
- You will need to update your name and email in the git config file
- Make sure to save these changes
- You'll need to create a new SSH key and share it with GitHub
- Create new ssh key and add to github
- Sign in with your email and get access to all Slack workspaces you need
zfrash
(that is my alias to refresh thezshrc
)- Open my aliases file to see all my aliases and customize them as you see fit
- There are some cool functions in the functions file (check it out to see if it gives you any ideas for productivity improvements)
- If you get this error
[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.
Please add "export FZF_BASE=/path/to/fzf/install/dir" to your .zshrc
- Use your Rosetta terminal to install
fzf
with Homebrew
$ brew install fzf
- You may run into this on Mac, and you'll think you can't install the App
- Don't panic; it is just Apple trying to protect you
- I received this error when I tried to run Alacritty terminal
- After you add it to permissions:
- Then open it and then in
General
click"open anyway"
- Here is a Mac warning I received for opening Slack - you will see this for all images you open to give mac permission to open it
- give Slack permission to access files in your downloads folder
- If you think I could do something better or I'm missing something, please feel free to fork this repo and submit a pull request (Sharing is Caring)
- Happy Coding
- Use Homebrew
- To install it's a two step process:
- brew tap homebrew/cask-fonts # You only need to do this once!
- brew cask install font-hack-nerd-font # Then just do this again for all other fonts you want to install
- All the other casks are inside the Casks folder
- That's it. You will now see icons inside Alacritty
- note Fira Code is a very cool concept
- live-server
- I use this a lot so install globally with
$ npm i live-server -g
- I use this a lot so install globally with