Commits on Jul 22, 2016
  1. Add `ag` mappings in vim
    - Create an `:Ag` command if none is defined.
    - map `\` in normal mode to set up the command for an argument
    geoffharcourt committed Jul 22, 2016
  2. Use "absolute" paths for agignore

    This seems to resolve an issue where CtrlP would randomly return "NO
    This also sorts the paths alphabetically, because OCD. 🎉
    tsigo committed with geoffharcourt Jul 5, 2016
Commits on Jun 28, 2016
  1. Update install documentation

    In #488 there was some confusion over where to clone the dotfiles
    repository before running `rcm`. While the repository can be placed
    anywhere, by default users should be placing it in `~/dotfiles` if they
    are using the default installation instructions and an unmodified
    Close #488.
    geoffharcourt committed Jun 28, 2016
Commits on Jun 10, 2016
  1. Add a zsh binding for push-line-or-edit: ^Q

    The use case for push-line-or-edit:
    1. You are in the middle of typing a long command, perhaps something
    involving `tar`.
    2. You realize that you must first run another command, such as `man
    3. You invoke `push-line-or-edit`, which gives you a fresh prompt. You
    type `man tar` and read as needed.
    4. When the command (`man tar`) finishes, the long command you
    half-typed is back, exactly as you left off.
    Other use cases are realizing that you're in the wrong directory before
    you press enter, changing your Ruby version before you press enter on
    that `bundle` command, or in general being partway through something and
    realizing that you're not quite ready to run it yet.
    While here, turn off start/stop output control, which gives us back the
    ^Q keybinding.
    mike-burns committed Apr 25, 2016
Commits on Jun 8, 2016
  1. Configure basic ctags for javascript projects

    There are, apparently, more things we need to configure. @BlakeWilliams shared
    which outlines a bunch more things that don't work out of the box. For
    example, ES2015 classes and their methods are not properly found, even
    with this PR. There's more work to do here.
    iwz committed May 23, 2016
Commits on Apr 15, 2016
  1. Git ignore .byebug_history

    After using byebug on any Ruby file, the sessions history is written to
    this file. It shouldn't be part of our repositories, so we ignore it.
    See also: thoughtbot/suspenders#710
    tute committed Apr 15, 2016
  2. Overwrite internal field separator when replacing.

    Currently the `for` in bash will break up lists by whitespace, so if a
    filename has a space in it the `for` will break it up incorrectly.
    AG will separate the files with a newline character, so this temporarily
    overwrites the `IFS` to be used correctly for this use case.
    blainesch committed with geoffharcourt Apr 8, 2016
Commits on Apr 8, 2016
  1. Avoid expanding tabs to spaces for Golang files

    * `noexpandtab` will ensure tabs are used instead of staces when tabbing
    or auto-indenting.
    * `softtabstop=2` isn't needed because we are already setting
    `tabstop=2` in our `.vimrc`.
    gylaz committed with geoffharcourt Mar 31, 2016
  2. Add rhubarb.vim for fugitive Github support

    We do most of our client work on Github,
    and a large portion of our personal projects
    are hosted there.
    fugitive.vim currently supports
    opening the current file in the current branch
    in a browser at Github through the `Gbrowse` command.
    That command is [slated to be removed to make fugitive
    agnostic about coding sites](fugitive-docs).
    The capability to quickly generate or view a Github URL
    specific to the current branch
    can be useful in PR reviews
    or other discussions about code.
    This change adds rhubarb.vim,
    a plugin that implements the slated-to-be-removed
    functionality of fugitive that works with Github.
    It also provides the user with omni-completion (`<C-x><C-o>`)
    to autocomplete Github issues, issue URLs, and collaborators.
    geoffharcourt committed Feb 18, 2016
Commits on Mar 24, 2016
  1. Update vimrc.bundles

    Fixed typo
    btakashi committed Mar 24, 2016
Commits on Mar 11, 2016
  1. Use vim-test instead of vim-rspec

    vim-rspec is an excellent Vim plugin for running RSpec tests but there
    are many of us who run different kinds of tests on any given day.
    vim-test is built to support a wide array of test frameworks and
    strategies for executing those tests.
    vim-test ships with support for several languages and frameworks in use
    on thoughtbot projects today:
    * Ruby (both RSpec and Minitest)
    * Elixir (ExUnit and espec)
    * Go (gotest)
    * Python (nose, pytest, djangotest, djangonose)
    * JavaScript (jasmine, mocha)
    It also supports several execution strategies I have seen people use at
    * Dispatch
    * vim-tmux-runner
    * Tslime
    * tabs
    * neovim's native terminal
    * `:!`
    vim-test is extensible, both for additional languages/frameworks and for
    execution contexts. See:
    derekprior committed with geoffharcourt Feb 12, 2016
Commits on Feb 22, 2016
  1. Update copyright dates

    It's 2016.
    geoffharcourt committed Feb 22, 2016
Commits on Feb 14, 2016
  1. Set the default shell type to POSIX in vim

    If it can't be determined that a shell script is either `bash` or `ksh`, use `posix` as the default instead of plain `sh`. It seems unlikely that `/bin/sh` wouldn't be a POSIX-compliant shell on modern systems.
    See [`:help ft-sh-syntax`]( and [this thread on /r/vim]( for more info.
    This fixes the issue where `$(...)` syntax in shell scripts is highlighted as an error in vim.
    sharplet committed Feb 14, 2016
Commits on Jan 31, 2016
  1. Add support for ctags in Elixir

    Exuberant ctags has no native support for Elixir at this point. This
    configuration is sourced from
    derekprior committed Jan 29, 2016
Commits on Jan 11, 2016
  1. Globally ignore compiled Python files.

    The first time a `.py` file is run, or any time it's been modified, Python
    creates a `.pyc` file containing a bytecode representation.
    These bytecode files should always be ignored by Git, since keeping them
    updated in a repo would be time consuming and would serve no purpose.
    georgebrock committed Jan 11, 2016
Commits on Jan 8, 2016
  1. Add golang configuration samples

    Add suggested Go configuration for Vim into the `ftplugin` folder and
    the vim-go plugin. We may use this as a template for adding further
    language-specific settings in the future for languages that aren't
    universally used by the team.
    * `fatih/vim-go`: The de-facto Golang Vim plugin.
    * `softtabstop=2`: As a side effect of setting how "large" a tab is in
      insert mode, Vim is able to delete tabs with the backspace key in
      Insert mode.
    * `compiler go`: Necessary for plugins using the `make` command, such as
    * `listchars=tab:\ \ `: Don't highlight tabs as "»·" as if they were
      problem characters in go files. Also recommended for *sh files and any
      others which which should also be using tabs.
    * `go_fmt_command = "goimports"`: Tell vim-go to use the `goimports`
      command rather than `gofmt`, which attempts to find dependencies and
      adds them to your import statement.
    calebthompson committed Nov 13, 2015
Commits on Dec 19, 2015
  1. Better match the default behavior of ctrl-P when using ag

    When using ctrl-p without ag, the pattern given is not treated as a regular expression. Additionally, the value passed when first opening ctrl-p is not actually a valid PCRE regex, and produces an error when used on Windows. This modifies the options to treat the pattern as a string literal, not a regular expression, resolving the Windows problem, and better matching the behavior of ctrl-p without Ag.
    sgrif committed Dec 19, 2015
Commits on Dec 18, 2015
  1. Extract filetype-specific setups to ftplugin

    Vim's documentation advises that buffer-specific configuration based on
    a filetype should be performed via a file in `$HOME/.vim/ftplugin`:
    This change moves CSS/Sass-, Git commit message-, and Markdown-related
    editor settings into `ftplugin/gitcommit.vim` and
    `ftplugin/markdown.vim`, and rewrites those settings to avoid using
    `autocmd`, letting Vim execute `setlocal` when a file of the filetype is
    determined or set.
    geoffharcourt committed Dec 18, 2015
Commits on Dec 11, 2015
  1. Update `bin/replace` script for better portability

    The existing implementation of the `replace` script does not work on
    GNU/Linux due to differences in the implementation of `sed`. This change
    reworks the process of the replacement to create temporary files,
    apply the changes to the files, and then move them into place. It will
    improve the script's portability for more OSes.
    pedro-nonfree committed with geoffharcourt Dec 11, 2015
Commits on Dec 8, 2015
  1. Use one space, not two, after punctuation.

    When using a join command (`gq`, `J`), vim defaults to adding two spaces
    after '.', '?', and '!'.
    Setting `nojoinspaces` causes vim to only insert a single space.
    bernerdschaefer committed Dec 8, 2015
Commits on Nov 29, 2015
  1. Set `<leader>ct` shortcut to use Git ctags hook

    In cbdcbce we introduced a Tim
    Pope-inspired Git template scheme that automatically ran `ctags`
    asynchronously through a hook after certain source control operations.
    This hook is bypassed if a user uses `<leader>ct` to reindex their tags
    from within Vim.
    This change binds `<leader>ct` to use a Vimscript function that will
    identify if the `ctags` hook exists in the local repository and executes
    it. The function falls back to existing functionality if the hook does
    not exist. We are moving the function out of `vimrc` as a first step
    toward breaking our Vim configuration up by topic area.
    geoffharcourt committed Nov 29, 2015
  2. Run `db:test:prepare` task on `migrate` alias

    We removed `db:test:prepare` from the `migrate` alias in #260 because
    Rails 4.1 discouraged users from running the deprecated (at the time)
    Rake task. Rails brought back `db:test:load` in rails/rails#17739 due to
    user complaints about being unable to force a test database
    Without dropping and recreating the test database from scratch, the
    current migration strategy of solely using `db:migrate` and
    `db:rollback` will never bring changes into test from a migration that
    was run, rolled back, modified, and then re-run.
    Running `db:test:load` or `db:test:prepare` on each migrate operation
    has a small performance penalty, but the task is only being run when you
    have a reason to want to check or force a synchronization of the
    database. Knowing for sure that your test and development databases are
    at the same point in their evolution is worthwhile.
    Running `db:test:prepare` or `db:test:load` after running our existing
    migrate alias added just under 1.0 seconds on average to the migrate
    operation on an application with a reasonably sized DB schema.
    diff --git a/aliases b/aliases index 6a0f602..102caca 100644 ---
    a/aliases +++ b/aliases @@ -9,7 +9,7 @@ alias v="$VISUAL" alias
     # Rails
    -alias migrate="rake db:migrate db:rollback && rake db:migrate"
    +alias migrate="rake db:migrate db:rollback && rake db:migrate db:test:prepare"
     alias s="rspec"
     # Pretty print the path
    geoffharcourt committed Nov 29, 2015
Commits on Nov 16, 2015
  1. Remove Unused `move_to_front_of_path` Function

    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)
    reshleman committed Nov 16, 2015
Commits on Nov 14, 2015
  1. Add tab-completion with local branches for `git delete-branch`

    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.
    geoffharcourt committed Nov 14, 2015
Commits on Nov 13, 2015
  1. Don't export `$PS1`

    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.
    geoffharcourt committed Nov 13, 2015
  2. Use `export -U` to deduplicate `$PATH`

    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.
    geoffharcourt committed Nov 13, 2015
  3. Deduplicate `PATH` before exporting

    * 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.
    TheLonelyGhost committed with geoffharcourt Oct 26, 2015
Commits on Nov 6, 2015
  1. Add `ctags` support for `attr_` definitions

    This change adds `ctags` support for `attr_{reader,writer,accessor)` in
    Ruby files.
    teoljungberg committed with geoffharcourt Jun 5, 2015
  2. Split zsh configuration into smaller files

    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`
    mike-burns committed with Geoff Harcourt Oct 25, 2015
Commits on Nov 4, 2015
  1. Recognize JS Linter configuration files as JSON

    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.
    seanpdoyle committed Nov 3, 2015
Commits on Oct 30, 2015
  1. Update Bundler completion to include newer subcommands, fix help

    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
    geoffharcourt committed Oct 30, 2015
  2. Bring more shell syntax into shellcheck compliance

    **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
    geoffharcourt committed Oct 30, 2015
Commits on Oct 23, 2015
  1. Provide an example of specifying dotfiles dir

    * There can be confusion on how to tell `rcup` where local dotfiles
      have been installed.
    gylaz committed with geoffharcourt Oct 23, 2015
  2. Only colorize warning messages if stderr is a tty

    This is to avoid outputting ANSI escape codes to scripts and log files.
    mislav committed with Geoff Harcourt Oct 16, 2015
  3. Move broken OS X /etc/zshenv detection to post-up hook

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