Skip to content

Mini#2

Merged
TheOnliestMattastic merged 6 commits into
mainfrom
mini
Dec 29, 2025
Merged

Mini#2
TheOnliestMattastic merged 6 commits into
mainfrom
mini

Conversation

@TheOnliestMattastic
Copy link
Copy Markdown
Owner

@TheOnliestMattastic TheOnliestMattastic commented Dec 29, 2025

PR Type

Enhancement, Refactoring


Description

  • Consolidate and simplify core configuration files with consistent formatting

    • Replace = separators with - for visual consistency
    • Remove redundant documentation and blank lines
    • Improve readability of init.lua, autocmds, keymaps, and options
  • Streamline plugin configurations by removing duplication

    • Remove lint.lua keybind (consolidated into LSP)
    • Simplify flash, snacks, and which-key plugin specs
    • Clean up comments and improve organization
  • Update keymaps with better mnemonics and descriptions

    • Change flash search from s to <leader>/
    • Reorder tab management keymaps for consistency
    • Add missing keymaps and fix descriptions
  • Update plugin lock file with latest versions


Diagram Walkthrough

flowchart LR
  A["Config Files<br/>init.lua, options, keymaps,<br/>autocmds"] -->|"Consolidate &<br/>Simplify"| B["Consistent<br/>Formatting"]
  C["Plugin Specs<br/>flash, lsp, snacks,<br/>which-key"] -->|"Remove<br/>Duplication"| D["Streamlined<br/>Configs"]
  E["Keymaps"] -->|"Better<br/>Mnemonics"| F["Improved<br/>Descriptions"]
  B --> G["Enhanced<br/>Readability"]
  D --> G
  F --> G
Loading

File Walkthrough

Relevant files
Formatting
4 files
init.lua
Remove blank lines and simplify structure                               
+1/-12   
autocmds.lua
Standardize comment separators and formatting                       
+32/-19 
options.lua
Consolidate and align option definitions                                 
+42/-46 
mini.lua
Reorder plugin initialization for consistency                       
+2/-2     
Enhancement
2 files
keymaps.lua
Update keymaps with better mnemonics and descriptions       
+28/-17 
flash.lua
Simplify spec and update keymap to leader slash                   
+42/-45 
Refactoring
4 files
lint.lua
Remove keybind and consolidate into LSP                                   
+0/-23   
lsp.lua
Add section comments and remove inlay hints setup               
+18/-23 
snacks.lua
Reorganize keymaps and simplify toggle setup                         
+63/-73 
which-key.lua
Simplify spec and update keymap descriptions                         
+12/-16 
Documentation
1 files
KEYMAPS.md
Update documentation to reflect keymap changes                     
+10/-24 
Dependencies
1 files
lazy-lock.json
Update plugin versions to latest commits                                 
+2/-2     

- Update autocmds, keymaps, options with consistent formatting
- Remove redundant documentation
- Improve readability of init.lua and KEYMAPS.md
- Remove lint.lua (consolidated into LSP)
- Simplify flash, LSP, snacks, which-key specs
- Clean up comments in mini.lua
@continue
Copy link
Copy Markdown

continue Bot commented Dec 29, 2025

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts


Unsubscribe from All Green comments

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Dec 29, 2025

PR Compliance Guide 🔍

(Compliance updated until commit 56e71e6)

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Previous compliance checks

Compliance check up to commit dd3c54e
Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance check up to commit 84b5a6e
Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented Dec 29, 2025

PR Code Suggestions ✨

Latest suggestions up to dd3c54e

CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve diagnostics virtual text options

Improve the virtual text toggle to preserve its configuration table. The current
implementation loses custom settings when toggling, and this change ensures the
configuration is saved and restored correctly.

lua/config/keymaps.lua [182-190]

 map("n", "<leader>uv", function()
-  local config = vim.diagnostic.config()
-  local vtext
-  if config then vtext = config.virtual_text end
-  -- Toggle: if enabled, disable; if disabled, enable with default settings
-  vim.diagnostic.config({ virtual_text = not vtext })
-  local status = not vtext and "enabled" or "disabled"
-  Snacks.notify.info("Virtual text diagnostics " .. status)
+  local cfg = vim.diagnostic.config() or {}
+  local vt = cfg.virtual_text
+
+  -- Save current virtual_text options before disabling so we can restore them.
+  if vt and vt ~= false then
+    vim.b._hyperfix_prev_virtual_text = vt
+    vim.diagnostic.config({ virtual_text = false })
+    Snacks.notify.info("Virtual text diagnostics disabled")
+    return
+  end
+
+  -- Restore previous options (or enable with existing/default options).
+  vim.diagnostic.config({
+    virtual_text = vim.b._hyperfix_prev_virtual_text or (vt == false and {} or vt) or {},
+  })
+  Snacks.notify.info("Virtual text diagnostics enabled")
 end, { desc = "Toggle [V]irtual Text Diagnostics" })

[Suggestion processed]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a bug where toggling virtual text diagnostics off and on would lose the custom configuration table, and it provides a robust fix that preserves the settings.

High
Avoid skipping over spaces
Suggestion Impact:Updated the `next_char:match(...)` pattern to exclude spaces by replacing the character class with an escaped version that omits the space, preventing the cursor-skip behavior from triggering on spaces.

code diff:

-  if next_char:match("[)%]}'\" ]") then
+  if next_char:match("[%)%]%}%\"%']") then

Remove the space character from the pattern in the smart closing punctuation
skip function. This prevents the keymap from unexpectedly skipping over spaces.

lua/config/keymaps.lua [145-147]

-if next_char:match("[)%]}'\" ]") then
+if next_char:match("[%)%]%}%\"%']") then
   vim.api.nvim_win_set_cursor(0, { row, col + 1 })
 end

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that the keymap for skipping punctuation would also skip spaces, which is likely unintended and undesirable behavior, and proposes a correct fix.

Medium
Incremental [*]
Restrict keymap to normal mode

Restrict the ? keymap to normal mode by adding mode = "n" to its definition,
preventing it from triggering in visual mode where it could cause issues.

lua/plugins/which-key.lua [33-38]

 {
   "<leader>?",
   function() require("which-key").show({ global = true }) end,
   desc = "Keymaps",
   icon = "󱕴",
+  mode = "n",
 },
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that the <leader>? keymap is active in visual mode due to the parent group's mode = { "n", "x" } setting. Restricting it to normal mode is a sensible improvement to prevent unexpected behavior while in visual mode.

Low
  • Update

Previous suggestions

✅ Suggestions up to commit 84b5a6e
CategorySuggestion                                                                                                                                    Impact
High-level
Keymap changes introduce inconsistencies
Suggestion Impact:The commit updates the documentation by removing the conflicting `?` grep mapping entry from KEYMAPS.md, reducing the inconsistency noted in the suggestion. No corresponding implementation change is shown in this patch.

code diff:

# File: KEYMAPS.md
@@ -236,7 +236,6 @@
 | Keymap            | Mode   | Action                           |
 | ----------------- | ------ | -------------------------------- |
 | `<leader><space>` | Normal | Smart find (auto-detect context) |
-| `<leader>?`       | Normal | Grep search                      |
 | `<leader>:`       | Normal | Command history                  |

The PR creates conflicting keymap definitions. For instance, the grep keymap is
documented as ? but implemented as sg, leading to user confusion.

Examples:

KEYMAPS.md [239]
| `<leader>?`       | Normal | Grep search                      |
lua/plugins/snacks.lua [302-305]
      "<leader>sg",
      function() Snacks.picker.grep() end,
      desc = "[G]rep",
    },

Solution Walkthrough:

Before:

// In KEYMAPS.md
| Keymap      | Action      |
|-------------|-------------|
| `<leader>/` | Grep search |
| `s`         | Flash search|

