Commit graph

61 commits

Author SHA1 Message Date
Sean Doyle
4c68f6c819 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.
2015-11-04 07:55:46 -05:00
Derek Prior
6a034a7d65
Ignore "useless use of variable in void context"
The following ERB generates a "Possibly useless use of variable in void
context" warning from Syntastic:

```erb
<%= comment %>
```

The warning can be eliminated by making it:

```erb
<%= comment.to_s %>
```

However, this behavior is the default and is redundant. There are other
cases where this warning pops up and in each case I've found it to be of
no use.
2015-06-15 10:43:10 -04:00
Daniel Nolan
b0ab8136b6 Source matchit.vim from vim/macros directory
* After removing the matchit.vim plugin from the vimrc.bundles file in
  this pull request https://github.com/thoughtbot/dotfiles/pull/379. It
  was brought to my attention that plugins in the macros directory are
  not automatically loaded due to backwards compatibility issues.
* Add entry to vimrc to source the matchit.vim plugin from the macros
  directory, if the user does not have it installed already. This is how
  Tim Pope adds the matchit.vim plugin to vimrc in his vim-sensible plugin.
  https://github.com/tpope/vim-sensible/blob/master/plugin/sensible.vim#L88
2015-05-22 11:21:22 -07:00
Andy Waite
fc4f011862 Enable autocomplete with dictionary words
Enable autocomplete with dictionary words when
spell check is on.
2015-04-09 10:30:07 -07:00
Jessie A. Young
b3cb23830d Remove GitHub colorscheme
* Every time I pull updates from this repo into my own dotfiles, I have to
  reconfigure my preferred theme (solarized)
* Seems like there is not a majority or plurality of thoughbotters using a
  single colorscheme
* Easiest to just not specify a colorscheme
* See https://forum.upcase.com/t/why-is-the-default-vim-theme-on-dotfiles-is-github/4232
2015-03-18 10:16:39 -07:00
Derek Prior
cf624303b5
Let ctrl-p find files with a leading dot
I am constantly forgetting that I can't use `ctrl-p` to open
`.travis.yml` or any other file with a leading `.`. This change comes
about after some discussion in general on how to handle this. Passing
`--hidden` to the `ag` command allows it to find files with a leading
`.`.

Unfortunately, this also includes the content of your `.git`
directory. To overcome this, we add `/.git/` to `agignore`.
2015-03-13 14:17:51 -04:00
Josh Hartigan
e088612438 remove set nocompatible
It is not needed - see http://vimdoc.sourceforge.net/htmldoc/options.html#'nocompatible'
(or see :help 'cp')
2015-02-24 11:31:44 -08:00
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
1eff8c03ec
Spell check git commits 2014-11-03 15:45:55 -05: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
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
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
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
Robert Speicher
8aecd1f2ef Allow stylesheets to autocomplete hyphenated words 2014-07-20 19:43:25 -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
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
5f02a1d93d Run commands interactively from vim
This allows us to do things like:

    <Leader>r migrate
2014-04-25 14:49:37 -07:00
Derek Prior
0d749cad83 Enable shiftround
With `shiftround` enabled, using `>>` will indent the line to the next
multiple of `shiftwidth`. This is useful when you are indenting
improperly indented code.
2014-04-25 14:45:54 -07:00
Joe Ferris
c0284de226 Use default 'complete' Vim setting
Default setting is `.,w,b,u,t,i`:

* `.`: scan the current buffer ('wrapscan' is ignored)
* `w`: scan buffers from other windows
* `b`: scan other loaded buffers that are in the buffer list
* `u`: scan the unloaded buffers that are in the buffer list
* `t`: tag completion
* `i`: scan current and included files

