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

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • vim-readonly

    :eyes: Automatically set readonly option on specific files

  • _G.protect_rust_files = 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 protect_dirs = { "" .. vim.fn.expand "~" .. "/.rustup/toolchains/", "" .. vim.fn.expand "~" .. "/.cargo/git/", } for _, prefix in ipairs(protect_dirs) do if string.match(vim.fn.expand "%:p", prefix) ~= nil then vim.bo.readonly = true vim.bo.modifiable = false end end end

  • Rustup

    The Rust toolchain installer

  • _G.protect_rust_files = 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 protect_dirs = { "" .. vim.fn.expand "~" .. "/.rustup/toolchains/", "" .. vim.fn.expand "~" .. "/.cargo/git/", } for _, prefix in ipairs(protect_dirs) do if string.match(vim.fn.expand "%:p", prefix) ~= nil then vim.bo.readonly = true vim.bo.modifiable = false end end end

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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