From 8f0a066e3342f269f5550eb88dc2d0f89012cc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 7 Sep 2023 09:08:18 +0200 Subject: [PATCH 1/2] feat(nvim): toggle diagnostics with lsp lines --- modules/programs/nvim/plugins/nvim-lspconfig.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/nvim-lspconfig.lua b/modules/programs/nvim/plugins/nvim-lspconfig.lua index bba7726..7aa6dd7 100644 --- a/modules/programs/nvim/plugins/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/nvim-lspconfig.lua @@ -52,7 +52,17 @@ local on_attach_def = function(client, bufnr) }, }, t = { - l = { lsp_lines.toggle, "LSP lines" }, + l = { + function() + lsp_lines.toggle() + if vim.diagnostic.is_disabled() then + vim.diagnostic.enable() + else + vim.diagnostic.disable() + end + end, + "LSP lines", + }, i = { function() vim.lsp.inlay_hint(bufnr, nil) From d4be10dddacf1a120eca310461f2051a0d5ffc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 7 Sep 2023 09:09:12 +0200 Subject: [PATCH 2/2] feat(nvim): improve zen mode --- modules/programs/nvim/plugins/default.nix | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index f4a6780..76aebc8 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -316,8 +316,32 @@ with builtins; keys = [ { key = "tz"; cmd = "ZenMode"; desc = "Zen mode"; } ]; + conf = /* lua */ '' + require("zen-mode").setup({ + plugins = { + tmux = { + enabled = true, + }, + }, + }) + ''; dependencies = [ - { plugin = twilight-nvim; } + { + plugin = twilight-nvim; + conf = /* lua */ '' + require("twilight").setup({ + context = 20, + expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types + "function", + "function_definition", + "if_statement", + "method", + "method_definition", + "table", + }, + }) + ''; + } ]; } ];