<commit_before>-- neovim diagnostics configuration

-- Mappings:
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
-- vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)

-- overrides default diagnostic defaults
-- (text to right is removed since is too much noise)
vim.diagnostic.config({
  virtual_text = false,
  signs = true,
  underline = true,
  update_in_insert = true,
  severity_sort = false,
})

local signs = { Error = '✗', Warn = '⚠', Hint = '‣', Info = '•' }

for type, icon in pairs(signs) do
  local hl = 'DiagnosticSign' .. type
  vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

-- hover for diagnostic:
vim.opt.updatetime = 250 -- global refresh time

-- opens diagnostic float window when cursor reach line
-- (render on top of default float window when goto_prev or goto_next is used)
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(bor, {focus=false, border='rounded'})]]

-- this does not seems to work<commit_msg>disable diagnostic auto open_float window (use E key instead)<commit_after>-- neovim diagnostics configuration

-- Mappings:
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
-- vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', 'E', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)

-- overrides default diagnostic defaults
-- (text to right is removed since is too much noise)
vim.diagnostic.config({
  virtual_text = false,
  signs = true,
  underline = true,
  update_in_insert = true,
  severity_sort = false,
  float = {
    focus = false,
    border = 'rounded'
  }
})

local signs = { Error = '✗', Warn = '⚠', Hint = '‣', Info = '•' }

for type, icon in pairs(signs) do
  local hl = 'DiagnosticSign' .. type
  vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

-- hover for diagnostic:
vim.opt.updatetime = 250 -- global refresh time

-- opens diagnostic float window when cursor reach line
-- (render on top of default float window when goto_prev or goto_next is used)
-- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(bor, {focus=false, border='rounded'})]]

-- this does not seems to work
{'fraction_non_alphanumeric': 0.1456383377012355, 'fraction_numerical': 0.0022463496817671283, 'mean_word_length': 4.178294573643411, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6582065', 'n_tokens_mistral': 961, 'n_tokens_neox': 926, 'n_words': 278}