• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    Shell
  • Created about 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

sloria's dotfiles as Ansible roles

dotfiles

sloria's dotfiles, rewritten as Ansible roles. Sets up a full local development environment with a single command.

Fully supports macOS. Red Hat and Debian support is good but not as complete.

a few neat features

  • zsh configured with prezto.
  • nice fonts for the terminal and coding.
  • python2, python3, pipx (for managing python CLIs), pyenv (for managing Python versions), and pyenv-virtualenv (for managing virtualenvs)
  • a tmux.conf that's pretty neat.
  • vim with vim-plug for plugin management. All configuration in a single file .vimrc.
  • pluggable. Everything is optional. Fork this. Remove what you don't use. Configure what you do use.
  • Mac packages installed with homebrew. Mac apps installed with homebrew-cask and mas.
  • Useful git aliases
  • Optional git commit signing with GPG

prerequisites

  • homebrew (If on macOS) - Install this first
  • git: brew install git
  • ansible >= 1.6: brew install ansible

install

  • Fork this repo.
  • Clone your fork.
# Replace git url with your fork
# NOTE: It is important that you clone to ~/dotfiles
git clone https://github.com/YOU/dotfiles.git ~/dotfiles
cd ~/dotfiles
  • Update the following variables in group_vars/local (at a minimum)
    • full_name: Your name, which will be attached to commit messages, e.g. "Steven Loria"
    • git_user: Your Github username.
    • git_email: Your git email address.
  • Optional, but recommended: Update group_vars/local with the programs you want installed by homebrew, homebrew-cask, and npm.
    • mac_homebrew_packages: Utilities that don't get installed by the roles.
    • mac_cask_packages: Mac Apps you want installed with homebrew-cask.
  • Edit local_env.yml as you see fit. Remove any roles you don't use. Edit roles that you do use.
  • Optional: If you want to sign Git commits with a GPG key, follow the instructions here to generate a GPG key from Keybase. Then set the GIT_SIGNING_KEY_ID environment variable before running the dot-bootstrap script.
export GIT_SIGNING_KEY_ID=631262B829DDB506

Note: After running the dot-bootstrap script, you should put the above line in ~/.localrc.

  • Run the installation script.
./bin/dot-bootstrap

updating your local environment

Once you have the dotfiles installed you can run the following command to rerun the ansible playbook:

dot-update

You can optionally pass role names

dot-update git python

updating your dotfiles repo

To keep your fork up to date with the sloria fork:

git remote add sloria https://github.com/sloria/dotfiles.git
git pull sloria master

commands

There are three main commands in the bin directory for setting up and updating development environments:

  • dot-bootstrap: sets up local environment by executing all roles in local_env.yml.
  • dot-update: updates local environment by executing all roles in local_env.yml except for the ones tagged with "bootstrap".

special files

