Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Nov 16, 2015
  1. @reshleman

    Remove Unused `move_to_front_of_path` Function

    reshleman committed
    In #440, a `move_to_front_of_path` function was introduced, but
    was [ultimately not used][1] when these changes were merged as f7c73f7.
    The function itself was not removed, however.
    This commit removes the unused function.
    [1]: #440 (comment)
Commits on Nov 14, 2015
  1. @geoffharcourt

    Add tab-completion with local branches for `git delete-branch`

    geoffharcourt committed
    This solution was heavily influenced by @keith's original contribution
    in #356, which I think may have worked on some but not all setups due to
    personal configuration differences.
    The solution in #356 added the `_git_delete_branch` function in the
    `zsh/completions` folder, which resulted in the tab-completion working
    against `git`, but not against our `g` function. With our new loading
    order where functions are loaded first and completions are loaded last,
    we can load the `_git_delete_branch` function before any completions are
    defined on `git`, `g`, or `hub`, allowing the `_git_delete_branch` shim
    to be used by all three of those git-invoking commands/functions.
    Close #355.
Commits on Nov 13, 2015
  1. @geoffharcourt

    Don't export `$PS1`

    geoffharcourt committed
    The `$PS1` variable does not need to be exported in order for `zsh` to
    use its contents to set prompt options. `export`ing it has the negative
    side-effect of polluting prompts in shells launched from `zsh`. The
    `export`ing of `$PS1` is the cause of #270, where using `sudo su` to
    become another user (launching a non-`zsh` shell) resulted in a
    corrupted prompt.
    Removing the `export` will allow `sh`/`bash`/`dash` and other shells to
    be launched from `zsh` without inheriting its prompt settings.
    Fix #270.
  2. @geoffharcourt

    Use `export -U` to deduplicate `$PATH`

    geoffharcourt committed
    In f7c73f7 we started to deduplicate
    `$PATH` using `typeset -U`, but that did not prevent duplicate `$PATH`
    entries when processes were launched that inherited the environment from
    an existing shell.
    Using `export -U` keeps the `$PATH` deduplicated even when tmux launches
    a new shell.
    Fix #443.
  3. @TheLonelyGhost @geoffharcourt

    Deduplicate `PATH` before exporting

    TheLonelyGhost committed with geoffharcourt
    * Remove dupes from PATH
    $PATH is a scalar composed of contents of $path, so it uses typeset -U
    ("U" as in Unique) to ensure there are no dupes. It preserves the first
    occurrence in the array, since it would be searched first before others
    when matching a command in the directories in the PATH anyway.
