All Projects → iain → dotfiles

iain / dotfiles

Licence: other
My bash / zsh / vim / pry settings

Programming Languages

shell
77523 projects
Vim Script
2826 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to dotfiles

Bv
Quickly view satellite imagery, hyperspectral imagery, and machine learning image outputs directly in your iTerm2 terminal.
Stars: ✭ 215 (+144.32%)
Mutual labels:  iterm2
httpie-image
HTTPie plugin to display images in iTerm2
Stars: ✭ 23 (-73.86%)
Mutual labels:  iterm2
dotfiles
🔧 My dotfiles on  macOS for Neovim, Zsh, kitty, lf, etc
Stars: ✭ 90 (+2.27%)
Mutual labels:  iterm2
Iterm Fish Fisher Osx
Complete guide and Bash script to install Command Line Tools + Homebrew + iTerm2 + Fish Shell + Fisher + Plugins for development purposes
Stars: ✭ 249 (+182.95%)
Mutual labels:  iterm2
bliss-zsh
A delicate Zsh theme that injects color without overwhelming your workspace
Stars: ✭ 20 (-77.27%)
Mutual labels:  iterm2
squidgefiles
Beautiful dotfiles 🦑
Stars: ✭ 20 (-77.27%)
Mutual labels:  iterm2
Iterm2 Night Owl
A port of the VS Code Night Owl theme to iTerm2.
Stars: ✭ 179 (+103.41%)
Mutual labels:  iterm2
Terminal-Setup
Best Setup for your terminal for programming on macOS
Stars: ✭ 26 (-70.45%)
Mutual labels:  iterm2
Base2Tone-iterm2
Syntax highlighting colorschemes for iTerm2
Stars: ✭ 29 (-67.05%)
Mutual labels:  iterm2
Efficient-office
Alfred-Workflows,Vim,Script,Mac
Stars: ✭ 36 (-59.09%)
Mutual labels:  iterm2
dotfiles
Blugil's dotfiles
Stars: ✭ 23 (-73.86%)
Mutual labels:  iterm2
python-imgcat
🖼 imgcat in Python (for iTerm2)
Stars: ✭ 184 (+109.09%)
Mutual labels:  iterm2
node-gif
Displays Gifs In Terminal 👽 👾 🚀 💣
Stars: ✭ 27 (-69.32%)
Mutual labels:  iterm2
Iterm2 Imagetools
Display images in the command line with iterm2.
Stars: ✭ 232 (+163.64%)
Mutual labels:  iterm2
dotfiles
My personal (.)dotfiles and configurations for various programs and environments.
Stars: ✭ 34 (-61.36%)
Mutual labels:  iterm2
Givegif
GIFs on the command line
Stars: ✭ 212 (+140.91%)
Mutual labels:  iterm2
ayu-iTerm
ayu color themes for iTerm
Stars: ✭ 120 (+36.36%)
Mutual labels:  iterm2
slab
sudolikeaboss replacement - 1Password utility to interact with iTerm2 and type in your passwords for you.
Stars: ✭ 26 (-70.45%)
Mutual labels:  iterm2
catimg
Print an image of a cat to the iTerm2 terminal
Stars: ✭ 13 (-85.23%)
Mutual labels:  iterm2
awesome-xonshrc
👓 🐚 Make your xonsh RC file installable with awesome snippets of code.
Stars: ✭ 43 (-51.14%)
Mutual labels:  iterm2

.dotfiles

In Unix-like operating systems, any file or folder that starts with a dot character (for example, /home/user/.config), commonly called a dot file or dotfile, is to be treated as hidden. A convention arose of using dotfile in the user's home directory to store per-user configuration or informational text.

Here are the settings I use. There are installation scripts for most things, so getting them should be easy.

Feel free to adopt anything you like from these settings. However, I recommend you make your own, and only add things you understand and like, so you build your own toolchain.

Project Structure

Directory Description
bin executables
config zsh and bash configuration
iterm2 iterm2 configuration
rc all the dotfiles
script private helper scripts

I put all personal and private configuration in config/personal.sh, which is ignored by git, so it doesn't accidentally end up on the internet.

Installation

Pre-requisites

Download and install the following applications manually:

Code

To install dotfiles:

git clone https://github.com/iain/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
./script/install

This will backup any previous dotfiles you have.

Homebrew

To install all the neat little homebrew tools listed in Brewfile:

brew tap Homebrew/bundle
brew bundle

iTerm

To configure iTerm:

  1. Open iTerm2.
  2. Go to the Preferences (⌘,)
  3. In the General tab, check Load preferences from a custom folder or URL.
  4. Fill in: ~/.dotfiles/iterm2.
  5. Restart iTerm2.

Git

To configure git, you need to tell Git who you are, and configure commit signing (highly recommended).

In this setup, make sure you use the same name and email as in GitHub.