The default setting is more likely to find a useful match, and modern
machines can search many open and unloaded buffers without pausing.
2014-04-03 11:52:04 -04:00
Greg Lazarev
69b0edc174 Remove leftover snippets variable 2014-03-28 07:27:40 -07:00
Joe Ferris
fefd1d4509 Only set nocompatible once as early as possible
* Setting nocompatible has side effects
* Setting it again (even if set) repeats side effects
* Settings like ruler will be reset if set again
2014-03-19 15:05:30 -04:00
Dan Croak
4f5a2edc33 Spell-check Markdown by type, not file extension
Previously, only `*.md` files would get spell-checking. This change adds
`*.markdown` and decouples Markdown spell-checking by file extension.

http://robots.thoughtbot.com/vim-spell-checking/
2013-11-22 16:01:48 -08:00
Joe Ferris
81a33f78d8 Set 'autowrite'
* Automatically :write before commands such as `:next` or `:!`
* Saves keystrokes by eliminating writes before running tests, etc
* See `:help 'autowrite'` for more information
2013-09-12 15:56:12 -04:00
Dan Croak
338cc0fb92 Allow backspacing over everything in insert mode
The previous setting frequently slowed my ability to edit.
2013-09-11 14:09:52 -07:00
Joël Quenneville
a4dff5ea80 Don't cache CtrlP results when using ag
It gets very annoying to manually force CtrlP to re-index every time I
add a new file. Since ag is so fast, we can turn off caching when it
powers CtrlP without any noticeable impact on search speed.
2013-08-23 17:28:03 -04:00
Dan Croak
c0a282f9a8 Remove redundant syntax highlighting
Newer versions of vim (such as 7.3.923) syntax highlight Rackup and JSON
files correctly. In the interest of keeping the dotfiles slim and our
machines up-to-date, I think the solution is to remove these from
dotfiles and install a newer version of vim in thoughtbot/laptop:

https://github.com/thoughtbot/laptop/pull/118
2013-07-29 14:14:27 -07:00
Dan Croak
989a49d2f0 Add syntax highlighting to certain file types
* Syntax highlight `Appraisals` as Ruby. Used especially for our open
  source libraries.
* Syntax highlight rackup (`config.ru`) files as Ruby. Used in all our
  Ruby web apps. Rails apps are rarely touched but some of the Sinatra
  and Middleman apps are occasionally edited.
* Syntax highlight JSON files as JavaScript. Used in our Trail Map.
2013-07-27 12:10:41 -07:00
Adarsh Pandit
a2d8383b6a Remove double escaped spaces in vimrc
* Bash users experience errors when using the double-escaped spaces for the CtrlP-SilverSearcher integration.

Thanks to @adamyonk for raising this issue
2013-06-24 09:55:32 -07:00
Adarsh Pandit
f854c8d8ef Use Silver Searcher as CtrlP backend
* Use `ag` as the find method for listing files in CtrlP Vim plugin
* ag indexes and searches far faster than the native engine
* ag also respects .gitignore files on on a per-directory basis, avoiding duplication
2013-06-21 15:18:20 -07:00
Derek Prior
8b7e4eefa7 Consolidate autocommands into the augroup
This makes it so resourcing the vimrc file doesn't duplicate the
auto commands.
2013-05-28 09:43:10 -04:00
Elliot Winkler
9a0c71eccf Add mappings to switch windows more succinctly 2013-05-15 10:27:49 -06:00
Derek Prior
341b7c93dd Add syntastic for syntax checking
* enable check on open: I want to know about any broken windows from the
  start.

* disable inline highlights: the line markers are sufficient.
2013-05-10 08:58:54 -04:00
Derek Prior
5fb405217a Don't remember cursor position for commit messages
It's not very useful to be dropped into the middle of your diff when
opening a new commit. This change prevents cursor position from being
restored for the `gitcommit` filetype.
2013-04-27 10:56:18 -04:00
Caleb Thompson
deb7ee5948 Move Bundles into a separate file
I've had this in [my own dotfiles] for a while now, and really like
having the separation of what I consider to be code/configuration from
what to me feels more like a Gemfile, in that it lists out all of the
external dependencies in a single place.

