Skip to main content

Nvim The Reckoning

·308 words·2 mins
klevermonicker
Author
klevermonicker
Links to Socials for the project!
neovim - This article is part of a series.
Part 1: This Article

The Start
#

I warned you this is where I was going. If you’ve learned from my self deprecating humor through this…I’m going to be throwing shade.

So I cataloged everything that was wrong - I’ll admit to some AI help. Obviously I didn’t care enough to try to fix it. I needed an impartial buddy to come in and slap me upside the head. Which the AI did.

We’ll dive into each thing but here’s the quick list of dirty fixes

  1. Typo’s in DAP.
  2. Clipboard Config
  3. Dead Plugin
  4. Javascript acceptance
  5. LSP Format Keymap Location
  6. Error Handling non-existant
  7. Redundant LSP
  8. Unused Plugin
  9. Random Meaningless Comments in the files

Typos in DAP.
#

So apparently I don’t know how to type. Every DAP UI listener had a Typo. I had dapui_confg instead of dapui_config. So the debug UI would never auto-open when starting a debug session because the listeners were never actually registered.

Made this changes to the config file.

File: lua/plugins/debugging.lua

# BEFORE
dap.listeners.before.attach.dapui_confg = function()
dap.listeners.before.launch.dapui_confg = function()
dap.listeners.before.event_terminated.dapui_confg = function()
dap.listeners.before.event_exited.dapui_confg = function()

# AFTER
dap.listeners.before.attach.dapui_config = function()
dap.listeners.before.launch.dapui_config = function()
dap.listeners.before.event_terminated.dapui_config = function()
dap.listeners.before.event_exited.dapui_config = function()

Clipboard Config
#

I had the wrong utiity setup for macOS. I was using unamedplus. For once in our lives macOS isn’t being extra and it uses the rather pedestrian unamed register. Linux/Windows uses the plus. Bonus points, I KNEW IT WAS WRONG IN THE CONFIG.

File: init.lua

Original
#

vim.opt.clipboard.append("unnamedplus") -- Not sure if this cross platform or note

Changes Made
#

if vim.fn.has("mac") == 1 then
    vim.opt.clipboard = "unnamed"
else
    vim.opt.clipboard = "unnamedplus"
end

Now it works cross platform. Which you know was the original intent and since I am 100% macOS now…totally useless. This was never about making it work right out of the gate. This is me paying for my sins. So there, cross platform.

neovim - This article is part of a series.
Part 1: This Article