Commit graph

428 commits

Author SHA1 Message Date
Geoff Harcourt
d874ae2cbc Remove outdated references to Rnavcommand
`Rnavcommand` has been removed from rails.vim. These commands don't work
if you are using a recent version of the plugin. Users who want to
regain this functionality can do it through projections.
2015-01-13 13:53:39 -05:00
Derek Prior
bbf920942f
Add alias for pretty-printing $PATH
I've had a number of issues with $PATH of late and I kept using this to
make it readable (and comparable).
2014-12-19 10:51:02 -05:00
Daniel Nolan
c0ca64b48a Replace kien/ctrlp.vim with ctrlpvim/ctrlp.vim
* kien has not commited to ctrlp.vim in over a year.
* Switch to ctrlpvim/ctrlp.vim since it is actively maintained.
2014-12-12 10:16:13 -05:00
Chris Toomey
fa18537afd Update tat script to also work from within tmux
The existing script would fail if run from within tmux as the default
behavior would cause a nested tmux session which is bad. This update
detects if the current context is within tmux and properly handles this
by creating a detached session and switching to it as needed.

The idea with this is for tat to behave correctly regardless of context,
which I believe this update achieves. Existing users and workflows all
work identically, but now this adds support for a workflow that remains
within tmux at all times.

I prefer to remain within tmux all the time, rather than falling back to
the shell, navigating to another directory, and then creating the
session from there. With this update, I split a pane in the current tmux
window, navigate to the directory for the new session, and use `tat` to
open (or attach) to the new-session without ever leaving tmux.

I actually [have a binding that I use for this][], `C-b` (I am
"breaking" out a new session), that is mapped to `bind C-b send-keys
'tat && exit' 'C-m'`, which also cleans up the pane.

The reason for wanting this workflow is I am pretty strict about keeping
a tmux session focused to a single project (~ maps to a git repo). I
regularly want to reference another app and will use this workflow to
quickly open that project in a new session.

A "detached" session is one which has no clients attached. [From the man
page entry][] for `new-session`: `The new session is attached to the
current terminal unless -d is given.` This essentially creates it in the
background, preventing nesting. Then the script can attach the current
client using the `switch-client` command.

[have a binding that I use for this]: 01cc928672/tmux/tmux.conf (L89)
[From the man page entry]: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux&sec=1
2014-12-09 13:06:49 -05:00
Brandon Cordell
cfcb8497bf Fix pre-commit, prepare-commit-msg hooks
For users who had not overridden the `pre-commit` or
`prepare-commit-msg` Git hooks,
they would see `git commit` hang,
with nothing happening.

The command would exit without going to their editor.

The bug was introduced in d7f194f94e
and the fix is to return a 0 exit code when the override is not present.
2014-12-05 11:35:15 -08:00
Dan Croak
d7f194f94e Add more Git hooks, delegate to .local convention
The `pre-commit` and `prepare-commit-msg` git hooks can be used
for some interesting things such as linting files.

For example, I need to format, vet, and lint Go files:

https://github.com/croaky/dotfiles/blob/master/git_template.local/hooks/pre-commit
https://github.com/croaky/dotfiles/blob/master/git_template.local/hooks/prepare-commit-msg

We've rejected Go-related pull requests to thoughtbot/dotfiles
due to not doing enough "official" Go work at the company.
This change helps me start with `.local` for now,
and then promote to "upstream" (thoughtbot/dotfiles) at some point
in the future if we do more "official" Go work.

I'm a believer in having linting done at VCS "commit time", either
locally in a pre-commit so I have a chance to fix things and not both my
teammates with linting issues, or at post-commit time via Hound comments
(also automated, but opportunity to ignore).

I've tried adding linting libraries to my editor, and found them too
slow, at least for Ruby. I've limited "editor-time" checking to just
syntax checking via Syntastic.

The downsides I see to adding linting to the test suite are:

* Style violations are not functional failures and logically shouldn't
  fail a build.
* Adding code coverage, linting, etc. to a test suite slows down the
  build.
* I only need to lint my diff (the commit), not the whole codebase, when I
  make changes.
* Style violations should not prevent a user-facing, production deploy.
* Adding linting to the test suite can slow that process down
  unnecessarily, particularly in continuous integration setups.

I see the appeal of linting in the test suite, particularly for
greenfield apps where we have total control, but I don't think it's a
practice that we can universally apply to our client projects who have
different deploy setups and existing codebases. So, I prefer the git
hooks + Hound approach as a pragmatic middle ground.
2014-12-02 21:49:53 -08:00
Dan Croak
782bcf7ddb Remove mention of Brewfile
It is no longer in our dotfiles.
2014-12-02 21:01:54 -08:00
Greg Lazarev
fe180f78d5 Fix typo in zshenv path 2014-11-14 13:08:16 -08:00
Daniel Nolan
be8e18a880 Revert adding /usr/local/bin to path in zshenv
* Adding /usr/local/bin to path in `~/.zshenv` causes it to be in my path twice one right after the other. /usr/local/bin is already added to the path in the correct order on OSX Yosemite by the /etc/paths file. 

* Remove /usr/local/bin from path export in zshenv
2014-11-14 11:16:46 -08:00
Chris Toomey
6fc3482610 Use POSIX compliant test command in git hooks
Ubuntu systems will error out on `[[` in shell scripts with `#!/bin/sh`
as the shebang.
2014-11-03 20:26:48 -05:00
Derek Prior
1eff8c03ec
Spell check git commits 2014-11-03 15:45:55 -05:00
Ian Zabel
f587e307e8 Revert "include, filter, user"
This reverts commit 383612ac4c.
2014-11-02 11:35:59 -05:00
Ian Zabel
383612ac4c include, filter, user 2014-11-02 11:33:26 -05:00
Derek Prior
de8543e54f
Add /usr/local/sbin to PATH
Some homebrew formulae, (e.g. [RabbitMQ][1]) link binaries here.

[1]: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/rabbitmq.rb
2014-10-28 22:25:22 -04:00
Robert Eshleman
a65b56ddcb Wrap at 72 characters for git commit messages
The body of a git commit message is conventionally ([1], [2]) wrapped at
72 characters. This commit adjusts .vimrc to automatically wrap the body
of git commit messages at 72 characters.

[1]: http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
[2]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
2014-10-27 12:19:03 -05:00
Eric Collins
a99fbb0f57 Ignore tags file, but not directories named tags 2014-10-24 15:38:05 -04:00
Mike Coutermarsh
cf10a8358f Updating readme to use thoughtbot/formulae
Brew bundle is deprecated. fixes #309
Removes Brewfile, no longer needed
2014-10-22 08:54:13 -07:00
Albert Arvidsson
2e3e64e9b9 Prevent evil nbsp from being invisible
Not seeing these can be problematic, since you won't know what broke your code on the day that one of them sneaks in.

Here's a few other common characters people use for this: https://github.com/search?utf8=%E2%9C%93&q=nbsp%3A+extension%3A.vimrc&type=Code&ref=searchresults
2014-10-22 08:51:47 -07:00
jake romer
635992e1e9 Include local gitconfig at the end of .gitconfig
Allows for customizing git's commit message template and overriding fetch.prune.
2014-10-18 21:43:16 -07:00
Mike Burns
c51b1e8c17
Fix the zsh config glob
The glob used a modifier, but it was modifying a directory instead of a
glob that matched all the files in the directory. Add the missing `*` to
fix this.
2014-10-03 10:28:08 -07:00
Derek Prior
b4b9168b19
Remove unused plugins after rcup
Running `rcup` should remove any plugins that are no longer in use. For
instance, we recently replaced `rename.vim` with `eunuch`. `rcup`
installs the new plugin but does not clean up `rename` from the plugins
directory. The addition of `PluginClean!` does this (without
confirmation).
2014-10-01 09:37:30 -04:00
Dan Croak
03dc6172f7 Use gh, not hub
[gh] is a [hub] reimplementation that's much faster and is now the official
Github CLI. It appears that "hub" is [deprecated].

[gh]: https://github.com/jingweno/gh
[hub]: https://github.com/github/hub
[deprecated]: github/hub#475

Matches thoughtbot/laptop:

