Coder Social home page Coder Social logo

dotfiles's Introduction

Trepanning.io's dotfiles

Requirements

None. Well, as little as possible for the initial bootstrap.

As much as possible an initial installation will require the user to add zero apps.

Install on Mac

Run this command.

curl -fsSL https://raw.githubusercontent.com/dgethings/dotfiles/master/install.sh | bash

The install process takes care of the bootstrapping, installing all necessary tools needed to reliably install the user/dev tools.

It also cleans itself up removing the bootstrap tools if they are not system standard. A prime example is Ansible running on the system Python. While an installation of Ansible maybe performed the version of Ansible installed during the bootstrapping is removed.

Generate Brewfile

To generate the Brewfile from an existing system use

brew bundle dump

This will create a Brewfile in that directory.

zsh Configurations

Additional zsh configuration can go under the ~/dotfiles-local/zsh/configs directory. This has two special subdirectories: pre for files that must be loaded first, and post for files that must be loaded last.

For example, ~/dotfiles-local/zsh/configs/pre/virtualenv makes use of various shell features which may be affected by your settings, so load it first:

# Load the virtualenv wrapper
. /usr/local/bin/virtualenvwrapper.sh

Setting a key binding can happen in ~/dotfiles-local/zsh/configs/keys:

# Grep anywhere with ^G
bindkey -s '^G' ' | grep '

Some changes, like chpwd, must happen in ~/dotfiles-local/zsh/configs/post/chpwd:

# Show the entries in a directory whenever you cd in
function chpwd {
  ls
}

This directory is handy for combining dotfiles from multiple teams; one team can add the virtualenv file, another keys, and a third chpwd.

The ~/dotfiles-local/zshrc.local is loaded after ~/dotfiles-local/zsh/configs.

vim Configurations

Similarly to the zsh configuration directory as described above, vim automatically loads all files in the ~/dotfiles-local/vim/plugin directory. This does not have the same pre or post subdirectory support that our zshrc has.

This is an example ~/dotfiles-local/vim/plugin/c.vim. It is loaded every time vim starts, regardless of the file name:

# Indent C programs according to BSD style(9)
set cinoptions=:0,t0,+4,(4
autocmd BufNewFile,BufRead *.[ch] setlocal sw=0 ts=8 noet

What's in it?

vim configuration:

  • Ctrl-P for fuzzy file/buffer/tag finding.
  • Rails.vim for enhanced navigation of Rails file structure via gf and :A (alternate), :Rextract partials, :Rinvert migrations, etc.
  • Run many kinds of tests from vim
  • Set <leader> to a single space.
  • Switch between the last two files with space-space.
  • Syntax highlighting for Markdown, HTML, JavaScript, Ruby, Go, Elixir, more.
  • Use Ag instead of Grep when available.
  • Map <leader>ct to re-index Exuberant Ctags.
  • Use vim-mkdir for automatically creating non-existing directories before writing the buffer.
  • Use vim-plug to manage plugins.

tmux configuration:

  • Improve color resolution.
  • Remove administrative debris (session name, hostname, time) in status bar.
  • Set prefix to Ctrl+s
  • Soften status bar color from harsh green to light gray.

git configuration:

  • Adds a create-branch alias to create feature branches.
  • Adds a delete-branch alias to delete feature branches.
  • Adds a merge-branch alias to merge feature branches into master.
  • Adds an up alias to fetch and rebase origin/master into the feature branch. Use git up -i for interactive rebases.
  • Adds post-{checkout,commit,merge} hooks to re-index your ctags.
  • Adds pre-commit and prepare-commit-msg stubs that delegate to your local config.
  • Adds trust-bin alias to append a project's bin/ directory to $PATH.

Ruby configuration:

  • Add trusted binstubs to the PATH.
  • Load the ASDF version manager.

Shell aliases and scripts:

  • b for bundle.
  • g with no arguments is git status and with arguments acts like git.
  • migrate for rake db:migrate && rake db:rollback && rake db:migrate.
  • mcd to make a directory and change into it.
  • replace foo bar **/*.rb to find and replace within a given list of files.
  • tat to attach to tmux session named the same as the current directory.
  • v for $VISUAL.

Thanks

The origin of this repo is from thoughtbot. Many modifications have been made since then.

Thank you, thoughtbot contributors! Also, thank you to Corey Haines, Gary Bernhardt, and others for sharing your dotfiles and other shell scripts from which we derived inspiration for items in this project.

dotfiles's People

Contributors

dgjnpr avatar geoffharcourt avatar derekprior avatar trepanning-io avatar jferris avatar mike-burns avatar mislav avatar seanpdoyle avatar danielnolan avatar rspeicher avatar calebhearth avatar joelq avatar sublimecoder avatar andyw8 avatar tute avatar christoomey avatar croaky avatar joshuaclayton avatar reshleman avatar iwz avatar tysongach avatar qrush avatar mattmsumner avatar jeckhart avatar jessieay avatar georgebrock avatar bradurani avatar bernerdschaefer avatar joshleichtung avatar karunsiri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.