Commit graph

410 commits

Author SHA1 Message Date
Geoff Harcourt
6425042ee1 git: Use zebra for moved line colors
This change uses a git 2.15 feature to change the diff colors for lines
that have been moved rather than added or deleted. It provides a cue to
readers that a line's content has not changed.

Adding this setting in gitconfig should not break earlier git. (Tested
against 2.14 and the change had no effect.)
2018-01-03 16:45:22 -05:00
Andy Waite
3594ac5181 Use consistent syntax for tmux mappings
`bind` is effectively an alias for `bind-key`:

See https://superuser.com/questions/581939/on-tmux-what-is-the-difference-between-bind-and-bind-key
2017-12-28 12:55:23 -05:00
Geoff Harcourt
0786549686 merge-branch: exit 1 if origin and local differ
This change prevents chained commands from continuing execution if the
`git merge` is operation would be unsuccessful such as a common
operation when a feature branch is ready to be merged and pushed:

```
git merge-branch && git push origin
```

If the origin/master and the local master have any difference, we return
status 1 and stop execution rather then emit a false success.

h/t: @croaky

Fix #563.
2017-12-18 22:51:13 -05:00
Karun Siritheerathamrong
cad8f464e3 Use -g instead of --filename-pattern as Ag argument
This change undoes one of the two changes made in #564 so resolve an
issue for non macOS environments with Ag and ctrlp.
2017-12-18 22:39:38 -05:00
Bernerd Schaefer
06b4bf8c9c zsh: Allow prompt to be overridden
`zsh/configs/prompt.zsh` sets up the dotfile's custom prompt. It
currently does so in a way which prevents overriding the prompt for
specific invocations of zsh.

I noticed this because I've got a helper script for getting a shell
fully configured to work with the AWS CLI that ends with
`PS1='[aws] ' exec "$SHELL"` to distinguish the shell from other
sessions. With a vanilla zsh (and bash) setup, this correctly sets the
prompt on the new shell.

Here's a minimal demonstration with vanilla zsh:

```
bernerdscha-ltm% echo $PS1
%m%#
bernerdscha-ltm% PS1="hi> " exec zsh
hi>
```

And with dotfiles:

```
dotfiles bs-override-ps1 % echo $PS1
${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m"}%{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info) %#
dotfiles bs-override-ps1 % PS1="hi> " exec zsh
dotfiles bs-override-ps1 %
```

