diff options
-rw-r--r-- | dotfiles/vim-dev.lua | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/dotfiles/vim-dev.lua b/dotfiles/vim-dev.lua index dc8cf9f..7cf2bd3 100644 --- a/dotfiles/vim-dev.lua +++ b/dotfiles/vim-dev.lua | |||
@@ -30,12 +30,9 @@ local function on_attach(client, bufnr) | |||
30 | 30 | ||
31 | -- Capability specific | 31 | -- Capability specific |
32 | 32 | ||
33 | if client.resolved_capabilities.document_formatting then | 33 | if client.server_capabilities.documentFormattingProvider then |
34 | vim.keymap.set("n", "<leader>sf", vim.lsp.buf.formatting, desc(opts, "Format buffer")) | 34 | vim.keymap.set("n", "<leader>sf", vim.lsp.buf.formatting, desc(opts, "Format buffer")) |
35 | end | 35 | end |
36 | if client.resolved_capabilities.document_range_formatting then | ||
37 | vim.keymap.set("v", "<leader>sf", vim.lsp.buf.range_formatting, desc(opts, "Format Range")) | ||
38 | end | ||
39 | 36 | ||
40 | -- Rust specific | 37 | -- Rust specific |
41 | vim.keymap.set("n", "<leader>sh", "<cmd>RustToggleInlayHints<CR>", opts) | 38 | vim.keymap.set("n", "<leader>sh", "<cmd>RustToggleInlayHints<CR>", opts) |