// In lua/plugins/snacks.lua
keys = {
  {
    "<leader>/",
    function() Snacks.picker.grep() end,
    desc = "Grep",
  },
}

After:

// In KEYMAPS.md
| Keymap      | Action       |
|-------------|--------------|
| `<leader>?` | Grep search  |
| `<leader>/` | Flash search |

// In lua/plugins/snacks.lua
keys = {
  // ... other keys
  {
    "<leader>sg",
    function() Snacks.picker.grep() end,
    desc = "[G]rep",
  },
}
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a critical inconsistency between the documented keymaps in KEYMAPS.md and their implementation in lua/plugins/snacks.lua, which undermines the PR's goal of improving usability and mnemonics.

Medium
Possible issue
Fix incorrect which-key configuration
Suggestion Impact:The commit updates the ? mapping by removing the `expand =` field and using a direct function callback to call `which-key`.show({ global = true }).

code diff:

           "<leader>?",
-          expand = function() require("which-key").show({ global = true }) end,
+          function() require("which-key").show({ global = true }) end,
           desc = "Keymaps",

The ? keymap in which-key uses expand incorrectly for a simple action. Replace
expand with a direct function callback to ensure the keymap correctly shows all
keymaps.

lua/plugins/which-key.lua [33-38]

 {
   "<leader>?",
-  expand = function() require("which-key").show({ global = true }) end,
+  function() require("which-key").show({ global = true }) end,
   desc = "Keymaps",
   icon = "󱕴",
 },

[Suggestion processed]

Suggestion importance[1-10]: 8

__

Why: This suggestion correctly identifies that using expand for a simple action in which-key is incorrect and will not work. The proposed fix of using a direct function callback is accurate and fixes a functional bug in the keymap configuration.

Medium
Prevent duplicate autocommand creation

Prevent duplicate autocommand creation in hyperfix-lsp-highlight by setting
clear = true when creating the augroup. This avoids performance degradation from
accumulating autocommands when an LSP server attaches.

lua/plugins/lsp.lua [46-84]

 if
   client
   and client_supports_method(
     client,
     vim.lsp.protocol.Methods.textDocument_documentHighlight,
     event.buf
   )
 then
   local highlight_augroup = vim.api.nvim_create_augroup(
     "hyperfix-lsp-highlight",
-    { clear = false }
+    { clear = true }
   )
 
   vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
     buffer = event.buf,
     group = highlight_augroup,
     callback = vim.lsp.buf.document_highlight,
   })
   vim.api.nvim_create_autocmd({ "CursorMoved" }, {
     buffer = event.buf,
     group = highlight_augroup,
     callback = vim.lsp.buf.clear_references,
   })
 end

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: This suggestion correctly identifies a potential performance issue where autocommands could be duplicated. Changing clear = false to clear = true for the augroup is the correct fix to ensure robustness.

Medium
Fix new/next tab mapping

The keymaps for creating a new tab (n) and moving to the next tab () are
swapped. Swap them back and update their descriptions for more intuitive
behavior.

lua/config/keymaps.lua [33-34]

-map("n", "<leader><tab><tab>", "<cmd>tabnext<cr>",     { desc = "[TAB] over" })
-map("n", "<leader><tab>n",     "<cmd>tabnew<cr>",      { desc = "[N]ew" })
+map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>",      { desc = "New [T]ab" })
+map("n", "<leader><tab>n",     "<cmd>tabnext<cr>",     { desc = "[N]ext" })
Suggestion importance[1-10]: 7

__

Why: This suggestion correctly identifies that the keymaps for "new tab" and "next tab" are swapped, which is counter-intuitive and contradicts the previous logic. The proposed change restores the expected behavior, improving usability.

Medium

Comment thread lua/plugins/which-key.lua
Comment thread lua/plugins/lsp.lua
Comment thread lua/config/keymaps.lua
@TheOnliestMattastic TheOnliestMattastic merged commit f7be821 into main Dec 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant