Protect rust source files under ~/.rustup/toolchains/ with NeoVim

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/rust

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • GitHub repo vim-readonly

    :eyes: Automatically set readonly option on specific files

    _G.protect_rust_toolchain = function() -- protect rust source files under ~/.rustup/toolchains/ -- idea from https://github.com/Xvezda/vim-readonly/blob/master/plugin/readonly.vim -- and https://github.com/rust-lang/rustup/issues/2550 local rustup_toolchain_root = "" .. vim.fn.expand "~" .. "/.rustup/toolchains/" if string.match(vim.fn.expand "%:p", rustup_toolchain_root) ~= nil then vim.bo.readonly = true vim.bo.modifiable = false end end vim.api.nvim_command("autocmd BufReadPost *.rs lua protect_rust_toolchain()")

  • GitHub repo Rustup

    The Rust toolchain installer

    _G.protect_rust_toolchain = function() -- protect rust source files under ~/.rustup/toolchains/ -- idea from https://github.com/Xvezda/vim-readonly/blob/master/plugin/readonly.vim -- and https://github.com/rust-lang/rustup/issues/2550 local rustup_toolchain_root = "" .. vim.fn.expand "~" .. "/.rustup/toolchains/" if string.match(vim.fn.expand "%:p", rustup_toolchain_root) ~= nil then vim.bo.readonly = true vim.bo.modifiable = false end end vim.api.nvim_command("autocmd BufReadPost *.rs lua protect_rust_toolchain()")

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • GitHub repo nvim-config

    following HEAD (nightly build), for Linux only, clone it to `~/.config/nvim` (by ttys3)

    and the commit of my config here: https://github.com/ttys3/nvim-config/commit/9b0f8b2fdf8d8392e55b147e259c261991e761e9

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts