refactor: modularize nvim config into lua/config + lua/plugins

- Extract all options, keymaps, and autocommands into lua/config/
- Move every plugin spec into its own file under lua/plugins/
- Add custom inline orng colorscheme (dark + light) synced to macOS appearance
- Consolidate image.nvim into pdf-viewer.lua (fix duplicate spec)
- Fix image.nvim processor: magick -> magick_cli
- Remove conflicting nvim-autopairs (kept mini.pairs)
- Fix broken <C-f> keymap (was calling non-existent builtin cmd)
- Delete lua/kickstart/ and lua/custom/ folders
- Add colors/orng.vim + colors/orng-light.vim stubs for mid-session switching
- init.lua reduced from 1078 lines to 49 lines
This commit is contained in:
2026-02-26 11:54:58 +01:00
parent d36d07d224
commit 6ec8190beb
34 changed files with 1122 additions and 1600 deletions

11
lua/config/autocmds.lua Normal file
View File

@@ -0,0 +1,11 @@
-- lua/config/autocmds.lua
-- Global autocommands
-- Highlight yanked text briefly
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('user-highlight-yank', { clear = true }),
callback = function()
vim.hl.on_yank()
end,
})

31
lua/config/keymaps.lua Normal file
View File

@@ -0,0 +1,31 @@
-- lua/config/keymaps.lua
-- Global keymaps (plugin keymaps live in their own plugin files)
local map = vim.keymap.set
-- Clear search highlights
map('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostics
map('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Terminal
map('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
map('n', '<C-t>', ':split | terminal<CR>', { desc = '[T]erminal (horizontal split)' })
-- Window navigation
map('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
map('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
map('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
map('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- File explorer
map('n', '<C-e>', ':Neotree toggle<CR>', { desc = '[E]xplorer (toggle neotree)' })
-- LazyGit
map('n', '<C-g>', '<cmd>LazyGit<CR>', { desc = 'LazyGit' })
-- Telescope live grep (fixed: was using broken <cmd>builtin... syntax)
map('n', '<C-f>', function()
require('telescope.builtin').live_grep()
end, { desc = '[F]ind (live grep all files)' })

49
lua/config/options.lua Normal file
View File

@@ -0,0 +1,49 @@
-- lua/config/options.lua
-- All vim options in one place
local opt = vim.opt
local o = vim.o
-- Leader keys are set in init.lua before lazy loads
-- UI
o.number = true
o.relativenumber = false
o.cursorline = true
o.signcolumn = 'yes'
o.showmode = false
o.scrolloff = 10
o.splitright = true
o.splitbelow = true
o.inccommand = 'split'
-- Characters
o.list = true
opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
-- Mouse
o.mouse = 'a'
-- Clipboard (deferred to avoid startup lag)
vim.schedule(function()
o.clipboard = 'unnamedplus'
end)
-- Indentation
o.expandtab = true
o.smartindent = true
o.tabstop = 2
o.shiftwidth = 2
o.breakindent = true
-- Search
o.ignorecase = true
o.smartcase = true
-- Files
o.undofile = true
o.confirm = true
-- Performance
o.updatetime = 250
o.timeoutlen = 300