diff --git a/nvim/ftplugin/rust.lua b/nvim/ftplugin/rust.lua deleted file mode 100644 index e69de29..0000000 diff --git a/nvim/lua/plugins/rustaceanvim.lua b/nvim/lua/plugins/rustaceanvim.lua index 02d2eaf..600c298 100644 --- a/nvim/lua/plugins/rustaceanvim.lua +++ b/nvim/lua/plugins/rustaceanvim.lua @@ -3,5 +3,21 @@ return { 'mrcjkb/rustaceanvim', version = '^5', lazy = false, + init = function() + -- something is off with this plugin, or something else here and i cannot really pinpoint it (yet). + -- the below config seems to (mostly?) fix an issue where if i open `nvim` from within a non-rust + -- project / source directory, and then run `:cd /path/to/rust/project` and then open some rust (.rs) + -- files in neovim, rustaceanvim will NOT auto-attach via the ftplugin stuff as it's supposed to. + -- running `:chechhealth` at this point says rust-analyzer is not found. however, if i instead + -- initially open `nvim` from within a rust project / source directory and then open some rust (.rs) + -- files in neovim, rustaceanvim auto-attaches no problem and :checkhealth doesn't show any issues. + -- in either case, rust-analyzer is installed via rustup as rustaceanvim recommends and rust-analyzer + -- is correctly located on the current path ... + vim.g.rustaceanvim = { + server = { + cmd = { 'rust-analyzer' }, + }, + } + end, }, }