dotfiles
rust.vim
Our great sponsors
dotfiles | rust.vim | |
---|---|---|
12 | 19 | |
117 | 3,450 | |
- | 1.9% | |
7.2 | 0.0 | |
14 days ago | 3 months ago | |
Vim Script | Vim Script | |
- | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dotfiles
-
would you use rust for scripting?
find-invalid-utf8: walks a directory tree and prints invalid UTF-8 in files using nice hex escapes with coloring. This is useful for honing on in where invalid UTF-8 occur. You have a good bet of finding some by checking out any moderately sized repository of code. The Linux kernel used to have some. The Mozilla repo does. The CPython repo does too. This is why it's important for CLI tools to deal with invalid UTF-8 gracefully in some way.
-
What are some less popular but well-made crates you'd like others to know about?
Yeah it's great! I used it to implement a little utility to convert a subset of SMS/MMS messages from an XML backup to a more readable plain text version: https://github.com/BurntSushi/dotfiles/blob/0b075d79a6ff8812a1f48a37b9858938b3eadc58/bin/rust/searchsms/main.rs
-
Ask HN: Can I see your scripts?
My dotfiles: https://github.com/BurntSushi/dotfiles
Here are some selected scripts folks might find interesting.
Here's my backup script that I use to encrypt my data at rest before shipping it off to s3. Runs every night and is idempotent. I use s3 lifecycle rules to keep data around for 6 months after it's deleted. That way, if my script goofs, I can recover: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
I have so many machines running Archlinux that I wrote my own little helper for installing Arch that configures the machine in the way I expect: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
A tiny little script to recover the git commit message you spent 10 minutes writing, but "lost" because something caused the actual commit to fail (like a gpg error): https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
A script that produces a GitHub permalink from just a file path and some optional file numbers. Pass --clip to put it on your clipboard: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae... --- I use it with this vimscript function to quickly generate permalinks from my editor: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
A wrapper around 'gh' (previously: 'hub') that lets you run 'hub-rollup pr-number' and it will automatically rebase that PR into your current branch. This is useful for creating one big "rollup" branch of a bunch of PRs. It is idempotent. https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
Scale a video without having to memorize ffmpeg's crazy CLI syntax: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
Under X11, copy something to your clipboard using the best tool available: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae...
-
Is it common for you guys to have an update break your system?
Otherwise, the most common "breakage" I get is when I forget to update in a while. Used to be a mostly non-issue until package signing became a thing. Now I get lots of signing errors when I update. When that happens, I run this script and it usually fixes things: https://github.com/BurntSushi/dotfiles/blob/2f58eedf3b7f7dae7f0a7cea1a641459e25e5d07/bin/pacman-fix-keys
-
Tauri reached 1.0
Sadly, at work, I can't use my own bespoke setup any more. I'm effectively forced to use GNOME, which has the same braindead support for multiple monitors that KDE has. These days, I just gave up on multiple monitors and work on my laptop in my sunroom at home. Back when I was in the office and using multiple monitors, it pretty much sucked, but I did write a little script that lets me at least move focus between monitors using my keyboard while respecting the window stacking order. I had intended to expand it with more stuff, but then COVID hit, my sunroom became my work environment and multiple monitors became a luxury I didn't care about any more. For work, anyway.
-
Fd: A simple, fast and user-friendly alternative to 'find'
The zsh builtin with a custom TIMEFMT: https://github.com/BurntSushi/dotfiles/blob/965383e6eeb0bad4...
-
Git ignores .gitignore with .gitignore in .gitignore
That's what I used to do, but I switched to Josh's strategy a couple years ago.[1] It doesn't "blow up" git-status. If some new piece of software creates a new directory with a bunch of random stuff in it, git-status will just show you the directory since it is is untracked, and not everything in it.
[1]: https://github.com/BurntSushi/dotfiles/blob/965383e6eeb0bad4...
-
archinstall is actually good
But I did that enough that I've scripted most of it: https://github.com/BurntSushi/dotfiles/blob/caed7921e48d112cc8932b33b81013fcbbcb2e08/bin/arch-install
-
What do you use for writing rust code?
For docs and license, see: https://github.com/BurntSushi/dotfiles/tree/master/.doc
This is why I kept mine private for so many years too. A bit ago, I cleaned house and published them: https://github.com/BurntSushi/dotfiles
rust.vim
-
Struggling to get basic diagnostic working with LSP
Coworker was getting syntax error without saving because of using https://github.com/rust-lang/rust.vim and not from lsp/rust-analyzer
If you need basic syntax checking on leaving insert mode (without saving file), https://github.com/rust-lang/rust.vim can be used
-
Is it possible to have Rust doc test comments highlighted in Neovim?
Seems like there's a tree-sitter solution, but I do want to note that this works out of the box with rust.vim: https://github.com/rust-lang/rust.vim/issues/63. It might be the built-in Rust support is out of date -- using that repo as a plugin would do the trick.
-
Default mappings override user mappings in Rust ( [[ and ]] mappings )
Most of the customizations in the $VIMRUNTIME's rust ftplugin are guarded behind a flag (g:rust_fold, g:rustfmt_autosave,g:rust_recommended_style, etc.) to control enabling and disabling them, but for some reason the navigation mappings are unconditionally defined, with no flag to turn them off... It might be worth going through the issues in https://github.com/rust-lang/rust.vim to see if that ever came up before.
-
Config For rust dev
Is having rust.vim necessary if I'm using rust-tools already?
-
Need help for setting up neovim.
Primeagen has a series, you could also try spacevim or lunarvim( i prefer lunarvim). If you want to read the docs and setup yourself 1. lsp and code completion mentioned in #5. 2. treesitter 3. lsp handles that, you have to install java's lsp, this improves its look. 4. Make your own remaps, some languages have a plugin for this but i can't find one for java, this is the one for rust. 5. Install cmp and one of the snippet engines.
-
Configure NeoVim for Rust Dev
As for plugins for Rust development, I’d recommend Conquer of Completion (using the coc-rust-analyser coc plugin), Rust lang’s rust plugin, and the Toml plugin
-
`:errorformat` for Vim + Rust
It seems, https://github.com/rust-lang/rust.vim already covers all that. Does your solution provide any advantage over the plugin?
-
What's the NeoVim feature/bugfix you're craving for?
Funny you should mention it, I wrote a complete syntax file for Rust with regex and didn't have much trouble with it. I personally think the :syntax API is awesome.
-
cargo-limit 0.0.9: Automatically jump to Rust compilation errors/warnings in Neovim
For other Vimmers on here who like using the quickfix list instead, as long as you have makeprg set (I use https://github.com/rust-lang/rust.vim and I believe it auto-sets that), you can just run:
What are some alternatives?
Clippy - A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
coc-rust-analyzer - rust-analyzer extension for coc.nvim
doom-emacs - An Emacs framework for the stubborn martian hacker [Moved to: https://github.com/doomemacs/doomemacs]
YouCompleteMe - A code-completion engine for Vim
rusty-tags - Create ctags/etags for a cargo project
vim-cargo - Rust Cargo command bindings
refactoring.nvim - The Refactoring library based off the Refactoring book by Martin Fowler
vscodium - binary releases of VS Code without MS branding/telemetry/licensing
Rustlings - :crab: Small exercises to get you used to reading and writing Rust code!
nvim-tree.lua - A file explorer tree for neovim written in lua
vim-racer - Racer support for Vim
emacs-ycmd - Emacs client for ycmd, the code completion system.