Ah you may need to install vim-nox or similar. I would go the ST3 way actually anyway. Vim is great but you need to be using it all the time really, ST3 is more intuitive and probably as fast in many ways. I just like vim and am used to it so stuck in my ways a bit there. I have grown away from using the mouse while editing so that parts hard for me to get back used to. ST3 though seems the editor I would choose if I was not a vim user.
I’m between two stools as both a (past) regular vi user on *nix and various DOS/Windows IDEs. So I might persist a bit
That’s the spirit Your vim needs compiled with python. In ubuntu there are a few vim packages as there will be in debian I think. I used to have to compile it but you can probably comment out the YCM and Ultisnips as a work around just now (agree on the " as a poor comment char) .
Ok, working. Needed:
sudo apt-get remove vim
sudo apt-get install vim-gtk
sudo apt-get install python-dev
cd ~/.vim/vim-addons/github-Valloric-YouCompleteMe
./install.sh
So I now have a zillion plugins loading that I don’t know what they do, and Rust syntax highlighting with code completion
Thanks for your help, as always. Now back to reading about Rust…
I have to admit that I did not take the time to recount the numbers. the 560kloc was from an old count I ran on the testnet1 code, which indeed also counted all explicitly included third party headers and code that had to be compiled. The latest number of 7kloc of Rust was a rough estimate from about a week ago, and so that might indeed already have increased, so the relative margin here is bigger and volatile as it is under active expansion!
After using Sublime text, as an editor for rust, I switched to Atom (other text editors available ) Personal choice probably, but Atom is really nice.
It worked fine for me mark to detect rs
extension as Rust source files, maybe just try the following to confirm the extension lookup is associated correctly. Have any Rust source file open in ST3 and then go to:
View -> Syntax -> Open all with current extension as... -> Rust
It should be Ticked
, if not, tick it and it should sort the syntax highlighting issue hopefully.
ST3 also lets you run the basic cargo/rust build/test
commands from the editor itself. Tools -> Build (Ctrl + B) / Build With (Ctrl + Shift + B)
apart from that it’s just a matter of preference as to which plugins someone likes for ST3 from the package control.
That’s one lesson I’ve picked up: stop using search engines for finding the answers when it comes to Rust: the documentation is in the actual code base; and search engines ignore the versioning. It turns out for Rust to be far more efficient to simply clone the crate, read the code in your editor or do cargo doc
and read the version-corresponding documentation locally
Thanks @Viv. ST3 is usable as is - its either auto detecting or has switched default to Rust so no issue after all.
I found the tutsplus video tutorials helpful so far. I’ve also discovered F4/Shift-F4 for browsing build errors. Essential for non-geniuses ;-)!
@BenMS have not tried Atom but seen it is popular. In what ways is it better for you?
Note that (maybe already outdated) Racer, the auto-completion for Rust, is not yet up-to-the level of what one expects from an established code-completion. I actually turned it off, as it is distracting to see suggestions, especially if they are incorrect. It does not parse deep yet.
. full open-source, doesn’t ask for purchasing
. doesn’t create literally hundreds of tmp files lingering in your source folder (while also just perfectly preserving state)
. search actually searches by default through the actual project (thanks to the git integration probably), where-as in Sublime search searches through those files that are randomly opened tabs in one window.
. you can open a root folder and it presents the full crate folder as an equivalent to the project structure. Sublime at best shows a clumsy list of your open files as meaningless ‘groups’
. Atom is made by github, so it smoothly integrates with git and shows clearly which lines are edited, and committed etc
. finally, the tabs visually show clearly whether it’s saved or not; in sublime the unsaved file is hardly visibly marked.
So a bunch of subtleties that are very much personal, and no doubt another person will see the subtle pluses sublime has over atom. Just want to make it clear that there are other viable options
Thanks @BenMS. I really appreciate you taking the time to elaborate so clearly and will definitely give Atom a try for comparison!
Anyone (@Viv) want to summarise their perceived ST3 advantages over Atom?
This works if you know the library you want to use in advance. It doesn’t work if you want to know specifics on the language itself (lacking in many areas altogether, and currently requires trusting github comments sometimes), or the names of a library you know probably exists, but has a different name. I’m used to grepping source-code anyway, so perhaps I’ll just clone the entire project and launching grep at that.
I don’t think Rust has built-in “green” threads anymore. This is what I mean by the above statement, it existed at one point, appears to have been removed, but does it have a different name? The best I can tell the default libraries have no support for user-space threads, or have a name I cannot find.
I know people are in disagreement with user-space threads, since they don’t appear useful at first. But the latencies of a kernel-thread context switch, or even worse waking up a sleeping kernel-thread, is unbelievable at high data rates. I suspect there will eventually be support for user-space threads in Rust, even if at the community level like C++ has right now with boost::coroutine and soon to be boost::fiber (both of which may sneak into the core language). I’m also a fan of the ASIO duff device, but I don’t think Rust will support such sketchy switch behavior that C/C++ does (basically a sneaky goto).
@BenMS @dirvine @viv Now I’ve read enough Rust to try reading the MaidSafe Rust code… is there anything like context sensitive help for Rust libraries (or any of the Rust docs)?
How do you guys access Rust docs… command line grep, some fancy “man” tool, use a particular website… ?
Thanks
Perseverance is all it takes :- Join in and we will slag you, but you will learn as fast as we do, slagging each other!
Sorry, but I can’t find an appropriate definition for “slag” that lets me make sense of what you’re saying here. Help?
I think it means they’ll teach him what he needs to know, but I also get a slight feeling that there may be hazing involved
Then again, I’m from a different part of the world, so what do I know
Colloquial term for make fun of
. It’s a typical West of Scotland thing to make fun of folks as a way of getting more friendly. Self deprecating folks for sure so we make everybody self deprecating as well just to make it even
I"m familiar with the custom but wasn’t with the term.
Thanks.
We’ll have you speaking Scottish soon @fergish!