-
Hi, I'm just migrating from rust-tools to here, and I don't know how to use 'RustFmt'. Since when I typed it in a regular rs file and it shows me a pager screen which content is just the same file, and at the bottom it says
Maybe I have a broken config, but I really don't know what's happening and how to solve this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey 👋 I think you've got the wrong plugin. This plugin doesn't define a To format your file with the LSP client started by this plugin, you can run
I'd recommend a keymap: vim.keymap.set({ 'n', 'v' }, '<space>f', function()
vim.lsp.buf.format { async = true }
end, desc('[lsp] format buffer')) which will format the entire buffer in normal mode, or just the visual selection in visual mode. |
Beta Was this translation helpful? Give feedback.
Hey 👋
I think you've got the wrong plugin. This plugin doesn't define a
RustFmt
command.rust.vim does.
To format your file with the LSP client started by this plugin, you can run
:lua vim.lsp.buf.format { async = true }
I'd recommend a keymap:
which will format the entire buffer in normal mode, or just the visual selection in visual mode.