Commit graph

10 commits

Author SHA1 Message Date
Mike Burns
31b6ad4f3f 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
precisely:

- Load `.zsh/functions/*`. This could instead be replaced with: `mv
  .zsh/functions/* .zsh/configs`.
- Load `.aliases`. This could instead be replaced with: `mv .aliases
  .zsh/configs/aliases.zsh`.
- 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`
2015-11-06 15:03:05 -05:00
Geoff Harcourt
219079887c 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
a59f5c3a0a/src/_bundle
2015-10-30 15:11:19 -04:00
Geoff Harcourt
21830dd035 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

[guide]: https://github.com/thoughtbot/guides/tree/master/best-practices
2015-10-30 12:50:02 -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
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
Derek Prior
294f962f95 Complete parity commands like heroku
Adds tab completiong to `production` and `staging` which acts as tab
completion to heroku.
2014-01-23 18:35:34 -05:00
Greg Lazarev
59bdc8d237 Don't use suffix flag for zsh compadd command
* Fixes an issue where tab completing specs that start with the same
words(s) makes tab completion freak out and stop working.

* The con is that we'll see "_spec.rb" in the output, like:

```zsh
$ rspec spec/models/
models/calendar_spec.rb
models/event_closer_spec.rb
...
```
2013-04-19 12:12:42 -07:00
Gabe Berke-Williams
1f4e6d1370 Use ag instead of ack
https://github.com/ggreer/the_silver_searcher

* ag is faster than ack
* ag searches all files by default (but still ignores gitignored files). This
  removes the need for ack's `--type-add=` options.
* The command is 33% shorter than ack!
2013-03-01 23:28:36 -05:00
Joshua Clayton
d16a4fe36c Tab-complete ack by looking at the tags file 2012-09-27 08:28:13 -04:00
Joe Ferris
a95b1f7242 zsh config 2011-01-13 17:26:04 -05:00