1
0

Lualine and LSP tweaks

This commit is contained in:
Patrick Auernig 2023-05-09 17:28:09 +02:00
parent 80befc33f8
commit c8ac4bf07f
3 changed files with 50 additions and 41 deletions

View File

@ -23,6 +23,8 @@ vim.diagnostic.config({
virtual_text = false,
})
vim.keymap.set("n", "<Leader>ci", vim.diagnostic.open_float, { desc = "Display diagnostic Code Info" })
-- Gimme pretty icons
lsp.set_sign_icons({
error = '',
@ -37,8 +39,9 @@ lsp.on_attach(function(_, buffnr)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>re", vim.lsp.buf.rename, opts)
vim.keymap.set({"n", "i"}, "<C-h>", vim.lsp.buf.signature_help, opts)
vim.keymap.set({ "n", "i" }, "<C-h>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<Leader>fmt", function()
vim.lsp.buf.format({ async = false, timeout_ms = 5000 })
@ -49,12 +52,10 @@ end)
-- NOTE: Format on save does not support async formatting
lsp.format_on_save({
servers = {
["rust_analyzer"] = {"rust"}
["rust_analyzer"] = { "rust" }
}
})
require("lsp-inlayhints").setup()
lsp.setup()
require("lsp-inlayhints").setup()

31
after/plugin/lualine.lua Normal file
View File

@ -0,0 +1,31 @@
local overseer = require("overseer")
local task_status = {
"overseer",
colored = true,
symbols = {
[overseer.STATUS.FAILURE] = "",
[overseer.STATUS.CANCELED] = "o ",
[overseer.STATUS.SUCCESS] = "",
[overseer.STATUS.RUNNING] = "",
},
}
require("lualine").setup({
sections = {
lualine_b = {
"branch",
"diff",
{
"diagnostics",
symbols = { error = "E:", warn = "W:", info = "I:", hint = "H:" }
},
},
lualine_x = {
task_status,
"encoding",
{ "fileformat", icons_enabled = false },
"filetype"
}
},
})

View File

@ -102,32 +102,9 @@ local function spec(use)
use {
"nvim-lualine/lualine.nvim",
requires = {
{ "nvim-tree/nvim-web-devicons" }
},
config = function()
local overseer = require("overseer")
local task_status = {
"overseer",
colored = true,
symbols = {
[overseer.STATUS.FAILURE] = "",
[overseer.STATUS.CANCELED] = "o",
[overseer.STATUS.SUCCESS] = "",
[overseer.STATUS.RUNNING] = "",
},
{ "nvim-tree/nvim-web-devicons" },
{ "stevearc/overseer.nvim" },
}
require("lualine").setup({
sections = {
lualine_x = {
task_status,
"encoding",
{ "fileformat", icons_enabled = false },
"filetype"
}
},
})
end
}
use {