about summary refs log tree commit diff
path: root/src/etc/vim/ftplugin
AgeCommit message (Collapse)AuthorLines
2015-01-29Pull configs out into individual repositoriesSteve Klabnik-150/+0
As we grow, these don't belong in-tree. http://internals.rust-lang.org/t/moving-editor-highlighting-into-their-own-repos/1395 * https://github.com/rust-lang/rust.vim * https://github.com/rust-lang/rust-mode * https://github.com/rust-lang/gedit-config * https://github.com/rust-lang/kate-config * https://github.com/rust-lang/nano-config * https://github.com/rust-lang/zsh-config
2014-11-19Adding switch in vim plugin to toggle format optsjuxiliary-3/+4
2014-08-15vim: Don't set foldmethod in the syntax file eitherKevin Ballard-0/+14
We shouldn't be setting any settings in the syntax file. Better to put them in the ftplugin, where they won't be pulled in by :syn-include and can be cleaned up when changing the filetype.
2014-08-13vim: Stop setting conceallevel in the syntax fileKevin Ballard-0/+9
We shouldn't be setting conceallevel in the syntax file. Besides not being able to undo this if we switch to another syntax later, it also interferes with embedding rust in other filetypes (such as markdown). Instead, set it in the ftplugin, where it belongs.
2014-07-07Remove rust_colorcolumn, set textwidth to 99Kevin Ballard-21/+2
The latest change to aturon/rust-guidelines states that lines must not exceed 99 characters. This gets rid of the 80/100 split, so we don't need to customize colorcolumn amymore.
2014-07-07Set softtabstop, textwidth, and optionally colorcolumnKevin Ballard-3/+25
Setting softtabstop makes <Del> delete 4 spaces as if it were a tab. Setting textwidth allows comments to be wrapped automatically. It's set at 80, which is the recommended line length for Rust programs. There are suggestions that it should be 79, but our current style guide says 80 so that's what we're matching. A new setting g:rust_colorcolumn sets colorcolumn as well, to +1,101. This indicates both the textwidth and the second stricter line length of 100 that our style guide lists.
2014-07-04vim: set Rust tab conventionsKevin Ballard-0/+6
2014-06-18Add commands :RustEmitIr and :RustEmitAsmKevin Ballard-0/+8
2014-06-18Write documentation for the Rust vim pluginKevin Ballard-25/+2
2014-06-18Rename :Run and :Expand to :RustRun and :RustExpandKevin Ballard-16/+16
2014-06-18vim: Add :Run and :Expand commandsKevin Ballard-37/+73
Define a command :Run to compile and run the current file. This supports unnamed buffers (by writing to a temporary file). See the comment above the command definition for notes on usage. Define <D-r> and <D-R> mappings for :Run to make it easier to invoke in MacVim. Define a command :Expand to display the --pretty expanded output for the current file. This can be configured to use different pretty types. See the comment above the command definition for notes on usage. Create an autoload file and put function definitions there to speed up load time.
2014-02-27Fix Vim section movements for standard Rust style.Chris Morgan-2/+53
(Expressed another way: make `[[` et al. work with the curly brace at the end of a line as is standard Rust style, not just at the start is it is by default in Vim, from K&R style.) This came out of #11492, where a simpler but less effective technique was initially proposed; some discussion of the techniques, ways and means can be found there. There are still a few caveats: - Operator-pending mode behaves differently to the standard behaviour: if inside curly braces, it should delete up to and including the closing of the outermost curly brace (that doesn't seem to me consistent with documented behaviour, but it's what it does). Actual behaviour (the more logical and consistent, in my opinion): up to the start of the next outermost curly brace. - With folding enabled (`set fdm=syntax`), `[[` and `]]` do not behave as they should: the default behaviour treats an entire closed fold as one line for these purposes while this code does not (I explicitly `set nofoldenable` in the function—the side-effects are worse with folds enabled), leading to unexpected behaviour, the worst of which is `[[` and/or `]]` not working in visual mode on a closed fold (visual mode keeps it at the extreme end of the region line of the folded region, so it's always going back to the opening line of that fold and immediately being shoved back to the end by visual mode). - `[[` and `]]` are operating inside comments, whereas the standard behaviour skips comments. - The viewport position is sometimes changed when it should not be necessary.
2013-09-04Silence fo+=j error for users of Vim < 7.3.541.Chris Morgan-1/+3
2013-07-12Fix problem with switching between Rust buffers.Chris Morgan-1/+1
This was also causing trouble if one didn't have delimitMate installed.
2013-07-12Vim syntax: support lifetimes with delimitMate.Chris Morgan-1/+8
When it's a lifetime, a single quotation mark shouldn't have a matching single quotation mark inserted after it, as delimitMate does by default. Note that this is not without problems; a char literal coming after an odd number of lifetime markers will have its quotation marks behave a little strangely. That, however, is not my fault, but delimitMate's: https://github.com/Raimondi/delimitMate/issues/135
2013-07-11Fix comment indenting properly for Vim files.Chris Morgan-2/+13
Indentation now works correctly on subsequent lines of a multi-line comment, whether there are leaders (` * `) or not. (Formerly it was incorrectly doing a two-space indent if there was no leader.) By default, this no longer puts a ` * ` leader on `/*!` comments, as that appears to be the current convention in the Rust source code, but that can easily be re-enabled if desired: let g:rust_bang_comment_leader = 1
2013-07-10Add a Vim filetype plugin with useful tweaks.Chris Morgan-0/+25
This improves things like doc comment handling when you press Enter and making using `gf` or `<C-W>f` work on a `use x;` statement in the current directory.