From afaf382e259ab1e9f6b66a6f89096071e1a2b88a Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 7 Sep 2024 16:05:15 +0000 Subject: [PATCH 1/2] nvim: improve ToggleGutter to remove indent trace, diagnostics So that it fulfills its intended purpose: making vim ready for terminal level copying. This removes the extra overlay'd text segments from the window --- nvim/lua/psoxizsh/functions.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nvim/lua/psoxizsh/functions.lua b/nvim/lua/psoxizsh/functions.lua index 5c77aa1..2d7c435 100644 --- a/nvim/lua/psoxizsh/functions.lua +++ b/nvim/lua/psoxizsh/functions.lua @@ -4,18 +4,22 @@ local M, S = {}, {} ---Toggle the line numbers and diagnostic gutter function M.ToggleGutter() - local o = vim.opt + local o, diagnostic = vim.opt, vim.diagnostic if o.number:get() then S.signcolumn = o.signcolumn:get() o.number = false o.relativenumber = false o.signcolumn = 'no' + diagnostic.enable(false) else o.number = true o.relativenumber = true o.signcolumn = S.signcolumn or 'yes:1' + diagnostic.enable(true) end + + vim.cmd 'IBLToggle' end ---Open a float with your local config files From 38568df7127256d6a53eccb3163ed2dd1584fc90 Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 7 Sep 2024 16:05:42 +0000 Subject: [PATCH 2/2] nvim: improve cspell.json file handling This doesn't handle looking for workspace level files, but will stop the "Add word to dictionary" code action from creating random cspell.json files in whatever vim considers to be the current working directory. Eventually, I'd like to move this all into neoconf.json, but this is better than the current, non functional state --- nvim/lua/psoxizsh/plugins/ide.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nvim/lua/psoxizsh/plugins/ide.lua b/nvim/lua/psoxizsh/plugins/ide.lua index f81b052..0b6ee5f 100644 --- a/nvim/lua/psoxizsh/plugins/ide.lua +++ b/nvim/lua/psoxizsh/plugins/ide.lua @@ -144,8 +144,12 @@ return { -- CSpell setup local cspell = require 'cspell' + local cspell_config_json = function(_) + return vim.fn.stdpath('config') .. '/cspell.json' + end local cspell_opts = { config = { + find_json = cspell_config_json, on_add_to_json = function(payload) if vim.fn.executable('jq') == 0 then return end @@ -172,6 +176,12 @@ return { end, } + -- Ensure our config file exists, otherwise cspell complains + local uv = (vim.uv or vim.loop); + if not uv.fs_stat(cspell_config_json()) then + vim.fn.writefile({'{}'}, cspell_config_json()) + end + opts.sources = vim.tbl_extend('force', opts.sources or {}, { cspell.diagnostics.with(cspell_opts), cspell.code_actions.with(cspell_opts),