This commit is contained in:
Henrik Bakken
2022-10-04 14:20:59 +02:00
parent 5c7f1d7087
commit 1aee4eaa87
+7 -6
View File
@@ -122,6 +122,7 @@ map("n", "<leader>ww", [[:cd %:p:h<cr>]], {noremap = true})
map("n", "<esc><esc>", ":noh<cr>", {silent = true, noremap = true}) map("n", "<esc><esc>", ":noh<cr>", {silent = true, noremap = true})
map("n", "<F12>", "<esc>", {silent = true, noremap = true}) map("n", "<F12>", "<esc>", {silent = true, noremap = true})
map("i", "<F12>", "<esc>", {silent = true, noremap = true}) map("i", "<F12>", "<esc>", {silent = true, noremap = true})
map("v", "<F12>", "<esc>", {silent = true, noremap = true})
-- <Tab> to navigate the completion menu -- <Tab> to navigate the completion menu
map("i", "<S-Tab>", [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]], map("i", "<S-Tab>", [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]],
@@ -688,20 +689,20 @@ require("packer").startup {
bmap(bufnr, "i", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", bmap(bufnr, "i", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>",
opts) opts)
-- other -- other
if client.resolved_capabilities.goto_definition then if client.server_capabilities.goto_definition then
bmap(bufnr, "n", "gd", ":lua vim.lsp.buf.definition()<cr>", opts) bmap(bufnr, "n", "gd", ":lua vim.lsp.buf.definition()<cr>", opts)
end end
if client.resolved_capabilities.find_references then if client.server_capabilities.find_references then
bmap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>", opts) bmap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>", opts)
end end
if client.resolved_capabilities.hover then if client.server_capabilities.hover then
bmap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts) bmap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts)
end end
if client.resolved_capabilities.rename then if client.server_capabilities.rename then
bmap(bufnr, "n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()<cr>", opts) bmap(bufnr, "n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
end end
if client.resolved_capabilities.document_formatting or if client.server_capabilities.document_formatting or
client.resolved_capabilities.document_range_formatting then client.server_capabilities.document_range_formatting then
bmap(bufnr, "n", "<leader>f", bmap(bufnr, "n", "<leader>f",
"<cmd>lua vim.lsp.buf.formatting()<cr>", opts) "<cmd>lua vim.lsp.buf.formatting()<cr>", opts)
vim.api.nvim_command [[augroup Format]] vim.api.nvim_command [[augroup Format]]