Nvim: improve blink and inlay hints, add heirline
This commit is contained in:
@@ -11,37 +11,6 @@ return {
|
||||
config = function()
|
||||
local nvim_lsp = require('lspconfig')
|
||||
require('clangd_extensions').setup({
|
||||
inlay_hints = {
|
||||
inline = false,
|
||||
-- Options other than `highlight' and `priority' only work
|
||||
-- if `inline' is disabled
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = true,
|
||||
-- Event which triggers a refresh of the inlay hints.
|
||||
-- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but
|
||||
-- not that this may cause higher CPU usage.
|
||||
-- This option is only respected when only_current_line and
|
||||
-- autoSetHints both are true.
|
||||
only_current_line_autocmd = { "CursorMoved", "CursorMovedI" },
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
show_parameter_hints = true,
|
||||
-- prefix for parameter hints
|
||||
parameter_hints_prefix = "←",
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
other_hints_prefix = "→",
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = true,
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
-- The highlight group priority for extmark
|
||||
priority = 100,
|
||||
},
|
||||
ast = {
|
||||
-- These are unicode, should be available in any font
|
||||
role_icons = {
|
||||
@@ -78,6 +47,8 @@ return {
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>E', vim.diagnostic.setloclist)
|
||||
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
@@ -106,8 +77,6 @@ return {
|
||||
-- floating_window_off_x = 10,
|
||||
-- floating_window_off_y = 0,
|
||||
-- })
|
||||
require("clangd_extensions.inlay_hints").setup_autocmd()
|
||||
require("clangd_extensions.inlay_hints").set_inlay_hints()
|
||||
require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {
|
||||
ui = {
|
||||
wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long
|
||||
@@ -123,7 +92,14 @@ return {
|
||||
|
||||
vim.diagnostic.config({
|
||||
underline = false,
|
||||
signs = true,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.HINT] = "",
|
||||
[vim.diagnostic.severity.ERROR] = "✘",
|
||||
[vim.diagnostic.severity.INFO] = "◉",
|
||||
[vim.diagnostic.severity.WARN] = ""
|
||||
}
|
||||
},
|
||||
virtual_text = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true
|
||||
|
||||
Reference in New Issue
Block a user