Commit graph

15 commits

Author SHA1 Message Date
Brad Urani
4fa7cd6f4b Filter commented lines out of .env in envup
Makes envup filter out comments in the .env file even if the line starts
with whitespace
2017-09-26 17:14:04 -04:00
Robert Eshleman
bd3c5daf7f 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]: https://github.com/thoughtbot/dotfiles/pull/440#issuecomment-156549420
2015-11-16 15:26:41 -05:00
Geoff Harcourt
6cc0cb9302 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.
2015-11-14 10:15:24 -05:00
David Alexander
f7c73f7c1b Deduplicate PATH before exporting
Why:

* Remove dupes from PATH

How:

$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.
2015-11-13 15:25:55 -05:00
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
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
Derek Prior
00dbd15af6 Remove functions wrapping Zeus
Project should be moving over to spring, as this is the 'blessed'
approach and is part of suspenders. Leaving these functions around adds
yet another layer of indirection to consider when trying to run these
commands:

* function wrapper
* binstub
* rbenv shim
* actual binary
2014-04-18 17:06:22 -04:00
Chris Toomey
655a76a6c1 Add envup script for loading environment variables 2013-09-13 15:29:18 -04:00
Gabe Berke-Williams
89b60fcb49 g alias for git
With arguments, g acts like git.
Without arguments, it runs `git status`.

* Source functions/* after loading ZSH completion so `compdef` is available to g
  alias
2013-03-03 17:14:16 -05:00
Dan Croak
aa31dd7ad3 Add change-extension script
Add ability to change file extensions of files recursively in current
directory.
2013-02-14 11:05:26 -08:00
Dan Croak
bc6d3e6202 Make directory and change into it 2013-02-12 10:22:27 -08:00
Dan Croak
64e3c09e51 Pass arguments from rake shell function when not using zeus
Non-zeus path didn't pass arguments, so it just ran `rake`.
2013-02-12 10:10:04 -08:00
Joe Ferris
81d40fe855 Pass arguments from rspec shell function when not using zeus
* Non-zeus path didn't pass arguments, so it just ran `rspec`
2013-01-21 10:49:12 -05:00
Dan Croak
0d43fe5246 Use Zeus via aliases, rake
* Create `rake` function and `rk` alias.
* Add `z` alias for `zeus`.
* Alias `migrate` to `m` given how common a task it is.
2013-01-21 06:43:30 -08:00
Joe Ferris
6603b694b0 Replace s shell script with rspec shell function and alias
* Use a regular alias to make `s` short for `rspec`
* Use an `rspec` shell function to route to zeus when appropriate
* Removes confusion from `s` working differently than `rspec`
* Removes need to use a special alias to get zeus working
2013-01-18 13:24:53 -05:00