From d13551731f61e6e0c5b6850db68ccd586adec0d7 Mon Sep 17 00:00:00 2001
From: Dennis Eriksen <d@ennis.no>
Date: Fri, 7 Feb 2025 11:18:58 +0100
Subject: polishing nvim config
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Added command to activate spelling
- Exchanged lukas-reineke/headlines.nvim for MeanderingProgrammer/render-markdown.nvim for markdown files
- Trying out new scope-character - '⎸', insteda of '┃'
- New shortcut, <leader>W to launch WhichKey
---
 config/.config/nvim/lua/config/options.lua         |  5 +++
 config/.config/nvim/lua/plugins/00-gruvbox.lua     | 46 +++++++++++++++++-----
 config/.config/nvim/lua/plugins/_editor.lua        | 24 +++++++----
 config/.config/nvim/lua/plugins/_ui.lua            | 10 ++++-
 config/.config/nvim/lua/plugins/langs/markdown.lua | 43 ++++++--------------
 5 files changed, 78 insertions(+), 50 deletions(-)

diff --git a/config/.config/nvim/lua/config/options.lua b/config/.config/nvim/lua/config/options.lua
index 6058f2a..273d324 100644
--- a/config/.config/nvim/lua/config/options.lua
+++ b/config/.config/nvim/lua/config/options.lua
@@ -345,6 +345,11 @@ cmd("Diff", "vert diffsplit <args>", { nargs = 1, complete = "file" })
 -- and the file it was loaded from, thus the changes you made.
 cmd("DiffOrig", "vert new | set buftype=nofile | r ++edit # | 0d_ | diffthis | wincmd p | diffthis", {})
 
+-- Spelling
+cmd("SpellEN", "set spell spelllang=en", {})
+cmd("SpellNB", "set spell spelllang=nb", {})
+cmd("SpellNO", "set spell spelllang=nb", {})
+
 ---------------------------------------------------------------------------------
 --
 -- Enable/Disable addons and functions in lazyvim/local nvim
diff --git a/config/.config/nvim/lua/plugins/00-gruvbox.lua b/config/.config/nvim/lua/plugins/00-gruvbox.lua
index 0323d2b..c6b016b 100644
--- a/config/.config/nvim/lua/plugins/00-gruvbox.lua
+++ b/config/.config/nvim/lua/plugins/00-gruvbox.lua
@@ -18,16 +18,42 @@ return {
         CursorLineFold    = { bg = gruvbox.dark1 },
         CursorLineSign    = { bg = gruvbox.dark1 },
 
-        GitSignsAdd       = { fg = gruvbox.neutral_green },
-        GitSignsChange    = { fg = gruvbox.neutral_orange },
-        GitSignsDelete    = { fg = gruvbox.neutral_red },
-
-        GitSignsAddCul    = { fg = gruvbox.bright_green,
-                              bg = gruvbox.dark1 },
-        GitSignsChangeCul = { fg = gruvbox.bright_orange,
-                              bg = gruvbox.dark1 },
-        GitSignsDeleteCul = { fg = gruvbox.bright_red,
-                              bg = gruvbox.dark1 },
+        DiffChange        = { fg = gruvbox.dark1,
+                              bg = gruvbox.faded_yellow },
+
+        -- Plugins:
+
+          -- for 'lewis6991/gitsigns.nvim' in _editor.lua
+          GitSignsAdd       = { fg = gruvbox.neutral_green },
+          GitSignsChange    = { fg = gruvbox.neutral_orange },
+          GitSignsDelete    = { fg = gruvbox.neutral_red },
+          GitSignsAddCul    = { fg = gruvbox.bright_green,
+                                bg = gruvbox.dark1 },
+          GitSignsChangeCul = { fg = gruvbox.bright_orange,
+                                bg = gruvbox.dark1 },
+          GitSignsDeleteCul = { fg = gruvbox.bright_red,
+                                bg = gruvbox.dark1 },
+
+          -- for 'MeanderingProgrammer/render-markdown.nvim' in langs/markdown.lua
+          RenderMarkdownH1  = { fg = gruvbox.neutral_green },
+          RenderMarkdownH1Bg= { fg = gruvbox.dark0_hard,
+                                bg = gruvbox.neutral_green },
+          RenderMarkdownH2  = { fg = gruvbox.neutral_aqua },
+          RenderMarkdownH2Bg= { fg = gruvbox.dark0,
+                                bg = gruvbox.neutral_aqua },
+          RenderMarkdownH3  = { fg = gruvbox.faded_aqua },
+          RenderMarkdownH3Bg= { fg = gruvbox.bright_green,
+                                bg = gruvbox.faded_aqua },
+          RenderMarkdownH4  = { fg = gruvbox.dark_green },
+          RenderMarkdownH4Bg= { bg = gruvbox.dark_green },
+          RenderMarkdownH5  = { fg = gruvbox.dark_aqua_soft },
+          RenderMarkdownH5Bg= { bg = gruvbox.dark_aqua_soft },
+          RenderMarkdownH6  = { fg = gruvbox.dark_aqua_hard },
+          RenderMarkdownH6Bg= { bg = gruvbox.dark_aqua_hard },
+
+          -- for 'folke/which-key.nvim' in _editor.lua
+          WhichKeyNormal    = { bg = gruvbox.dark0_hard_dark },
+
       }
     end
   },
