diff options
Diffstat (limited to 'ftplugin/rust.lua')
-rw-r--r-- | ftplugin/rust.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua index 4fb47582..dd34483e 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -1,3 +1,17 @@ +O.formatters.filetype["rust"] = { + function() + return { + exe = O.lang.rust.formatter.exe, + args = O.lang.rust.formatter.args, + stdin = not (O.lang.rust.formatter.stdin ~= nil), + } + end, +} + +require("formatter.config").set_defaults { + logging = false, + filetype = O.formatters.filetype, +} if require("lv-utils").check_lsp_client_active "rust_analyzer" then return end @@ -81,11 +95,11 @@ else cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" }, on_attach = require("lsp").common_on_attach, filetypes = { "rust" }, - root_dir = require("lspconfig.util").root_pattern("Cargo.toml", "rust-project.json"), + root_dir = require("lspconfig.util").root_pattern("Carrust.toml", "rust-project.json"), } end --- TODO fix these mappings +-- TODO: fix these mappings vim.api.nvim_exec( [[ autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR> |