All configuration is done in ~/dotfiles. Each role may contain (in addition to the typical ansible directories and files) a number of special files

  • role/*.zsh: Any files ending in .zsh get loaded into your environment.
  • bin/: Anything in bin/ will get added to your $PATH and be made available everywhere.

notes

vscode

Use built-in Settings Sync to sync VSCode settings.

macOS keyboard settings

There are a few keyboard customizations that must be done manually:

  • Turning repeat speed up to 11.

Keyboard settings

  • Mapping Caps Lock to Ctrl.

Modifier keys

login message

You can add a message to the login screen using the following command:

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "This laptop is connected to an iCloud account and is valueless if lost. Contact (123) 456-7890 if found. Reward included."

what if I only want your vim?

First make sure you have a sane vim compiled. On macOS, the following will do:

brew install macvim

The following commands will install vim-plug and download my .vimrc.

After backing up your ~/.vim directory and ~/.vimrc:

mkdir -p ~/.vim/autoload
curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -fLo ~/.vimrc https://raw.githubusercontent.com/sloria/dotfiles/master/roles/vim/files/vimrc

You will now be able to open vim and run :PlugInstall to install all plugins.

troubleshooting

If you get an error about Xcode command-line tools, you may need to run

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

If pyenv versions fail to install, try the steps here:

pyenv/pyenv#1219 (comment)

If python environments break after upgrading brew-installed python, rehash pyenv and re-install pipx environments

pyenv rehash


mv ~/.local/bin ~/.local/bin.bak
mv ~/.local/pipx ~/.local/pipx.bak

dot-update pipx

todo

  • Full Debian and Red Hat support

license

MIT Licensed.

More Repositories

1

TextBlob

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.
Python
9,115
star
2

doitlive

Because sometimes you need to do it live
Python
3,434
star
3

environs

simplified environment variable parsing
Python
1,203
star
4

konch

Configures your Python shell.
Python
406
star
5

PythonORMSleepy

Python ORM/ODM Examples, For The Sleepy
Python
212
star
6

pypi-cli

A command-line interface to the Python Package Index (PyPI). Get package info, download statistics, and more.
Python
168
star
7

local-repl

🐚 Project-specific configuration for the Node.js REPL
JavaScript
152
star
8

flask-ghpages-example

An example of how you can deploy a static Flask app on Github pages
Python
113
star
9

textblob-aptagger

*Deprecated* A fast and accurate part-of-speech tagger for TextBlob.
Python
104
star
10

flask-konch

An improved shell command for the Flask CLI
Python
69
star
11

textblob-fr

French language support for TextBlob.
Python
58
star
12

sphinx-issues

A Sphinx extension for linking to your project's issue tracker
Python
53
star
13

sublime-html5-boilerplate

Sublime Text 2/3 snippet to generate HTML5 boilerplate
47
star
14

aiohttp-utils

Handy utilities for building aiohttp.web applications
Python
47
star
15

ped

πŸ‘ž Quickly open Python modules in your text editor
Python
43
star
16

webargs-starlette

Declarative request parsing and validation for Starlette with webargs
Python
39
star
17

gig

Generate .gitignore files from the command line or programmatically, in Python
Python
38
star
18

tbpaste

Sentiment analysis, as easy as copy-and-paste
Python
30
star
19

perspective-api-client

Node.js client for the Perspective API
JavaScript
28
star
20

AreYouSure.js

Inline confirmation dialogs in Javascript
JavaScript
26
star
21

cookiecutter-docopt

A Python command-line script template that uses docopt for arguments parsing
Python
24
star
22

webtest-plus

An extension of WebTest with useful extras, including requests-style authentication
Python
17
star
23

textfeel-web

An online sentiment analyzer built with Flask and TextBlob
JavaScript
15
star
24

designpatterns.py

Some design patterns, in Python flavor
Python
14
star
25

sir

(Work in progress) An open source assistant . Python 3 + aiohttp on the backend. ES6 + Redux + React on the frontend.
JavaScript
13
star
26

jrnl-render

Render a jrnl (jrnl.sh) file as a webpage.
TypeScript
13
star
27

psychopy-project-template

A template for a PsychoPy project. Aims to separate concerns of the experiment designer and the programmer.
Python
13
star
28

tinynetrc

Read and write .netrc files in Python
Python
13
star
29

vim-ped

πŸ‘Ÿ Quickly open Python modules in vim
Vim Script
10
star
30

usv

Tools for classifying and analyzing animal ultrasonic vocalizations
Python
10
star
31

flask-template

*ABANDONDED*. Use cookiecutter-flask instead.
JavaScript
9
star
32

webtest-aiohttp

Integration of WebTest with aiohttp.web applications
Python
9
star
33

sublime-selenium-snippets

Sublime Text 2/3 snippets for the Selenium WebDriver Python bindings
9
star
34

yopy

Zero characters communication for humans
Python
8
star
35

wtfhack

A silly website for finding open-source projects to work on inspired by WhatTheFuckShouldIMakeForDinner.com
JavaScript
6
star
36

jrnl-parse

Parses jrnl (jrnl.sh) files in Node.js or the browser.
JavaScript
6
star
37

webtest-asgi

Integration of WebTest with ASGI applications.
Python
6
star
38

sublime-nose-snippets

Sublime Text snippets for Python nose testing
5
star
39

python-subreddit-stats

Visualization of user traffic on python-related subreddits
CSS
5
star
40

device-inventory

A simple Django app for device asset management.
JavaScript
5
star
41

stimulus.py

Wrappers around PsychoPy stimuli that make it easy to present a study paradigm
Python
4
star
42

simplist

One-click collaborative lists
JavaScript
4
star
43

pipstat

DEPRECATED: Use pypi-cli instead: https://github.com/sloria/pypi-cli
Python
3
star
44

zettel-new-tab

Firefox/Chrome extension to display text files in new tabs
JavaScript
3
star
45

www

The Pelican site that generates stevenloria.com
CSS
3
star
46

samsung-prediction

Predicting user activity based on smartphone data
R
2
star
47

marshmallow-dashboard

Python
2
star
48

r-lcfd

A minimal R project skeleton
R
2
star
49

sublime-pytest-snippets

Sublime Text Snippets for pytest
2
star
50

pre-commit-docker

Run pre-commit (https://pre-commit.com) in Docker
Dockerfile
2
star
51

datasources

Python
1
star
52

scribnote

Python
1
star
53

reversr

It reverses audio. Nothing more.
JavaScript
1
star
54

cosroom

[For COS employees only] Find an open room in the COS office
JavaScript
1
star
55

sepal

JavaScript
1
star
56

read_env

reads .env files
Python
1
star