d9a9dfe09b
2014-09-30 15:43:41 -07:00
Dan Croak
90f3b577e8 Document vim-mkdir in README 2014-09-30 09:31:48 -07:00
Greg Lazarev
85e9f22e48 Remove old doc directory
Resolves #276
2014-09-12 11:49:58 -07:00
Robert Speicher
6a1bd18a1f Add zshenv file
From the [Zsh manual](http://zsh.sourceforge.net/Intro/intro_3.html):

> '.zshenv' is sourced on all invocations of the shell, unless the -f option is
> set. It should contain commands to set the command search path, plus other
> important environment variables. `.zshenv' should not contain commands that
> produce output or assume the shell is attached to a tty.

Why is this important? [Alfred](http://www.alfredapp.com/) workflows run in
non-interactive shells. When the `$PATH` is set, or `rbenv` is initialized, in
`zshrc` instead of `zshenv`, those workflows will not use the correct Ruby
version and might not have access to certain bin files, such as those from
`$HOME/.bin/` or Homebrew.
2014-09-12 11:45:03 -07:00
Derek Prior
975cf7bc72
Force vertical diffs
Fugitive was updated to switch to horizontal diffs on narrow screens.
Everyone I've seen experience this behavior finds it disorienting. This
setting forces a vertical diff without users having to use different
shortcuts to enter diff mode.
2014-09-12 11:15:47 -04:00
Robert Speicher
c55d4ddff9 Change rename.vim to Tim Pope's vim-eunuch
Does what rename.vim does (`:Move` or `:Rename`) **plus**:

* Adds `:Unlink` or `:Remove` to delete the current buffer + file
* Adds `:Mkdir` (with no argument, create the current file's containing
  directory)
* Adds `:SudoWrite` if you forget to edit a file as root
* Automatically chmods a file to `+x` if it starts with `#!`
* Tim Pope! ❤️
2014-09-11 09:11:13 -04:00
Derek Prior
eb5fe555ae
Add vim-repeat plugin
Repeat.vim remaps `.` in a way that plugins can tap into it. With this
plugin you can, for instance, repeat commands from surround.vim.
2014-08-28 08:50:00 -04:00
Sean Doyle
cbdcbce01d Introduces git_template for init templating
Inspired by http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html

* Make `ctags` executable configurable
* Adds `git ctags`
* Runs `ctag` on `commit` / `branch` / `checkout`
* Extensible via `~/.git_template.local/hooks/{pre,post}-*`
* explain `git_template` under `git` section
2014-08-27 16:43:38 -04:00
Mike Burns
73497a7c54
Introduce ~/.zsh/configs
Just before loading `~/.zshrc.local`, load:

1. `~/.zsh/configs/pre/**/*`
2. `~/.zsh/configs/**/*` # excluding pre and post
3. `~/.zsh/configs/post/**/*`

About the zsh glob:

- `.`: only produce normal files.
- `-`: follow symlinks to their final file; skip any broken links.
- `N`: do not complain about zero matches.

Big ups to Pat Brisbin for finding `N`.
2014-08-27 17:47:26 +02:00
Eric Eslinger
a416222eb4 \unset QUIET is case sensitive 2014-08-14 15:33:59 -07:00
Tute Costa
876f375ce7 Revert "Add vim-multiple-cursors plugin for Vim"
This reverts commit 422a6f6d33.

Want to go through a PR cycle.
2014-08-12 13:55:48 -04:00
Tute Costa
422a6f6d33 Add vim-multiple-cursors plugin for Vim 2014-08-12 13:53:01 -04:00
Joshua Clayton
c17ff5ad37 Improve ag tab completion
* Remove unnecessary `uniq`
* Look for tags in tmp/tags or .git/tags
* Send errors to /dev/null if the file(s) do not exist

See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html for an
explanation behind the reasoning for .git/tags.
2014-08-06 15:51:18 -04:00
Geoff Harcourt
9a2cb782b1
Allow personal overrides to psqlrc
I wanted to add my own customizations after reading @mike-burns' post on
[`psqlrc`](http://robots.thoughtbot.com/an-explained-psqlrc).

As a result of this change, `.psqlrc` requires that a `.psqlrc.local`
exist in the home folder because `psql` cannot do conditional sourcing
of files in the style that we use in other foundation dotfiles. Touching
the file to ensure it exists (even if blank) prevents `psql` from
exiting with an error if the user does not provide their own custom
configuration.

Additional changes:
* Updating the documentation with regard to which files get excluded.
2014-07-30 10:46:25 +02:00
Dan Croak
49a4597dc4 Make it easy to checkout GitHub pull requests
This alias makes the following workflow possible:

Look at changes:

    git co-pr 123
    git diff origin/master

Bundle, validate tests are passing:

    bundle
    rake

Rebase interactively, squash, and potentially improve commit messages:

    git rebase -i master

Merge code into master:

    git checkout master
    git merge pr/123 --ff-only

Push:

    git push origin master

Clean up:

    git branch -D pr/123
2014-07-25 19:09:11 -07:00
Robert Speicher
0191762805 Update for Vundle's new interface
* Vundle now lives at gmarik/Vundle.vim

See https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L345-L369
2014-07-25 17:20:57 -07:00
Dan Croak
8a5ba82f4e Set Vim's spellfile to $HOME
Running `zg` adds words to the `spellfile`:

4f5a2edc33
http://robots.thoughtbot.com/vim-spell-checking

Setting the spellfile keeps it out of its default location, `vim/spell`, which
would otherwise be inside thoughtbot/dotfiles. We don't necessarily want to
share the `spellfile` across the team.
2014-07-24 07:48:27 -07:00
Ian C. Anderson
48873f79cb tat command now works in directories with periods
- Running `tat` in the robots.thoughtbot.com directory was throwing a
'bad session name' tmux error
- See http://sourceforge.net/p/tmux/tickets/109/
2014-07-22 20:58:15 -04:00
Greg Lazarev
f5dc48659f Add /usr/local/bin to PATH before /usr/bin
This is for homebrew binaries to work.

Load `rbenv` after adding `$HOME/.bin` and `/usr/local/bin` to `PATH`, but
before adding project-specific binstubs.
2014-07-21 09:59:32 -07:00
Robert Speicher
8aecd1f2ef Allow stylesheets to autocomplete hyphenated words 2014-07-20 19:43:25 -04:00
Sean Doyle
3cb5ef5ccb Adds vim-ruby back to vimrc.bundles
Removal in deb7ee5948
was accidental.

Also, removes `vim/bundle` directory as it is no longer useful to us, since
`vundle` creates it when it needs to.
2014-06-26 14:26:52 -04:00
Joe Ferris
d8003e654e Set Vim's colorcolumn to 80 characters
* We have an 80 character formatting limit
* This makes it obvious where that limit is
2014-06-20 16:55:28 -07:00
Greg Lazarev
49efda0d37 Add Shift+Tab map for tab complete in insert mode
Feature parity with `<c-p>` `<c-n>` tab completion duo.
2014-06-20 10:38:18 -07:00
Dustan Kasten
7c4a093ef6 tat: create tmux session if nonexistent 2014-06-16 10:20:16 -07:00
Jessie A. Young
b9d24c014a Remove Zeus and Cucumber references
* Spring is now built in to Rails:
  http://weblog.rubyonrails.org/2014/4/8/Rails-4-1/
* Haven't used Cucumber on a project in over a year
2014-06-06 16:01:37 -04:00
Rich Rines
0b5eca112a Remove test:prepare from migrate alias
* `rake db:test:prepare` has been depreciated in rails 4.1
2014-05-28 10:20:15 -07:00
Derek Prior
d8465b8c79 Have Syntastic ignore angular attribute warnings
The Syntastic HTML linter will warn on propriety attributes. The
likelihood that you *accidentally* typed "ng-repeat" is low. Let's just
assume you know what you're doing and ignore warnings about "ng-*"
attributes.
2014-05-15 11:40:18 -04:00
Dan Croak
7dbc8f44a1 Show only basename and git branch in prompt
* Switch order from "[git branch][pathname]" to "basename git branch %".
* Remove noisy brackets.

Example old:

    [master][~/dev/thoughtbot/dotfiles]

Example new:

    dotfiles dc-prompt %
2014-04-30 14:06:20 -07:00
Dan Croak
397155648d Fix out of date README on rake, rspec commands
`rake` and `rspec` commands that wrapped `zeus` were removed in 00dbd15.
2014-04-29 23:21:55 -07:00