Clean up config: fix broken plugin specs, dedupe options/keymaps, drop dead code

- lspsaga: custom keys lived outside config(), so setup({}) ran empty and
  they never worked; moved into setup() and updated to the plugin's current
  option schema (finder_action_keys/definition_action_keys/move_in_saga
  are stale names in the installed version)
- catppuccin: fixed a stray `as = "catppuccin"` key left outside the plugin
  table; wrapped as { "catppuccin/nvim", name = "catppuccin" }
- options: consolidated the three competing sources (vimrc, init.lua,
  custom/options.lua) into custom/options.lua alone; hlsearch/wrap were
  silently landing opposite to what init.lua's own comments said, purely
  from require-order. custom/options.lua now loads first in the require
  chain since colorizer.lua and others need termguicolors set before their
  own setup() runs
- removed duplicate keymaps that were dead on arrival due to load order
  (<leader>rn, <leader>sf/sg/sh, jj, <leader>y, mapleader x3, manual
  C-h/j/k/l vs vim-tmux-navigator)
- removed dead code: smart_format, root_dir/fallback_root_dir, toggleterm's
  unused _LAZYGIT_TOGGLE/_NODE_TOGGLE/_PYTHON_TOGGLE globals, unused local
  cmp, stale commented blocks, lua/custom/startup.lua
- removed unused plugins: mini.icons, telescope-dap.nvim,
  startup-nvim/startup.nvim (malformed spec, never actually required),
  plus leftover ALE globals with no ALE plugin installed
- vim.loop.* -> vim.uv.*, vim.diagnostic.goto_prev/next ->
  vim.diagnostic.jump({count=...}) for 0.12.5
- guard vim.treesitter.start() at the top of init.lua: the system's
  bundled Lua highlight query is currently ahead of the available
  tree-sitter-lua grammar (a packaging skew, confirmed nvim-treesitter is
  fully up to date), which was throwing on every Lua buffer and taking
  omnifunc/foldexpr down with it; now falls back to regex highlighting
  with a single notify instead