This PR updates prompt.zsh to only update the prompt if there's not an
existing exported PS1 variable. The export check is relevant because in
the default case where PS1 is not explicitly set  by the user it will
have already been set (but not exported) by the default zsh configs.
2017-12-06 10:24:13 -05:00
Derrick Carr
b860504752
Revert accidental merge from fork (#571)
This reverts two commits that were accidentally merged from a fork.
- commit c3180360ac
- commit ccb51c97c6
2017-11-17 16:36:59 -08:00
Derrick Carr
c3180360ac Use ASDF for version management
ASDF manages languages versions for many languages instead of just one.
This commit adds ASDF to path and completions for zsh, so that it's
easier to use.
2017-11-17 14:44:00 -08:00
Derrick Carr
ccb51c97c6 Make tmux splits oen in working directory 2017-11-17 14:44:00 -08:00
Andy Waite
113ddba054 Use long options for when calling ag for CtrlP plugin 2017-11-05 20:39:53 -05:00
Geoff Harcourt
c0317cedb0 Remove Vundle shim and deprecation warning
We've been using vim-plug over Vundle since 5724d12 (April 2015). Users
have had long enough to migrate their `vimrc.bundles.local` to use
vim-plug's `Plug` command.
2017-10-06 13:12:45 -04:00
Nhut Duong
e52c274215 Use exclude pattern with RCRC variable 2017-10-05 21:19:05 +07:00
Nhut Duong
a6a572d328 Exclude README in Spanish with RCRC variable 2017-10-05 10:22:36 +07:00
Ali-Akber Saifee
706c968a26 Update link to maintained Ctrl-P fork 2017-10-04 09:28:26 -04:00
Horacio Chavez
49d89bec0e Adds README in Spanish 2017-09-28 09:19:32 -04:00
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
Derek Prior
346268b6e7 Add deprecation 2017-09-15 14:36:21 -04:00
Derek Prior
3d11861f82 Use ASDF for version managment
ASDF has plugins for Ruby, Node, Elixir, Haskell, Scala, Go, etc.
Instead of finding and installing a new tool each time we have need for
a version manager in a new tools, we can use the same tool we already
know, adding a new plugin.

This change is the result of a successful [research card][1] and has a
corresponding change to [laptop][2].

[1]: https://trello.com/c/MVbfz8e5/676-asdf-for-tool-management
[2]: https://github.com/thoughtbot/laptop/pull/502
2017-09-15 14:36:21 -04:00
Greg Lazarev
b5c26215a1
Add export to support Elixir/Erlang history
[Sourced from this](https://til.hashrocket.com/posts/is9yfvhdnp-enable-history-in-iex-through-erlang-otp-20-)
2017-08-29 10:04:28 -07:00
Chris Toomey
bc047365f5 Add a specific "Update" section to the README
Thanks to rcm and the `post-up` hook file, the dotfiles do a great job
of keeping things up to date.

This change adds a bit of detail and specificity to the README around
updating, specifically clarifying the need to run `rcup` after pulling
to link new files and install new vim plugins.
2017-08-28 09:13:07 -04:00
John Eckhart
f4d509ffd0 Skip compiled wordcode files (ie. zwc extensions) 2017-08-25 15:35:02 -04:00
Frank Loesche
d6014c3a60 fix #524, update plugins
* if .vim/autoload/plug.vim already exists, then use PlugUpgrade to get
  the newest version. This should fix #524.
* change from PlugInstall to PlugUpdate which doesn't just install new
  plugins but also updates existing ones.
2017-08-25 15:23:25 -04:00
Sean Doyle
384d4ad5e6 Add bin/git-trust-bin command
To [append a project's local `bin/` directory to `$PATH`][dotfiles],
the dotfiles check for the existence of a special directory: `git/.safe`.

This commit is inspired by [thoughtbot/suspenders#837][#837]:

> The idea behind the .git/safe is that I run it manually and explicitly
> after I trust the directoy and the team behind the project.

> Creating it as part of the setup script defeats the point of that. Doing
> so without explcitly telling the user comes across as sneaky, perhaps.
> (I do expect all devs to read setup scripts before running them -- but I
> also know that they do not!)

> Switch this script to inform the user that they have no `.git/safe`
> directory but might like to make one.

Since suspenders may no longer mark projects safe by default, this
commit introduces the `git trust-bin` command to do so.

[dotfiles]: af75a673b1/zsh/configs/post/path.zsh (L9-L10)
[#837]: https://github.com/thoughtbot/suspenders/pull/837
2017-08-25 09:28:16 -04:00
Derek Prior
e0ff6ef15f
Move definition of has_async
We have an rcm `post-up` hook that installs plugins after running
`rcup`. It does this by directly loading the `.vimrc.bundles` file,
which means our regular `.vimrc` file is not sourced. This lead to
`has_async` being undefined.

By moving the definition into the `vimrc.bundles` we ensure it's
available when that `post-up` hook runs. It remains available when
needed in `vimrc` because we use it there *after* sourcing the bundles.
2017-08-10 09:35:50 -04:00
Derek Prior
7593dafebb
Require Vim 8 or NeoVim
Now that we're using `ALE`, we're making use of the async features
available in Vim8 and NeoVim. If you try to use these dotfiles on Vim 7,
you'll get a host of errors from ALE.

This change does two things:

1. It writes an error when starting in an unsupported vim version.
2. It skips loading ALE in those versions.

The thinking behind the second change is to leave vim in a more usable
state with minimal annoyance after the initial error.
2017-08-10 00:27:18 -04:00
Derek Prior
8ac75ba56b
Replace Syntastic with ALE
ALE is an Asynchronous Linting Engine which works with Vim 8 and NeoVim
to lint your code "as you type". It does so without blocking the main
thread by using the asynchronous features of both of those Vim versions.

A number of us in Boston have been using ALE for some time now with
great success. The asynchronous nature means linting does not block
other interactions with Vim and it's been nice to get linting feedback
more often than buffer write.

Many of us find the "as-you-type" linting to be performant enough to
actually be a distraction, so this PR tones that down some. With this
configuration, ALE will lint on cursor hold durations of 1 second and
when leaving insert mode in addition to buffer write, buffer read, and
file type change.
2017-08-06 10:33:48 -04:00
Riley Dallas
af75a673b1 Capitalize l in leaders 2017-06-19 12:53:17 -05:00
Geoff Harcourt
0078865a67 Revert "Skip compiled wordcode files (ie. zwc extensions)"
This reverts commit 5178a8a1a8.
2017-05-25 13:10:02 -04:00
Geoff Harcourt
88618e5858 Revert "Combine conditional statements"
This reverts commit cae0bd04ea.

This implementation appears to break sourced configurations. Reverting
until we figure out a resolution.
2017-05-25 13:04:30 -04:00
John Eckhart
cae0bd04ea Combine conditional statements 2017-05-23 16:29:16 -04:00
John Eckhart
5178a8a1a8 Skip compiled wordcode files (ie. zwc extensions) 2017-05-22 02:19:20 -04:00
Geoff Harcourt
592249def2 Merge pull request #523 from thoughtbot/replace-coffee-with-java
Add JavaScript syntax highlighting
2017-05-08 16:06:55 -04:00
Geoff Harcourt
06197218c7 Don't rely on Bash in post-up hook
In 16219a31db we implemented a post-up
hook that checked for a problematic `/etc/zshenv` file. OSX/macOS has
changed the file responsible for executing `path_helper` and loading the
system paths multiple times, and this script change issued a warning to
users if `path_helper` might be called in such a way that their paths
could be unexpectedly reordered.

The script used colored output to highlight this problem for the user,
and relied on Bash's script path introspection (through `$BASH_SOURCE`)
to print the location of the `post-up` hook to assist the user in
troubleshooting and understanding where our warning came from.

This change removes the hook's reliance on GNU Bash in favor of `sh`. It
uses the POSIX-compliant `$0` to determine the hook location (this
method is less robust than Bash's `$BASH_SOURCE`, but is available in
all POSIX shells) and removes colored output in the warning to be
compatible with shells that don't support colored output.

Fix #517.
2017-05-08 16:06:01 -04:00
Dan Croak
bab2ddc9f0 Add JavaScript syntax highlighting
It seems like JavaScript/ES6 is becoming more common for us to run into
in the wild compared to CoffeeScript
with the advent of Babel / transpiling.

Eventually, we'll probably want to remove kchmck/vim-coffee-script.
Users working on CoffeeScript applications would need to move that
plugin into their personal dotfiles.
2017-05-08 10:36:07 -07:00
Geoff Harcourt
336a282602 Run reset in post-up hook to fix terminal issue
Some tmux users have reported that when running `rcup` that during the
post-up hook Vim would issue errors about input not coming from a
terminal and then the terminal would look and behave unexpectedly.

Running `reset` after the Vim plugin install step in `post-up` appears
to resolve the issue.

Fix #516.
2017-04-28 16:31:25 -04:00
Geoff Harcourt
3bbab420bc Allow user to ignore some default vim plugins
The `UnPlug` command allows a user to remove a plugin from vim-plug's
list of plugins to install/activate. This command can be used to
selectively ignore shared plugins from `vimrc.bundles` without needing
to overwrite the entire file with a personal replacement.

This change is dependent on vim-plug continuing to use the `g:plugs`
global variable.
2017-04-28 14:54:44 -04:00
Matthew Sumner
b9b9e7db8c Unbind the shortcut for suspend-client
Why:

I occasionally will try to zoom in on a pane with the key combination of
C-s then z. However, instead of having the agility to remove my finger
from the ctrl key, I clumsily continue to have it depressed while
applying pressure to the z key. This results in the `suspend-client`
command being executed by tmux. I am then left not knowing what to do
and I can't reattach to the session the that terminal window. It's very
disconcerting and I wish it hadn't happened.

This PR:

Removes the binding for `suspend-client`.
2017-04-28 14:41:57 -04:00
Dan Croak
be8e5e58aa Remove gvimrc
This originally came from jferris/dotfiles,
the parent of thoughtbot/dotifles.

I'm not a Vim GUI user.
Are others at thoughtbot also shell Vim users?
2017-04-26 20:53:26 -07:00
Dan Croak
8fbef47fda Remove git churn command
I added this four years ago but haven't been using it.
Not common enough to be included in company-wide dotfiles?
Can move to personal dotfiles if desired.
2017-04-25 22:19:45 -07:00
Rootul Patel
09d54d448c README: Make customizations in ~/dotfiles-local 2017-03-24 13:46:32 -04:00
Tyson Gach
9ea82e8f58 Update thoughtbot logo 2017-03-10 09:39:51 -05:00
Stephanie Viccari
5ed9e4aa73 Add support for Elixir and EEx syntax highlighting 2017-02-21 10:31:52 -05:00
Geoff Harcourt
2fa36ccf9d Revert "Explicitly specify no input from terminal in post-up hook"
This reverts commit 99a18f6dbe.

Users reported problems after this change, so I'm pulling it.
2017-01-24 10:39:58 -05:00
Geoff Harcourt
99a18f6dbe Explicitly specify no input from terminal in post-up hook
This change prevents the `post-up` hook from breaking the terminal for
the rest of the session when running `rcup`. Since the session is
completely automated, we don't need input from the terminal once Vim
launches.
2017-01-19 18:04:14 -05:00
David Thompson
5eff1d7afb Move aliases below local config
Enables overriding of aliases that environment variables
2017-01-19 18:03:30 -05:00
Brad Urani
cfd26ef6aa Add pre-push git hook 2017-01-19 17:59:49 -05:00
Geoff Harcourt
e51d8b73f0 Add ag mappings in vim
https://robots.thoughtbot.com/faster-grepping-in-vim

- Create an `:Ag` command if none is defined.
- map `\` in normal mode to set up the command for an argument
2016-07-22 13:17:32 -04:00
Robert Speicher
c0717e7bd7 Use "absolute" paths for agignore
This seems to resolve an issue where CtrlP would randomly return "NO
ENTRIES".

See https://forum.upcase.com/t/ctrlp-sometimes-displays-no-entries/5658

This also sorts the paths alphabetically, because OCD. 🎉
2016-07-22 09:46:24 -04:00
Geoff Harcourt
85b11b6583 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
`.rcrc`.

Close #488.
2016-06-28 12:10:01 -04:00
Mike Burns
a1a9f6d694
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
tar`.
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.
2016-06-10 14:56:43 +02:00
Ian Zabel
40ccf0f3f8 Configure basic ctags for javascript projects
There are, apparently, more things we need to configure. @BlakeWilliams shared
http://dance.computer.dance/posts/2015/04/using-ctags-on-modern-javascript.html
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.
2016-06-08 09:53:22 -04:00