aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-04-09 23:58:20 -0700
committerGitHub <noreply@github.com>2021-04-09 23:58:20 -0700
commitae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d (patch)
tree5b753cc022685fca108d5b4bbae126f09f7a7c4e /README.md
parent[docgen] Update CONFIG.md (diff)
parentFix conditional keymap (diff)
downloadnvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar.gz
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar.bz2
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar.lz
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar.xz
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.tar.zst
nvim-lspconfig-ae8fe11cbc41c19f6ee2678a4b6d9cc2ae007b1d.zip
Merge pull request #830 from csaez/patch-1
Fix conditional keymap in README
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/README.md b/README.md
index 60cdc004..4612f093 100644
--- a/README.md
+++ b/README.md
@@ -195,8 +195,9 @@ local on_attach = function(client, bufnr)
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
- elseif client.resolved_capabilities.document_range_formatting then
- buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
+ end
+ if client.resolved_capabilities.document_range_formatting then
+ buf_set_keymap("v", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
end
-- Set autocommands conditional on server_capabilities