• Stars
    star
    938
  • Rank 48,711 (Top 1.0 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

Settings for various tools I use.

dotfiles

Here's a bunch of settings for the various tools I use. I also have a number of blog posts and videos related to my dev environment. There's also this documentation to help you get everything installed and configured.

Documentation

Screenshots

Since my dotfiles are constantly evolving and I tend to reference them in videos, blog posts and various social media posts I thought it would be a good idea to include a screenshot of each theme I used and how to switch to it.

I prefer using themes that have good contrast ratios and are clear to see in video recordings. These dotfiles currently support easily switching between Gruvbox Community and One but you can use any theme you'd like.

Theme progression

  • January 2021 (Gruvbox Community)
  • April 2020 (One)
  • December 2018 (Gruvbox Community)

Themes

These dotfiles include a set-theme script that you can run from your terminal to set your theme to any of the themes listed below. This script takes care of configuring your terminal, tmux, Vim and fzf's colors in 1 command.

If you don't like the included themes that's no problem. You can use whatever you want, there's no limitations. You could choose to manually change the colors or adjust the set-theme script to add a custom theme.

Ater installing these dotfiles you can run this from your terminal:

# Switch to a supported theme.
# Theme names are listed below near the screenshots.
# You can also run set-theme --help to see a list of themes.
set-theme [theme_name]

# Switch between dark and light backgrounds for the active theme.
set-theme --toggle-bg

# Switch the theme and toggle the background in 1 command.
set-theme [theme_name] --toggle-bg

If you get an error about your terminal config file not being found please review this FAQ item.

Gruvbox Community

set-theme gruvbox

Dotfiles

One

set-theme one

Dotfiles

Quickly Get Set Up with These Dotfiles

There's an ./install script you can run to automate installing everything. That includes installing system packages such as tmux, Vim, zsh, etc. and configuring a number of tools in your home directory.

It even handles cloning down this repo. You'll get a chance to pick the clone location in the script as well as view and / or change any system packages that get installed.

The install script is optimized for:

  • Ubuntu 20.04 LTS+ (native or WSL)
  • Debian 11+ (Debian 10 will work if you enable backports for tmux)
  • macOS 10.15+

It will still work with other distros of Linux if you skip installing system packages (more details are below).

You can download and run the install script with this 1 liner:

bash <(curl -sS https://raw.githubusercontent.com/nickjj/dotfiles/master/install)

If you're not comfortable blindly running a script on the internet, that's no problem. You can view the install script to see exactly what it does. Each section is commented. Sudo is only used to install system packages. Alternatively you can look around this repo and reference the config files directly without using any script.

You can also run the script without installing system packages:

bash <(curl -sS https://raw.githubusercontent.com/nickjj/dotfiles/master/install) --skip-system-packages

That above could be useful if you're using a non-Debian based distro of Linux, in which case you'll need to install the dependent system packages on your own beforehand. Besides that, everything else is supported since it's only dealing with files in your home directory.

My set up targets zsh 5.0+, tmux 3.0+ and Vim 8.1+. As long as you can meet those requirements you're good to go.

Did you install everything successfully?

Nice!

If you haven't done so already please close your terminal and open a new one, then follow the step(s) below:

1. Configure your git name and email

One of the things the install script did was copy a git ignored git config file into your home directory. You're meant to put in your name and email address so that your details are used when you make git commits.

vim ~/.gitconfig.user

2. (Optional) confirm that a few things work

# Check to make sure git is configured with your name and email.
git config --list

# Sanity check to see if you can run some of the tools we installed.
vim --version
tmux -V
node --version

Before you start customizing certain config files, take a look at the personalization question in the FAQ.

Extra WSL 1 and WSL 2 steps

In addition to the Linux side of things, there's a few config files that I have in various directories of this dotfiles repo. These have long Windows paths.

It would be expected that you copy those over to your system while replacing "Nick" with your Windows user name if you want to use those things, such as my Microsoft Terminal settings.json file and others. Some of the paths may also contain unique IDs too, so adjust them as needed on your end.

Some of these configs expect that you have certain programs or tools installed on Windows. The tools I use blog post has a complete list of those tools so you can pick the ones you want to install.

Pay very close attention to the c/Users/Nick/.wslconfig file because it has values in there that you will very likely want to change before using it. This commit message goes into the details.

Also, you should reboot to activate your /etc/wsl.conf file (the install script created this). That will be necessary if you want to access your mounted drives at /c or /d instead of /mnt/c or /mnt/d.

FAQ

How to personalize these dotfiles?

Chances are you'll want to personalize some of these files, such as various Vim settings. Since this is a git repo you can always do a git pull to get the most up to date copy of these dotfiles, but then you may find yourself clobbering over your own personal changes.

Since we're using git here, we have a few reasonable options.

For example, from within this dotfiles git repo you can run git checkout -b personalized and now you are free to make whatever changes that you want on your custom branch. When it comes time to pull down future updates you can run a git pull origin master and then git rebase master to integrate any updates into your branch.

Another option is to fork this repo and use that, then periodically pull and merge updates. It's really up to you.

How to add custom themes to the set-theme script?

Prefer a video? Here's a video that demonstrates performing the steps below.

After installing these dotfiles you'll have a ~/.local/bin/set-theme script. It's a zero dependency Python 3 script.

  1. Open the above file
  2. Check out the THEMES dictionary near the top of the file
  3. Copy one of the existing themes' dictionary items, such as gruvbox or one
  4. Rename the dictionary's key to whatever your new theme's colorscheme name is in Vim
  5. Adjust all of the colors and additional values in your new dictionary item as you see fit
  6. Run set-theme cooltheme, replacing cooltheme with whatever name you used in step 4

Your terminal and tmux colors will update automatically, but if you have Vim already open you'll need to manually run this command from within Vim to reload your config :so $MYVIMRC.

If you added a theme with good contrast ratios please open a pull request to get it added to the script.

How to use a different terminal in the set-theme script?

I'm using the Microsoft Terminal but if you're using something else then your terminal's colors won't get updated by this script because the script looks for strings that are in MS terminal's config, but it's not painful to change.

By the way, if you're using the Microsoft Terminal Preview edition you'll still need to do step 1 below because the path of your MS terminal config file will be different than the non-preview edition.

You'll want to adjust the set-theme script by doing this:

  1. Change the TERMINAL_CONFIG variable to reference your terminal config's path
  2. Change the terminal attributes in the THEMES dictionary to use your terminal's config option names
  3. Change the regex in the change_terminal_theme function based on your terminal's config option formatting rules
  4. Optionally install Gruvbox, One or any other themes (the MS Terminal config in this repo includes them)

How to fix Vim taking a long time to open when inside of WSL?

It primarily comes down to either VcXsrv not running or a firewall tool blocking access to VcXsrv and it takes a bit of time for the connection to time out.

You can verify this by starting Vim with vim -X instead of vim. This will prevent Vim from connecting to an X server. This also means clipboard sharing to your system clipboard won't work, but it's good for a test.

Vim will try to connect to that X server by default because DISPLAY is exported in the .zshrc file. Installing and configuring VcXsrv as per these dotfiles will fix that issue.

If it still persists, it might be a software firewall issue. You can open TCP port 6000 and also restrict access to it from only WSL 2. This will depend on which tool you're using to configure that but that should do the trick.

About the Author

I'm a self taught developer and have been freelancing for the last ~20 years. You can read about everything I've learned along the way on my site at https://nickjanetakis.com. There's hundreds of blog posts and a couple of video courses on web development and deployment topics. I also have a podcast where I talk to folks about running web apps in production.

More Repositories

1

docker-django-example

A production ready example Django app that's using Docker and Docker Compose.
Python
1,148
star
2

build-a-saas-app-with-flask

Learn how to build a production ready web app with Flask and Docker.
HTML
950
star
3

docker-rails-example

A production ready example Rails app that's using Docker and Docker Compose.
Ruby
945
star
4

ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
Python
744
star
5

orats

Opinionated rails application templates.
Ruby
665
star
6

docker-flask-example

A production ready example Flask app that's using Docker and Docker Compose.
Python
583
star
7

ansigenome

A tool to help you gather information and manage your Ansible roles.
Python
447
star
8

flask-webpack

A Flask extension to manage assets with Webpack.
Python
338
star
9

rolespec

A test library for testing Ansible roles
Shell
232
star
10

docker-web-framework-examples

Example apps that demonstate how to use Docker with your favorite web frameworks.
Elixir
217
star
11

docker-phoenix-example

A production ready example Phoenix app that's using Docker and Docker Compose.
Elixir
207
star
12

docker-node-example

An example Node / Express app that's using Docker and Docker Compose.
Shell
200
star
13

flask-static-digest

Flask extension to help make your static files production ready by md5 tagging and gzipping them.
Python
154
star
14

notes

A zero dependency shell script that makes it really simple to manage your text notes.
Shell
129
star
15

manifest-revision-webpack-plugin

Write out a manifest file containing your versioned webpack chunks and assets.
JavaScript
124
star
16

flask-db

A Flask CLI extension to help migrate and manage your SQL database.
Python
75
star
17

ansible-nginx

Install and configure nginx (SSL A+ by default) with Ansible.
Jinja
73
star
18

ansible-acme-sh

Install and auto-renew SSL certificates with Let's Encrypt using acme.sh.
71
star
19

wait-until

A zero dependency Bash script that waits until a command of your choosing has run successfully.
Shell
57
star
20

webserver

A zero dependency Python 3 web server to echo back an HTTP request's headers and data.
Python
50
star
21

ansible-user

Create and configure a user for SSH key based logins and passwordless sudo.
48
star
22

dockercon21-docker-best-practices

Reference links for my live demo talk from DockerCon 21.
47
star
23

ansible-fail2ban

Install and configure fail2ban using ansible.
46
star
24

runninginproduction.com

The website for the Running in Production podcast.
HTML
41
star
25

esbuild-copy-static-files

An esbuild plugin to copy static files that changed from a source directory to a destination directory.
Shell
37
star
26

flask-pg-extras

A Flask extension to obtain useful information from your PostgreSQL database.
Python
33
star
27

ansible-swapfile

Create and configure a swap file with Ansible.
32
star
28

ansible-letsencrypt

Install and auto-renew SSL certificates with Let's Encrypt and Ansible.
Python
29
star
29

invoice

Calculate a billable amount, hours and days logged for 1 or more projects.
Shell
18
star
30

nyhackr-cli-dev-env

Reference notes for the Creating a Command Line Driven Development Environment talk.
18
star
31

ansible-playbooks

A collection of ansible playbooks with end to end examples.
Shell
18
star
32

ansible-rails

Deploy a rails application using git with ansible.
Ruby
18
star
33

gowatcher

Reload a specified go program automatically by monitoring a directory.
Shell
16
star
34

docker-community-all-hands

Reference links to every talk I've given for the Docker Community All-Hands events.
15
star
35

deploy-web-apps-with-docker

Rescue yourself from the complexity of DevOps
Dockerfile
15
star
36

title-case-converter

A CLI tool to capitalize words based on industry standard style guides.
Python
14
star
37

sublime-text-3-packages

A list of my Sublime Text 3 packages along with their settings.
Python
14
star
38

flask-secrets

A Flask CLI extension to generate random secret tokens.
Python
14
star
39

verdiff

A CLI tool to diff 2 versions of a Phoenix, Rails, Django or Laravel generated project.
Python
12
star
40

ansible-security

Configure ssh and ufw as well as install fail2ban with ansible.
12
star
41

gemshine

Recursively compare a ruby project's gem versions to their latest versions.
Ruby
12
star
42

ansible-iptables

Configure iptables using Ansible.
12
star
43

lcurl

Visit a site every X seconds in a loop to help detect downtime while testing deployment strategies.
Shell
12
star
44

ansible-sshd

Install and configure openssh-server using Ansible.
12
star
45

demo-for-chattanooga-python-user-group

A demo app for a talk I gave at the Chattanooga python user group.
JavaScript
10
star
46

latest-releases

A command line tool that lets you keep tabs on the latest releases of your favorite tools and libraries.
Shell
10
star
47

ansible-monit

Install monit and configure as many processes as you want with ansible.
8
star
48

passify

A small utility to create a password and wrap bcrypt.
JavaScript
8
star
49

pick-random-youtube-comments

Get a list of top level comments from a YouTube video and then pick N amount of unique comment authors by choosing them randomly.
Python
8
star
50

ansible-bootstrap

Configure a server to run Ansible and install essential packages.
6
star
51

ansible-ferm

Manage iptables with ferm using ansible.
5
star
52

ansible-postgres

Install a bare bones version of postgres with ansible.
5
star
53

ansible-pumacorn

Manage a puma or unicorn rails process with init.d using ansible.
Ruby
5
star
54

docker-faye

A docker image for running a secure Faye (websocket) server.
JavaScript
5
star
55

ansible-nodejs

Install the latest stable version of nodejs with ansible.
4
star
56

ansible-mariadb

Install and configure MariaDB using Ansible.
4
star
57

ansible-sendy

Copy and configure Sendy with Ansible.
C
3
star
58

ansible-locale

Install and configure your system's locale using ansible
3
star
59

ansible-phpfpm

Install and configure php-fpm using Ansible.
2
star
60

ansible-dnsmasq

Install and configure dnsmasq to map a TLD to localhost using ansible.
2
star
61

docker-play-example

A production ready example Play app that's using Docker and Docker Compose.
1
star