diff --git a/config/.config/nvim/lua/plugins/_editor.lua b/config/.config/nvim/lua/plugins/_editor.lua
index 4eefb48..1680b30 100644
--- a/config/.config/nvim/lua/plugins/_editor.lua
+++ b/config/.config/nvim/lua/plugins/_editor.lua
@@ -26,9 +26,19 @@ return {
 
   -- which-key helps you remember key bindings by showing a popup
   -- with the active keybindings of the command you started typing.
-  --{ -- https://github.com/folke/which-key.nvim
-  --  "folke/which-key.nvim",
-  --},
+  { -- https://github.com/folke/which-key.nvim
+    "folke/which-key.nvim",
+    keys = {
+      { "<leader>W", "<cmd>WhichKey<cr>", desc = "WhichKey" }
+    },
+    opts = {
+      preset = "classic",
+      win = {
+        --border = { "", "═" ,"", "", "", "", "", "" }
+        border = "none"
+      },
+    },
+  },
 
   -- git signs highlights text that has changed since the list
   -- git commit, and also lets you interactively stage & unstage
@@ -38,16 +48,16 @@ return {
     opts = {
       culhl = true,
       signs = {
-        add          = { text = '┃' },
-        change       = { text = '┃' },
+        add          = { text = '⎸' }, -- default: '┃'
+        change       = { text = '⎸' }, -- default: '┃'
         delete       = { text = '_' },
         topdelete    = { text = '‾' },
         changedelete = { text = '~' },
         untracked    = { text = '┆' },
       },
       signs_staged = {
-        add          = { text = '┃' },
-        change       = { text = '┃' },
+        add          = { text = '⎸' }, -- default: '┃'
+        change       = { text = '⎸' }, -- default: '┃'
         delete       = { text = '_' },
         topdelete    = { text = '‾' },
         changedelete = { text = '~' },
diff --git a/config/.config/nvim/lua/plugins/_ui.lua b/config/.config/nvim/lua/plugins/_ui.lua
index eabb9cb..5650693 100644
--- a/config/.config/nvim/lua/plugins/_ui.lua
+++ b/config/.config/nvim/lua/plugins/_ui.lua
@@ -132,9 +132,15 @@ return {
       },
       dashboard = { enabled = false },
       indent = {
-        enabled = true,
+        indent = {
+          enabled = true,
+          char = '⎸', -- default: "│"
+        },
         animate = { enabled = false },
-        scope = { enabled = true },
+        scope = {
+          enabled = true,
+          char = '⎸', -- default: "│"
+        },
       },
       lazygit = { enabled = false },
       notifier = {
diff --git a/config/.config/nvim/lua/plugins/langs/markdown.lua b/config/.config/nvim/lua/plugins/langs/markdown.lua
index 6781db5..8c167c4 100644
--- a/config/.config/nvim/lua/plugins/langs/markdown.lua
+++ b/config/.config/nvim/lua/plugins/langs/markdown.lua
@@ -1,34 +1,15 @@
+-- markdown
+
 return {
-  { -- https://github.com/lukas-reineke/headlines.nvim
-    "lukas-reineke/headlines.nvim",
-    dependencies = "nvim-treesitter/nvim-treesitter",
-    ft = { "markdown" },
-    opts = {
-      markdown = {
-        headline_highlights = {
-          "headlines_Headline1",
-          "headlines_Headline2",
-          "headlines_Headline3",
-          "headlines_Headline4",
-          "headlines_Headline5",
-          "headlines_Headline6",
-        },
-        bullets = {},
-        dash_string = "",
-      },
-    },
-  },
-  { -- https://github.com/ellisonleao/gruvbox.nvim
-    "ellisonleao/gruvbox.nvim",
-    opts = {
-      overrides = {
-        headlines_Headline1 = { fg = "#b8db26", bg = "#272A02" },
-        headlines_Headline2 = { fg = "#b8cb26", bg = "#242912" },
-        headlines_Headline3 = { fg = "#b8bb26", bg = "#22271d" },
-        headlines_Headline4 = { fg = "#b8ab26", bg = "#212625" },
-        headlines_Headline5 = { fg = "#b89b26", bg = "#212629" },
-        headlines_Headline6 = { fg = "#b88b26", bg = "#21262d" },
-      },
-    },
+  { -- https://github.com/MeanderingProgrammer/render-markdown.nvim
+    "MeanderingProgrammer/render-markdown.nvim",
+    -- Only load when filetype = "markdown"
+    ft = "markdown",
+    -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
+    dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
+    -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
+    ---@module 'render-markdown'
+    ---@type render.md.UserConfig
+    opts = {},
   },
 }
-- 
cgit v1.2.3