To get git commit signing and verified commits in Github:

  1. Download and install GPG Suite from https://gpgtools.org/
  2. When launching you'll be asked to generate a new key pair. Do that.
  3. You'll be asked to upload the key. Optional, I think, but I did it.
  4. Right-Click on your newly generated key, choose "Copy". Your public key is now in your clipboard.
  5. On github, go to your settings: https://github.com/settings/gpg/new
  6. Click button "New GPG key"
  7. Paste your public key, you copied it in step 5.
  8. On the overview of your GPG keys on github, you'll see your "Key ID". Copy that to your clipboard.

Open ~/.gitconfig and add the following, replacing values:

[credential]
  helper = osxkeychain
[commit]
  gpgsign = true
[user]
  name = xxx
  email = [email protected]
  signingkey = XXXXXXXXXXXXXXXX

The signingkey is the "Key ID" you copied in step 8.

Upon the next commit that you make, GPG suite will ask you for the password you entered in step 2.

asdf

I use asdf these days to install programming languages.

Here is how to install ruby (replace latest with an older version if you like):

asdf plugin add ruby
asdf install ruby latest
asdf global ruby latest

Python and most other languages work the same, except NodeJS.

asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
asdf install nodejs latest
asdf global nodejs latest

To update all plugins, when new versions come out:

asdf plugin update --all

Fonts

Get a couple of really good Terminal fonts with powerline support baked in:

# clone
git clone https://github.com/powerline/fonts.git --depth=1

# install
cd fonts
./install.sh

# cleanup
cd ..
rm -rf fonts/

Documentation

Below is extra documentation on what's configured in the dotfiles. Or at least, some of the highlights.

Vim

Vim is my editor of choice, I use it for all my coding needs.

All configuration is done in ~/.vimrc and it will self-install automatically the first time you start it. Delete (or move) your ~/.vim directory to let it (re)install.

To get new versions of your plugins after the first install:

:PlugUpgrade
:PlugUpdate
:PlugClean

The vim configuration should work on the terminal and macvim. I prefer the macvim version, mainly because font rendering is delegated to macOS, making it quite a bit faster.

The config works both in dark mode and light mode and switches based on your OS setting.

My personal preference is "Hack".

Aliases && Commands

There are a lot of aliases and commands in my dotfiles.

Configuration in ~/.dotfiles/config/general.sh and bin files in ~/.dotfiles/bin.

Command Description
flushdns flush DNS cache (macOS only)
imgcat show image in terminal (iTerm only)
l alias of ls -FhAlo
m opens file in existing macvim window
psg find running process quickly
ssh-copy-id copy your SSH key to remote server
tf alias of tail -f -n 200

Other:

  • ls is replaced by GNU version if gnu tools are installed on macOS.
  • Replaced grep with rg
  • aws-docker-login for logging docker into AWS ECR.
  • docker-stop-all stops all running docker containers
  • docker-implode deletes all docker image caches, run from time to time to get lots of disk space back

Git

I deprecated git checkout in favor of git switch and git restore. git checkout still works, just has a 30 second penalty.

Configuration for git is found in ~/.gitconfig and ~/.dotfiles/config/git.sh

Here are some of the highlights:

Command Description
aa short for git add --all && git status -s
amend short for git commit --amend
c short for git commit
current show the SHA of the current commit
d short for git diff
dc short for git diff --cached
g12 First 12 chars of current git commit
gf short for git fetch --all && git status
gpb Publish your branch without having to type branch name
gpr Quickly make a draft PR in GitHub
p short for git push
re short for git restore
s short for git status -s
st short for git status
sw short for git switch
unstage short for git restore --cached --
up short for git pull --ff-only
upstash short for git stash && up && git stash pop

Other:

  • Local changes will be rebased
  • I regularly perform git-cleanup, which wraps the following tasks:
    • git fetch --all --prune - removes information about old remote branches
    • git-delete-merged-branches - removes branches that have been merged in
    • git-delete-squashed-branches - removes branches that have been squashed in GitHub
    • git prune - remove dangling objects
    • git gc --aggressive --auto - clean up files and optimize repository
  • Only run the cleanup scripts from a clean default branch!
  • All commands should be compatible with whatever default branch you have (see git-default-branch)
  • Default branch for new repos is main instead of master.
  • Read the ~/.gitconfig file for more neat aliases.

Ruby

The configuration for ruby is found in ~/.dotfiles/config/ruby.sh

Here are some of the aliases:

Command Description
b short for bundle install
be short for bundle exec
psr finds ruby processes
r short for rails
rdm will run migrations for development and test
wip short for cucumber --profile wip

Other:

  • Rails, Rake, Cucumber, RSpec will use Spring automatically if it's available and binstubbed.
  • rspec_focus and cucumber_focus are for running a subset of tests and are setup to be used together with vim-test

Credits

Thanks everybody who puts their dotfiles online. I copied a bunch from practically every repository.

Feel free to use this or fork this. Additions are very welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].