Commits on Nov 6, 2015
  1. @teoljungberg @geoffharcourt

    Add `ctags` support for `attr_` definitions

    teoljungberg committed with geoffharcourt
    This change adds `ctags` support for `attr_{reader,writer,accessor)` in
    Ruby files.
  2. @mike-burns

    Split zsh configuration into smaller files

    mike-burns committed with Geoff Harcourt
    This allows people to incorporate the thoughtbot dotfiles into their own
    dotfiles in a more fine-grained manner.
    I left some things in zshrc that we should eventually handle more
    - Load `.zsh/functions/*`. This could instead be replaced with: `mv
      .zsh/functions/* .zsh/configs`.
    - Load `.aliases`. This could instead be replaced with: `mv .aliases
    - Load `.zshrc.local`. This file can realistically go away entirely,
      with people adding their own files to `.zsh/configs`.
    A further refactoring, which I have done locally, is to introduce a
    `~/.sh/configs` directory, in which people can put POSIX-specific
    configuration that can be shared between GNU Bash, zsh, ksh, etc:
    aliases, functions, paths, prompts, and so on. But one step at a time.
    Other changes:
    * Move aliases setup to occur after loading other config, as some of our
      aliases depend on environment variables having been set, so alias
      loading must come last after we've sourced `zsh/configs`.
    * Move autocompletion for `g` function from the function definition to
      to `zsh/completions/_g`
    * Move `PATH` setup to `zsh/configs/post` to ensure it happens after
      other configuration that might alter the `PATH`
Commits on Nov 4, 2015
  1. @seanpdoyle

    Recognize JS Linter configuration files as JSON

    seanpdoyle committed
    Unfortunately, the convention for most JavaScript linters is to name
    their configuration `.${TOOL}rc`.
    In spite of this name, the configuration files are `JSON`. Forcing vim
    to recognize them as JSON would enable syntax highlighting and linting
    plugins (like syntastic) to recognize invalidly structured JSON.
Commits on Oct 30, 2015
  1. @geoffharcourt

    Update Bundler completion to include newer subcommands, fix help

    geoffharcourt committed
    The zsh-completions repository has some additional Bundler subcommands
    in their completion since we first implemented it a couple years ago.
    This change updates our `_bundle` autocompletion definition to include
    the subcommands `outdated` and `platform`, as well as separating values
    for `bundle help`.
    Separating the individual commands when defining candidates for `bundle
    help` allows tab-completion of those subcommands (e.g. hitting `<TAB>`
    with `bundle help in` would suggest `init` and `install` and tab
    complete either option.
    Changes imported from
  2. @geoffharcourt

    Bring more shell syntax into shellcheck compliance

    geoffharcourt committed
    **Bring executables into better shellcheck compliance**
    While evaluating linting and testing options for our shell
    configuration, a run of Shellcheck against our executables turned up
    some places where we could use more consistent syntax across our
    executables, such as always using a shebang or quoting `$HOME` when we
    build up a larger directory.
    **Update syntax for zsh functions and completions**
    A few changes found while linting zsh configs with shellcheck:
    * thoughtbot's [style guide] [guide] calls for `$(..)` over backticks
      when capturing command output
    * use `-gt` to test array length in arguments
Commits on Oct 23, 2015
  1. @gylaz @geoffharcourt

    Provide an example of specifying dotfiles dir

    gylaz committed with geoffharcourt
    * There can be confusion on how to tell `rcup` where local dotfiles
      have been installed.
  2. @mislav

    Only colorize warning messages if stderr is a tty

    mislav committed with Geoff Harcourt
    This is to avoid outputting ANSI escape codes to scripts and log files.
  3. @mislav

    Move broken OS X /etc/zshenv detection to post-up hook

    mislav committed with Geoff Harcourt
    This is so it doesn't run every time when zsh starts in interactive
    mode, but just once per `rcup`.
  4. @mislav

    Detect OS X broken `/etc/zshenv` and suggest rename

    mislav committed with Geoff Harcourt
    If `/etc/zshenv` that calls `path_helper` is found on the system, assume
    OS X version pre-El Capitan and suggest that this file gets renamed to
    `zprofile` so that it only gets sourced on login shells and doesn't mess
    up PATH order on nested invocation of zsh.
  5. @mislav

    Detect if `~/.zshenv.local` changes PATH and suggest `.zshrc` instead

    mislav committed with Geoff Harcourt
    Warn people who might have PATH and similar configuration in their
    `~/.zshenv.local` that they should upgrade to `~/.zshrc.local` since
    that's a much better phase for such configuration. This is for backwards
    compatibility with people's personal configurations from pre-El Capitan
    The generic `.zshenv` file from zsh distribution[1] advises:
    > .zshenv is sourced on ALL invocations of the shell, unless the -f
    > option is set. It should NOT normally contain commands to set the
    > command search path, or other common environment variables unless you
    > really know what you're doing. E.g. running `PATH=/custom/path gdb program`
    > sources this file (when gdb runs the program via $SHELL), so you want
    > to be sure not to override a custom environment in such cases. Note
    > also that .zshenv should not contain commands that produce output or
    > assume the shell is attached to a tty.
  6. @mislav

    Avoid suggesting that people use `.zshenv.local`

    mislav committed with Geoff Harcourt
    `.zshenv` is executed for all zsh programs, even those run from
    executables and not as an interactive shell, and furthermore due to
    OS X's use of `path_helper` in `/etc/zprofile` which runs after that,
    it's not a good place to configure additional PATH entries.
    From zsh(1) man page:
    > As /etc/zshenv is run for all instances of zsh, it is important that
    > it be kept as small as possible.
    So `.zshenv` is generally considered advanced usage and is not
    recommended that people drop their casual login shell config in here.
    Because of people's historical misuse of `.zshenv`, stop documenting it
    in the README and suggest that people do their PATH and other
    configuration in `.zshrc`.
  7. @mislav

    Move EDITOR and PATH tweaks from `.zshenv` to `.zshrc`

    mislav committed with Geoff Harcourt
    Making tweaks such as setting EDITOR or changing PATH only makes sense
    for interactive shells, e.g. those that open in your Terminal window or
    when you log in to a server. Non-interactive shells (such as those
    started by running `zsh myscript.zsh` or any executable with `zsh`
    shebang) should instead inherit those values from the environment.
    Furthermore, changing PATH in `~/.zshenv` is not advised since stock
    OS X `/etc/zprofile` will reoder PATH by means of `path_helper`, so it's
    better to make any additional PATH manipulation in `~/.zprofile` or
  8. @mislav

    Revert "Add instructions to fix path on OS X El Capitan"

    mislav committed with Geoff Harcourt
    For years, OS X has mistakently invoked `path_helper` in `/etc/zshenv`
    (affecting all zsh runtimes, even non-interactive shells such as
    scripts) instead of from `/etc/zprofile` where it should have been
    because it needs to only run once for a login shell.
    This frustrated a lot of users since `path_helper` would unexpectedly
    reorder their PATH by putting system paths first during nested
    invocations of zsh. Many have disabled their `path_helper` because they
    believed it to be the culprit. Instead, what they should have done is
    fixed the OS X configuration bug and renamed their `/etc/zshenv` to
    Recently, El Capitan shipped and users of zsh rejoiced because it has
    finally fixed its faulty zsh configuration: the `path_helper` is now
    correctly invoked from `/etc/zprofile`. This was a deliberate change on
    Apple's part and is a BUG FIX, NOT A REGRESSION.
    However, now this project suggests the opposite: revert the El Capitan
    fix and move `/etc/zprofile` to `/etc/zshenv`. This is unwise since it
    teleports us to the olden days of broken zsh configuration. Please don't
    instruct users to break their system.
    This reverts commit 15de0bc.
Commits on Oct 21, 2015
  1. @geoffharcourt
Commits on Oct 16, 2015
  1. @seanpdoyle

    Add `git pf` alias

    seanpdoyle committed
    Using `--force-with-lease` allows one to force push without the risk of
    unintentionally overwriting someone else's work.
    The git-push(1) man page states:
    > Usually, "git push" refuses to update a remote ref that is not an
    > ancestor of the local ref used to overwrite it.
    > This option overrides this restriction if the current value of the
    > remote ref is the expected value. "git push" fails otherwise.
    > --force-with-lease alone, without specifying the details, will protect
    > all remote refs that are going to be updated by requiring their
    > current value to be the same as the remote-tracking branch we have for
    > them.
    > --@calleerlandsson
    > -- thoughtbot/guides#363
  2. @geoffharcourt

    Remove zsh `jj` keybinding

    geoffharcourt committed
    As reported in #405, the `jj` keybinding is problematic for some users
    as it enters vi-mode whenever a user types a string that actually
    contains two consecutive `j`s.
    While consecutive `j`s are unusual in English, usernames with
    consecutive `j`s such as that of the contributor who reported the
    problem (@jjlangholtz) are common enough that we shouldn't force this
    mapping on users.
    Users can add their own keybinding to their local configuration or use
    the already-provided `Esc` binding to enter vi-mode.
    PR #405 contains other keybinding changes that we don't want to apply,
    this commit addresses only the `jj` binding.
  3. @codenamev @geoffharcourt
Commits on Oct 9, 2015
  1. @mike-burns

    Remove unused Easter egg

    mike-burns committed
    The `ranch` subcommand is annoying to skip and adds clutter to our
    system, which only encourages people not to use our dotfiles as a base.
    Remove it to get customizability back.
  2. @JoelQ

    Add custom git command `git ranch`

    JoelQ committed
    Sometimes when typing `git branch` I leave off the leading `b`, leading
    to the boring message:
    > git: 'ranch' is not a git command. See 'git --help'.
    This adds a custom `git ranch` command with a friendlier funny message.
Commits on Oct 8, 2015
  1. @andyw8

    Clarify integration with Exuberant Ctags

    andyw8 committed
    The ctags.vim plugin was removed in #375. I updated the README to
    document the Vim mapping for re-indexing a project's ctags.
Commits on Oct 3, 2015
  1. @geoffharcourt

    Use vim-projectionist and vim-rake

    geoffharcourt committed
    vim-projectionist provides vim-rails-like shortcuts for alternate and
    related files. It allows users to provide a custom set of "projections"
    that map filetypes to their alternate and related counterparts. Custom
    mappings can be declared in a JSON-like syntax.
    This change provides authors of gems and other non-Rails Ruby projects
    with access to the alternate file `:A` shortcuts to navigate between
    code and specs. vim-rake automatically maps code/spec mappings for Ruby
    files if vim-projectionist is available.
    Close #381.
  2. @geoffharcourt

    Merge pull request #424 from zillou/readme-command-fix

    geoffharcourt committed
    Fix syntax for OS X path_helper directions in README
  3. @zillou

    Fix a command in README

    zillou committed
Commits on Oct 2, 2015
  1. @geoffharcourt

    Add instructions to fix path on OS X El Capitan

    Geoff Harcourt committed with geoffharcourt
    OS X 10.11 changes the file where `path_helper` is invoked from
    `/etc/zshenv` to `/etc/zprofile`. The change results in `path_helper`
    rearranging the path in such a way that interferes with path changes
    made in `.zshenv`.
    This README update instructs users to rename `/etc/zprofile` to
    `/etc/zshenv` so that `.zshenv` (and `.zshenv.local`) will be loaded
    *after* `path_helper` is called, maintaining the desired precedence of
    Thanks to @reshleman and @ventsislaf for investigating and offering
  2. @croaky
Commits on Aug 25, 2015
  1. @geoffharcourt

    Update README to advise running `rcup` after update

    geoffharcourt committed
    In #408 a user reported errors after pulling down master and opening
    Vim without having run `rcup`. This documentation change updates the
    section on `rcup` to advise running the command after pulling from the
    Other changes:
    * Removed outdated references to `m` and `rk` aliases, which have been
      removed from the repository.
    * Added reference to `migrate` alias, which remains in the repository.
Commits on Jul 29, 2015
  1. @timfenney
Commits on Jul 12, 2015
  1. @blainesch
Commits on Jul 4, 2015
  1. @CodingFu


    CodingFu committed
Commits on Jun 15, 2015
  1. @derekprior

    Ignore "useless use of variable in void context"

    derekprior committed
    The following ERB generates a "Possibly useless use of variable in void
    context" warning from Syntastic:
    <%= comment %>
    The warning can be eliminated by making it:
    <%= comment.to_s %>
    However, this behavior is the default and is redundant. There are other
    cases where this warning pops up and in each case I've found it to be of
    no use.
Something went wrong with that request. Please try again.