Verified end-to-end against a real Neovim 0.12.5 headless instance with a
fresh plugin install: no load errors, lspsaga's custom keys now actually
apply, and the treesitter guard was confirmed against the real environment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jVh2Lhn386JAvjSFCHUhn
This commit is contained in:
2026-08-27 22:27:37 +02:00
co-authored by Claude Sonnet 5
parent b512fd2ff3
commit 2646541406
12 changed files with 70 additions and 207 deletions
+1 -2
View File
@@ -47,5 +47,4 @@ require("catppuccin").setup({
},
})
-- setup must be called before loading
vim.cmd.colorscheme "catppuccin"
-- colorscheme is applied in custom/colortheme.lua, loaded after this file
-8
View File
@@ -1,5 +1,3 @@
vim.g.mapleader = ' '
local keymap = vim.keymap
keymap.set('i', 'jj', '<ESC>')
@@ -56,12 +54,6 @@ keymap.set('n', '<leader>gh', ':DiffviewFileHistory %<CR>', { silent = true })
-- toggleterm
keymap.set('n', '<M-1>', '<cmd>ToggleTerm direction=horizontal<cr>', { silent = true })
-- vim-sneak
-- keymap.set('n', 'f', '<Plug>Sneak_s', { silent = true })
-- keymap.set('n', 'F', '<Plug>Sneak_S', { silent = true })
-- keymap.set('n', 's', 's', { silent = true })
-- easymotion
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
keymap.set('n', '<leader>fs', '<Plug>(easymotion-sn)', { silent = true })
-9
View File
@@ -33,15 +33,6 @@ vim.filetype.add({
})
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-l>", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-v>", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-e>", ":lua require('kulala').set_selected_env()<CR>",
-- { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rr", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rv", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>re", ":lua require('kulala').set_selected_env()<CR>",
+2 -32
View File
@@ -7,24 +7,6 @@
local keymap = vim.keymap -- for conciseness
-- smart format with null-ls if available
local function smart_format()
vim.lsp.buf.format({
filter = function(client)
local ft = vim.bo.filetype
if ft == "rust" then
return client.name == "rust_analyzer"
end
-- Prefer null-ls for all non-Rust, otherwise allow anything
if vim.tbl_contains({ "null-ls", "lua_ls", "jsonls", "tsserver" }, client.name) then
return true
end
return false
end,
timeout_ms = 3000,
})
end
---------- border >------------------------------
do
local orig_floating_preview = vim.lsp.util.open_floating_preview
@@ -55,11 +37,9 @@ local on_attach = function(_, bufnr)
keymap.set("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
-- keymap.set("n", "<leader>l", smart_format, opts)
keymap.set("n", "<leader>l", function()
vim.lsp.buf.format()
end, { desc = "Format code function" })
keymap.set("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
keymap.set(
"n",
"<leader>cbf",
@@ -121,15 +101,6 @@ setup_server("rust_analyzer", {
-- PHP LSPs
local util = vim.lsp.util
local root_dir = function(fname)
return util.root_pattern("composer.json", ".git")(fname)
or util.path.dirname(fname)
end
local fallback_root_dir = function(fname)
return util.root_pattern("composer.json", ".git")(fname) or util.path.dirname(fname)
end
-- start it manually :LspStart phpactor
-- setup_server("phpactor", {
@@ -186,13 +157,12 @@ setup_server("intelephense", {
-- phpcs / phpstan configs
vim.g.nvim_phpcs_config_phpcs_path = 'phpcs'
vim.g.nvim_phpcs_config_phpcbf_path = 'phpcbf'
vim.g.ale_php_phpstan_executable = '~/.config/composer/vendor/bin/phpstan'
local phpcs_config = "~/repos/configs/phpcs.xml"
local phpcs_config_new = "~/repos/dotfiles/phpcs.xml"
if vim.loop.fs_stat(phpcs_config_new) then
if vim.uv.fs_stat(phpcs_config_new) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new
elseif vim.loop.fs_stat(phpcs_config) then
elseif vim.uv.fs_stat(phpcs_config) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config
end
+2 -2
View File
@@ -8,7 +8,7 @@ local phpstan_global_config = vim.fn.expand("~/repos/dotfiles/php/phpstan-global
-- local config itself (that also picks up its `includes:`, e.g. a baseline)
local function phpstan_config_arg(root)
for _, name in ipairs({ "phpstan.neon", "phpstan.neon.dist" }) do
if vim.loop.fs_stat(root .. "/" .. name) then
if vim.uv.fs_stat(root .. "/" .. name) then
return nil
end
end
@@ -47,7 +47,7 @@ null_ls.setup({
timeout = 60000, -- a cold run easily exceeds null-ls' 5s default
condition = function(utils)
return utils.root_has_file({ "phpstan.neon", "phpstan.neon.dist" })
or vim.loop.fs_stat(phpstan_global_config) ~= nil
or vim.uv.fs_stat(phpstan_global_config) ~= nil
end,
}),
null_ls.builtins.diagnostics.phpcs.with({
+10 -1
View File
@@ -15,9 +15,10 @@ opt.expandtab = true
opt.autoindent = true
opt.wrap = false
opt.breakindent = true
-- scroll offset
vim.opt.scrolloff = 8
opt.scrolloff = 8
-- search settings
opt.smartcase = true
@@ -29,6 +30,9 @@ opt.termguicolors = true
opt.background = 'dark'
opt.signcolumn = 'yes'
-- mouse
opt.mouse = 'a'
-- clipboard
opt.clipboard:append 'unnamedplus'
@@ -37,3 +41,8 @@ opt.splitright = true
opt.splitbelow = true
opt.iskeyword:append '-'
-- undo & responsiveness
opt.undofile = true
opt.updatetime = 250
opt.timeoutlen = 300
+11 -17
View File
@@ -22,29 +22,26 @@ return {
-- vs-code like icons for autocompletion
"onsails/lspkind.nvim",
"catppuccin/nvim",
as = "catppuccin",
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
{ "catppuccin/nvim", name = "catppuccin" },
{
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({})
require('lspsaga').setup({
-- use enter to open file from the finder
finder = {
keys = { toggle_or_open = "<CR>" },
},
-- use enter to open file with definition preview
definition = {
keys = { edit = "<CR>" },
},
})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
},
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
-- use enter to open file with finder
finder_action_keys = {
open = "<CR>",
},
-- use enter to open file with definition preview
definition_action_keys = {
edit = "<CR>",
},
},
-- Debugger
@@ -60,7 +57,6 @@ return {
"theHamsta/nvim-dap-virtual-text",
dependencies = "mfussenegger/nvim-dap",
},
"nvim-telescope/telescope-dap.nvim",
-- autoclose parens, brackets, quotes, etc...
"windwp/nvim-autopairs",
@@ -102,8 +98,6 @@ return {
}
},
{ 'echasnovski/mini.icons', version = false },
{
-- HTTP REST-Client Interface
'mistweaverco/kulala.nvim',
-10
View File
@@ -1,10 +0,0 @@
-- import comment plugin safely
local setup, startup = pcall(require, "startup")
if not setup then
return
end
-- enable startup
startup.setup({
theme = "dashboard"
})
-3
View File
@@ -60,9 +60,6 @@ vim.keymap.set('n', '<leader>/', function()
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
-18
View File
@@ -43,21 +43,3 @@ end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
local node = Terminal:new({ cmd = "node", hidden = true })
function _NODE_TOGGLE()
node:toggle()
end
local python = Terminal:new({ cmd = "python3", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()
end
-26
View File
@@ -1,26 +1,6 @@
set number
set hlsearch
set incsearch
set smartcase
set ignorecase
set wrap
set linebreak
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set splitright splitbelow
set timeoutlen=1000
set number
set relativenumber
set scrolloff=10
syntax on
filetype indent on
set smartindent
let mapleader = " "
imap jj <Esc>
imap <C-l> <Del>
nnoremap <Leader>ü "+p
@@ -41,7 +21,6 @@ nnoremap <leader>a ggVG
nnoremap ,b :buffers<CR>
" nnoremap <leader>t :Explorer<CR>
" use leader e instead
nnoremap <leader>y "+yy
vnoremap <leader>y "+y
":nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
@@ -51,11 +30,6 @@ vnoremap <leader>y "+y
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
let g:python3_host_prog="/usr/bin/python3"
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" nnoremap <C-d> <C-d>zz
" nnoremap <C-u> <C-u>zz