about summary refs log tree commit diff
path: root/src/etc/vim
AgeCommit message (Collapse)AuthorLines
2014-07-16auto merge of #15476 : kballard/rust/more_vim_tweaks, r=chrisbors-7/+31
Tweak the text editing settings (softtabstop, textwidth, etc). Add some settings to turn on folding and colorcolumn. Add the undo_ftplugin changes that my previous patch forgot.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-07-07Remove rust_colorcolumn, set textwidth to 99Kevin Ballard-27/+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-4/+32
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-07Define a new setting g:rust_foldKevin Ballard-3/+24
g:rust_fold allows folding to be enabled. This lets the user turn on folding without having to define autocommands.
2014-07-07librustc (RFC #34): Implement the new `Index` and `IndexMut` traits.Patrick Walton-1/+1
This will break code that used the old `Index` trait. Change this code to use the new `Index` traits. For reference, here are their signatures: pub trait Index<Index,Result> { fn index<'a>(&'a self, index: &Index) -> &'a Result; } pub trait IndexMut<Index,Result> { fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } Closes #6515. [breaking-change]
2014-07-04vim: set Rust tab conventionsKevin Ballard-0/+6
2014-07-01Vim syntax file types and traits cleanupAlexandre Gagnon-15/+20
2014-06-24auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brsonbors-2/+1
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362 --- Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-22Update few files after comparison traits renamingPiotr Jawniak-2/+2
There were still Total{Ord,Eq} in docs and src/etc
2014-06-18Vim: highlight invalid characters in char literals.Chris Morgan-2/+7
2014-06-18Vim: highlight escapes for byte literals.Chris Morgan-7/+11
2014-06-18Add commands :RustEmitIr and :RustEmitAsmKevin Ballard-0/+62
2014-06-18Write documentation for the Rust vim pluginKevin Ballard-25/+131
2014-06-18Rename :Run and :Expand to :RustRun and :RustExpandKevin Ballard-17/+17
2014-06-18vim: Add :Run and :Expand commandsKevin Ballard-37/+265
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-06-16Add a Syntastic plugin for Rust.Andrew Gallant-0/+57
2014-06-16rustc: Start accepting `*const T`Alex Crichton-2/+1
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-1/+1
[breaking-change]
2014-05-20vim: Handle box expressions speciallyKevin Ballard-7/+20
Attempt to highlight the placement expression in a `box (expr) foo` expression. Also treat GC as a keyword within the placement expression. This doesn't work correctly for arbitrary expressions. Notably, this makes no attempt at balancing delimiters. I believe handling that will require rewriting the syntax rules to add a region for every pair of delimiters. That may be a desirable thing to do in the end, because we can then rewrite our indent rules based on the syntax and get rid of cindent(), but for the time being, we'll just live with the limitation.
2014-05-20Update rust.vim for the latest prelude/keywordsKevin Ballard-18/+23
2014-05-08vim: Fix an indentation issue with cindentKevin Ballard-11/+16
cindent handles the following case incorrectly: impl X { b: int, // c: int, } if you try and insert a new line after the `c` declaration. To fix this, fix the get_line_trimmed() function to work properly, and then extend GetRustIndent to keep searching backwards until it finds a non-blank line after trimming. This lets it handle the trailing comma case properly, as if the comment were never there. Fixes #14041.
2014-05-06etc: Add box as a keyword to editor configsAlex Crichton-1/+1
This keyword is about to be used much more often than it was a few weeks ago, it's time to tell editors about the new keyword.
2014-05-04vim: Fix indentation at global scope after non-semantic ([{/)]}Kevin Ballard-3/+19
If an unbalanced [ exists in a string or comment, this should not be considered when calculating the indent at the top level. Similarly, when testing for ({/}) to see if we're at the top level to begin with, strings and comments should be skipped.
2014-04-24Fix Vim indent regressions from #13600.Chris Morgan-1/+1
The change in #13600 was incorrect, containing a bad regular expression; inside an indent function, errors are silently ignored (and the ``~=`` operation will return 0), so it just always failed, causing the cases that were supposed to be caught to not be caught and making things like the ``match`` example shown above or struct field definitions regress. I have fixed the regular expression to what it should have been. This is still imperfect, of course, not handling cases like where the first argument to a function is a function call (``foo(bar(),``), but it'll do for now.
2014-04-19auto merge of #13609 : richo/rust/str-type-vim, r=alexcrichtonbors-1/+1
It seems really weird to me when StrSlice and str highlight sanely, but StrBuf doesn't. I think I added it to the right place.
2014-04-18vim: Add StrBuf as type to hilightingRicho Healey-1/+1
2014-04-18Add another case where cindent is correctBrandon Waskiewicz-0/+11
When calling a function, or anything with nested parens, default to cindent's indent. The least error-prone way I could think of identifying this is to look for a line that ends with a ',', as well as a non-zero number of any character except parens before the comma, and then an open paren. This will overlap with the previous rule accounting for function definitions, but that should be fine because it is also using cindent.
2014-03-30Support new attribute syntax in vim syntax fileSteven Fackler-1/+1
2014-03-28Remove `Freeze` and add `Share` in vim's syntaxFlavio Percoco-1/+1
2014-03-28Rename Pod into CopyFlavio Percoco-1/+1
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-20rm obsolete references to `DeepClone`Daniel Micay-1/+1
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-1/+1
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-01Merge pull request #12308 from kballard/vim-nested-commentsbors-5/+6
vim: Tweak how comment nesting works Reviewed-by: brson
2014-02-27Update Vim syntax file last change date.Chris Morgan-1/+1
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.
2014-02-27Update prelude items in Vim syntax.Chris Morgan-20/+9
2014-02-27Downgrade `do` to a reserved keyword in Vim.Chris Morgan-2/+2
This means it gets highlighted as Error by default.
2014-02-27Highlight the `mod` in `extern mod x;` as Error.Chris Morgan-1/+3
Just like the bare keyword `crate` is highlighted as Error (a little dubious, actually, given macros), `mod` is invalid after `extern`: it's obsolete syntax.
2014-02-24vim: Tweak how comment nesting worksKevin Ballard-5/+6
Don't try to match line comments inside of a comment block. That makes no sense and can highlight differently for people who override their highlights. Similarly, don't match a doc-comment inside of a comment block. It shouldn't be highlighted differently unless it's actually a doc-comment (and nested comments are obviously not doc comments). Fixes #12307.
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-1/+0
2014-02-22Move std::num::Integer to libnumBrendan Zabarauskas-1/+1
2014-02-17auto merge of #12321 : bjz/rust/remove-real, r=alexcrichtonbors-1/+1
This is part of the effort to simplify `std::num`, as tracked in issue #10387. It is also a step towards a proper IEEE-754 trait (see #12281).
2014-02-17Remove Real trait and move methods into FloatBrendan Zabarauskas-1/+1
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-17Remove CloneableTuple and ImmutableTuple traitsBrendan Zabarauskas-4/+0
These are adequately covered by the Tuple2 trait.
2014-02-14Add CheckedDiv to vim syntaxKevin Ballard-1/+1
2014-02-14Update vim syntax for extern crateKevin Ballard-2/+9
2014-02-07Delete send_str, rewrite clients on top of MaybeOwned<'static>Kevin Ballard-2/+1
Declare a `type SendStr = MaybeOwned<'static>` to ease readibility of types that needed the old SendStr behavior. Implement all the traits for MaybeOwned that SendStr used to implement.
2014-01-29auto merge of #11672 : bjz/rust/remove-times, r=brsonbors-1/+0
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal (which I liked) was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-30Remove Times traitBrendan Zabarauskas-1/+0
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.