config.nvim

NeoVim config
git clone git://popovic.xyz/nvim.config.git/
Log | Files | Refs

hints.lua (1230B)


      1 ---@diagnostic disable: undefined-global
      2 return {
      3   "chrisgrieser/nvim-lsp-endhints",
      4   event = "VeryLazy",
      5   config = function()
      6     local endhints = require("lsp-endhints")
      7     endhints.enable()
      8     endhints.setup {
      9       icons = {
     10         type = "-> ",
     11         parameter = "<= ",
     12         offspec = "<= ", -- hint kind not defined in official LSP spec
     13         unknown = "? ",  -- hint kind is nil
     14       },
     15       label = {
     16         truncateAtChars = 50,
     17         padding = 1,
     18         marginLeft = 0,
     19         sameKindSeparator = ", ",
     20       },
     21       extmark = {
     22         priority = 50,
     23       },
     24       autoEnableHints = true,
     25     }
     26 
     27     map = vim.keymap.set
     28     map('n', '<leader>h', function(bufnr)
     29       if vim.lsp.inlay_hint.is_enabled() then
     30         print("Inlay Hitnts OFF")
     31       else
     32         print("Inlay Hitnts ON")
     33       end
     34       vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled(), bufnr)
     35     end, { silent = true, noremap = true })
     36 
     37     map('n', '<leader>d', function()
     38       if vim.diagnostic.is_enabled() then
     39         print("Diagnostics OFF")
     40       else
     41         print("Diagnostics ON")
     42       end
     43       vim.diagnostic.enable(not vim.diagnostic.is_enabled())
     44     end, { silent = true, noremap = true })
     45   end
     46 
     47 }