Commit graph

52 commits

Author SHA1 Message Date
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
Joe Ferris
84ce5cc1ba Improve Markdown integration
* Default Vim configuration detects .md files as modula
* Replaces default config so that .md is detected as markdown

Resolves #71.
2012-11-14 13:51:11 -05:00
Dan Croak
9b3e09e962 Switch between the last two files 2012-11-10 17:50:08 -08:00
Christian Schlensker
5a4eb4661b Implement a smarter tab completion function
Credit: Gary Bernhardt
2012-11-10 15:34:01 -08:00
Dan Croak
675f4d808a Map Leader to Space
Many others map Leader to ,. However, , is a built-in command which repeats the
last character find backwards, which can be quite useful.
2012-10-31 22:46:58 -07:00
Dan Croak
c7efed4f0c Fix tab completion
* Add mapping for tab completion so Ctrl+P isn't necessary.
* Add a mapping to re-index ctags quickly from vim.
* Add explaining comment to Tlist.
2012-10-24 21:36:56 -07:00
Gabe Berke-Williams
61222a432e Direct link to why we set noswap 2012-10-15 15:36:51 -04:00
Dan Croak
6c9bdf8f69 Tell vim to not create swap files 2012-09-22 19:32:22 -07:00
Dan Croak
de071e9c34 switch to github vim color scheme 2011-12-04 14:51:53 -05:00
Gabe Berke-Williams
d57e4509e9 Add :Cuc 2011-07-25 13:44:56 -04:00