[my own dotfiles](https://github.com/calebthompson/dotfiles/blob/master/vim/vimrc.bundles.symlink)

* Awesomer vundle integration:
  * Refactor .vimrc and .vimrc.bundles to support standalone
    BundleInstall.
  * Install vim bundles as part of install.sh without sourcing the
    normal vimrc, which prevents error messages from uninstalled
    plugins referenced in the main vimrc.
2013-04-26 09:25:32 -04:00
Dan Croak
49f16b16c3 Bundle vim-ruby/vim-ruby
vim-ruby is where Vim's support for Ruby comes from - file type
detection, syntax highlighting, etc. Vim bundles vim-ruby, but the
GitHub project is always ahead of what's released with Vim.
2013-04-19 10:21:05 -07:00
Adarsh Pandit
d754170e4f Open new splits to the right/bottom
* Feels more natural than Vim's default
2013-04-14 09:14:25 -07:00
Caleb Thompson
739497840b Add vim-rspec mappings
Compliments https://github.com/thoughtbot/vim-rspec/pull/7
2013-04-12 11:45:16 -04:00
Greg Lazarev
7aac1f8e98 Remove --noheading flag from ag execution
The flag isn't needed, and seems to cause strange output.

Output with flag in vim:

app/models/group.rb|4| validates :yammer_group_id, :name, presence: true
||·
app/models/event.rb|24| validates :name, presence: ...

---

Output without:

app/models/event.rb|24| validates :name, presence: ...
app/models/event.rb|25| validates :name, length: ...
app/models/event.rb|26| validates :open, inclusion: ...
2013-04-09 14:47:43 -07:00
Dan Croak
b0ac70898a Use bundler.vim
Includes features such as:

* `:Bundle`, which wraps `bundle`.
* An internalized version of `bundle open`: `:Bopen` (and `:Bsplit`,
  `:Btabedit`, etc.).
* `'path'` and `'tags'` are automatically altered to include all gems
  from your bundle.  (Generate those tags with
  [gem-ctags](https://github.com/tpope/gem-ctags)!)
* Highlight Bundler keywords in `Gemfile`.
* Support for `gf` in `Gemfile.lock`, plus syntax highlighting that
  distinguishes between installed and missing gems.
2013-04-09 10:53:18 -07:00
Greg Lazarev
96249050bd Add a config line required by vundle 2013-04-08 23:29:14 -07:00
Greg Lazarev
a666267322 Move .vimrc.local to the bottom of .vimrc
Having this file be sourced last allows user to
overwrite the configs in `.vimrc` without having to modify it.

* fixed file's path to work with `filereadable`
2013-04-03 21:56:27 -07:00
Greg Lazarev
b9d216a7de Extract rspec vim bindings to thoughtbot/vim-rspec 2013-04-02 21:00:40 -07:00
Dan Croak
b0ab55d50d Rename current file in vim buffer
* Retain relative path.
* Save file.
* Do not keep old file open in buffer.

Usage:

    :e old_file_name.rb
    :Rename new_file_name.rb
2013-03-08 16:50:47 -08: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
Dan Croak
9f9a577408 Bundle Ctrl+P
Full path fuzzy file, buffer, mru, tag, ... finder for Vim.
https://github.com/kien/ctrlp.vim
2013-01-28 23:50:26 -08:00
Dan Croak
17b174e8fc Bundle Github color scheme
Fixes https://github.com/thoughtbot/dotfiles/issues/79
2013-01-17 21:53:33 -08:00
Joe Ferris
7adb1160a9 Easier editing for Markdown files
* Automatically enable spellchecking
* Automatically wrap at 80 characters
2012-12-05 13:00:34 -05:00
Dan Croak
80b77cdefc Run specs directly from vim
* Run current spec file.
* Run spec nearest cursor.
* Run last spec that was run.
* Convert s alias to s script, use Zeus if present.
2012-11-19 09:04:34 -08:00
Dan Croak
126344c3cb Install Vundle
* Set up Vundle in vimrc.
* Delete old copies of vim scripts.
* Bundles are automatically set up as referenced submodules.
* Ignore .netrwhist files given presence of submodules.
* Set up vundle in install script.
2012-11-16 10:00:33 -08:00