"dotfiles" and system configuration
- Target platforms: macOS and Red Hat-like Linuxes (eg. CentOS).
- Set-up method:
Beautiful and intricate snowflakeincredibly over-engineered Ansible orchestration.
- Visible in the screenshot:
- Sane Vim pasting via bracketed paste mode.
- Write access to local clipboard from local and remote hosts, inside and outside of tmux (via Clipper).
- Full mouse support (pane/split resizing, scrolling, text selection) in Vim and tmux.
- Focus/lost events for Vim inside tmux.
- Cursor shape toggles on entering Vim.
- Italics in the terminal.
- Bundles a (not-excessive) number of useful Vim plug-ins.
- Conservative Vim configuration (very few overrides of core functionality; most changes are unobtrusive enhancements; some additional functionality exposed via
- Relatively restrained Zsh config, Bash-like but with a few Zsh perks, such as right-side prompt, auto-cd hooks, command elapsed time printing and such.
- Unified color-handling (across iTerm2 and Vim) via Base16 Shell.
- Encrypted versioning of files with sensitive content (via git-cipher).
- Comprehensive Hammerspoon config.
On macOS, Karabiner-Elements is used for the following:
- Make Caps Lock serve as Backspace (when tapped) and Left Control (when chorded with another key). When held down alone, Caps Lock fires repeated Backspace events.
- Make Return serve as Return (when tapped) and Right Control (when chorded with another key). When held down alone, Return fires repeated Return events.
- Maps Control-I to F6 (only in MacVim and the terminal) so that it can be mapped independently from Tab in Vim.
- Toggle Caps Lock on by tapping both Shift keys simultaneously.
- Makes the function keys on my external Realforce keyboard behave like the "media" keys on Apple's keyboards.
- Swap Option and Command keys on my external Realforce keyboard.
- Make the "application" key (extra modifier key on right-hand side) behave as "fn" on Realforce keyboard.
- Make "pause" (at far-right of function key row) behave as "power" (effectively, sleep) on Realforce keyboard.
- Adds a "SpaceFN" layer that can be activated by holding down Space while hitting other keys; I use this to make the cursor keys available on or near the home row in any app.
A number of tools are used to provide command-line access to Gmail and Office IMAP accounts.
- mutt: For reading email.
- isync: For maintaining a local cache of messages for offline access.
- notmuch: For fast search.
- msmtp: For sending email.
- elinks: For viewing HTML emails.
- urlview: For opening URLs from inside mutt.
- terminal-notifier: For notifications.
- lbdb: Contact autocompletion drawing from a number of sources, such as previous messages, aliases, and macOS Contacts (which can be configured to synchronize Google contacts as well).
- imapfilter: For filtering.
- passage: For mediating interaction with the macOS keychain.
In order for all this to work, a few items have to be stored in the macOS keychain:
- A "generic" (A.K.A. "application") keychain items (that is, without protocols, only hostnames):
- "Keychain Item Name": example.net (corresponds to the "host" field in
~/.msmtprc, and "Host" field in
- "Account Name": email@example.com (corresponds to the "user" field in
~/.msmtprc, and "PassCmd" field in
- "Keychain Item Name": example.net (corresponds to the "host" field in
The following Gmail-like/Vim-like bindings are configured:
e: Archive (but note: leaves copy of mail in mailbox until next sync; force an immediate sync with
#: Trash mail.
!: Mark as spam.
gi: Go to inbox.
ga: Go to archive.
gt: Go to sent mail.
gd: Go to drafts.
gs: Go to starred mail.
gl: Go to a label (folder).
x: Toggle selection on entry (see also
c: Compose new message.
s: Toggle star.
*a: Select all.
*n: Deselect all (mnemonic: "select none").
*r: Select read messages.
*u: Select unread messages.
Shift-U: Mark as unread.
Shift-I: Mark as read.
v: View attachments (including alternate parts for a multipart message).
t: Toggle selection on entire thread (see also
A: Show alternate MIME-type in MIME-multipart messages.
O: Save original message.
S: Search all using Xapian query syntax (notmuch-specific reference documentation):
+foo: Must include "foo".
-bar: Must not include "bar".
foo NEAR bar: "foo" within 10 words of "bar" (order-independent).
foo ADJ bar: Like
NEAR, but "foo" must appear earlier than "bar".
"foo bar": Match entire phrase.
foo*: Match "foo", "food", "foobar" etc.
subject:"one two"(two consecutive words),
subject:(one two)(two words anywhere in subject),
subject:one AND subject:two(two words anywhere in subject).
date:3d(exactly 3 days ago)
date:14d..7d(a week ago)
date:10d..(since 10 days ago)
date:..3d(until 3 days ago)
date:"last week"(preceding Monday through Sunday)
date:this-week(Monday to present day)
date:"last year"(also works with
l: Limit listed messages:
~f bob(from bob)
~s foo(subject contains "foo"; "Foo" would search case-sensitively)
~s foo.+bar(subject contains pattern)
!~s foo(subject does not contain "foo")
~d >1m(messages more than 1 month old)
\u: Open list of URLs in message (via
b: Toggle (mailboxes) sidebar.
m: Move message(s).
<Tab>autocompletes addresses from the lbdb database.
Attachment menu bindings:
S: Save all attachments.
mailto links open up in
mutt in iTerm:
- In iTerm2 → Preferences → Profiles → General, select the "Mutt" profile.
- Under URL Schemes → Schemes handled:, select
$$URL$$is documented here.
- The convoluted use of
zshis required to get terminal colors working correctly.
- tmux 2.3 or later.
- Neovim or Vim 8.0 or later with Ruby and Python support (although there's a reasonable amount of feature detection in order to degrade gracefully).
- Relatively recent Zsh.
- Relatively recent Git.
- Clipper for transparent access to the local system clipboard.
- On macOS, iTerm2. Additionally, only the latest version of macOS (currently Sierra) gets actively tested.
- Python to perform setup via the included
- Adobe Source Code Pro or any other fixed-width font that includes the Powerline glyphs.
git clone --recursive https://github.com/wincent/wincent.git
Note that if you're behind a firewall you may need to set up a temporary
~/.gitconfig with appropriate proxy configuration with a format such as:
[http] proxy = fwdproxy:8080
env http_proxy=http://fwdproxy:8080 https_proxy=http://fwdproxy:8080 git clone --recursive https://github.com/wincent/wincent
./install # Installs everything on the local machine. ./install --help # Info on installing specific roles, force-installing etc. ./install dotfiles # Just install dotfiles.
This sets up a local Python environment using the bundled virtualenv, bootstraps Ansible, and then uses Ansible to copy the dotfiles and configure the machine.
Again, if you're behind a firewall, you may need to make use of a proxy during the initial run:
env http_proxy=http://fwdproxy:8080 https_proxy=http://fwdproxy:8080 ./install
As a fallback strategy, in case the
install script fails, you can symlink the dotfiles by hand with a command like the following:
for DOTFILE in $(find roles/dotfiles/files -maxdepth 1 -name '.*' | tail -n +2); do ln -sf $PWD/$DOTFILE ~ done
ln -sf command will overwrite existing files, but will fail to overwrite existing directories.
Warning: Beware of the
.gitconfig, you need to change for your user name and email address:
$ git config --global user.name "John Doe" $ git config --global user.email firstname.lastname@example.org
pycrypto install fails with "'gmp.h' file not found"
If pycrypto causes the install to fail at:
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
due to a missing GMP dependency, try:
brew install gmp env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install pycrypto
And then installing again:
Broken Unicode in Vim (Linux)
If Unicode symbols appear missing or corrupted in Vim, first ensure that your terminal emulator supports UTF-8. Then, check to see if you've properly configured your system-wide UTF-8 support.
Issue this test command:
vim. Unicode in the statusline should be working.
To persist this
LC_* variable binding, edit your
/etc/locale.conf LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
Unless otherwise noted, the contents of this repo are in the public domain. See the LICENSE for details.
The repo is written and maintained by Greg Hurrell <email@example.com> Other contributors that have submitted patches include, in alphabetical order:
- Joe Lencioni
- Mark Stenglein
- Victor Igor
- Zac Collier
This list produced with:
:read !git shortlog -s | grep -v 'Greg Hurrell' | cut -f 2-3 | sed -e 's/^/- /'