[nvim] update lsp format mapping

This commit is contained in:
Marco Thomas
2022-10-27 08:28:24 +02:00
parent 56be4ed7bc
commit e27c00475d
3 changed files with 5 additions and 6 deletions

View File

@@ -26,13 +26,13 @@ telescope.setup({
map("n", "<C-f>", "<cmd> Telescope find_files hidden=true<CR>", default_opts) -- Show files map("n", "<C-f>", "<cmd> Telescope find_files hidden=true<CR>", default_opts) -- Show files
map("n", "<C-s>", "<cmd> Telescope live_grep<CR>", default_opts) -- Grep through current directory map("n", "<C-s>", "<cmd> Telescope live_grep<CR>", default_opts) -- Grep through current directory
map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts) -- Show all keys map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts) -- Show all keys
map("n", "<C-n>", "<cmd> Noice telescope<CR>", default_opts) -- Show all notifications map("n", "<C-n>", "<cmd> Noice<CR>", default_opts) -- Show all notifications
-- Telescope + LSP -- Telescope + LSP
map("n", "<leader>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action map("n", "<leader>la", "<cmd> lua vim.lsp.buf.code_action()<CR>", default_opts) -- Apply LSP code action
map("n", "<leader>ld", "<cmd> Telescope lsp_definitions<CR>", default_opts) -- Show all LSP definitions (or jump if only 1) map("n", "<leader>ld", "<cmd> Telescope lsp_definitions<CR>", default_opts) -- Show all LSP definitions (or jump if only 1)
map("n", "<leader>le", "<cmd> Telescope diagnostics<CR>", default_opts) -- Show errors and warnings map("n", "<leader>le", "<cmd> Telescope diagnostics<CR>", default_opts) -- Show errors and warnings
map("n", "<leader>lf", "<cmd> lua vim.lsp.buf.formatting()<CR>", default_opts) -- Format buffer with LSP map("n", "<leader>lf", "<cmd> lua vim.lsp.buf.format {async = true }<CR>", default_opts) -- Format buffer with LSP
map("n", "<leader>lh", "<cmd> lua vim.lsp.buf.hover()<CR>", default_opts) -- Show info of symbol (double tap to enter) map("n", "<leader>lh", "<cmd> lua vim.lsp.buf.hover()<CR>", default_opts) -- Show info of symbol (double tap to enter)
map("n", "<leader>ln", "<cmd> lua vim.lsp.buf.rename()<CR>", default_opts) -- Rename LSP symbol map("n", "<leader>ln", "<cmd> lua vim.lsp.buf.rename()<CR>", default_opts) -- Rename LSP symbol
map("n", "<leader>lr", "<cmd> Telescope lsp_references<CR>", default_opts) -- Show all LSP references map("n", "<leader>lr", "<cmd> Telescope lsp_references<CR>", default_opts) -- Show all LSP references

View File

@@ -152,13 +152,11 @@ return require('packer').startup(function(use)
-- cooler cmd line and notifications -- cooler cmd line and notifications
use({ use({
"folke/noice.nvim", "folke/noice.nvim",
event = "VimEnter",
config = function()
require("noice").setup()
end,
requires = { requires = {
"MunifTanjim/nui.nvim", -- frontend for cmdline "MunifTanjim/nui.nvim", -- frontend for cmdline
}, },
event = "VimEnter",
config = function() require("plugins.noice-conf") end,
}) })
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim

View File

@@ -0,0 +1 @@
require("noice").setup({})