$ show rafi/vim-config
rafi/vim-config is a Neovim configuration distribution (dotfiles-style) built on top of the LazyVim framework and managed by lazy.nvim. It transforms vanilla Neovim into a full IDE: lazy-loaded plugins provide LSP via nvim-lspconfig + mason.nvim, completion via blink.cmp (or nvim-cmp as an extra), telescope/snacks pickers, git workflows (gitsigns, diffview, neogit, blame), treesitter syntax, and a heavily customized lualine statusline. The runtime entry point is init.lua → lua/rafi/config/lazy.lua, which bootstraps lazy.nvim, imports the LazyVim framework plus ~15 core plugin-spec modules under lua/rafi/plugins/, and layers custom options, keymaps, and autocommands on top of LazyVim defaults via targeted User autocmds. An 'extras' system (registered in lua/rafi/config/init.lua) exposes ~50 opt-in plugin specs — colorschemes, language packs, org-mode tools, UI widgets — toggleable via :LazyExtras, making the distribution both opinionated and modular for fork-and-extend use. The codebase is idiomatic Lua organized into config/, plugins/, and util/ namespaces. It makes sophisticated use of lazy.nvim's spec merging (optional = true, opts = function(_, opts) patterns), a metatable-driven util facade (lua/rafi/util/init.lua) that lazily loads submodules, and recent Neovim APIs (vim.diagnostic.jump, nvim 0.11 features, tree-sitter-manager instead of the deprecated nvim-treesitter ensure_installed). Highlights for reuse include a small completion/snippet helper that abstracts LuaSnip vs native vim.snippet, color-theory utilities, a floating preview helper, and filetype plugins with proper undo_ftplugin hygiene. Documentation is extensive but partially stale: the README references paths that no longer exist in the tree (e.g. lua/rafi/plugins/lsp/keymaps.lua, lua/rafi/util/contextmenu.lua), so the code is the reliable source of truth. Dependencies: Neovim ≥ 0.11.2, git, lazy.nvim, LazyVim, and roughly 80 third-party Neovim plugins pinned via lazy-lock.json. Optional external CLIs (rg, fd, fzf, bat, zoxide, lazygit) improve picker and git behavior but degrade gracefully. This is not a data repo; it contains no pipelines, notebooks, or datasets. It is an application-distribution-style repo: a carefully engineered editor config demonstrating mature Neovim plugin-spec and Lua patterns.
The LLM identified 4 files worth highlighting for reuse:
A cohesive set of nvim-cmp mapping helpers (supertab, supertab_shift, tab_complete, snippet forward/backward) that abstract over two snippet engines — LuaSnip and Neovim's native vim.snippet — behind a single client interface with a normalized active()/jump() contract. Self-contained, importing only the external 'cmp' module, so it can be dropped into any Neovim config using nvim-cmp. Demonstrates the non-obvious pattern of engine-agnostic keymap logic: callers write one mapping and the helper routes to whatever snippet backend is loaded.
Pure-function color utilities for converting #rrggbb hex strings to/from RGB tables, computing weighted brightness and average-luma contrast metrics, and programmatically modifying brightness/contrast with clamping. Zero internal dependencies and MIT-attributed derivation from lualine's auto theme. Extractable as-is into any Lua project that needs dynamic colorscheme/theme manipulation, e.g. generating statusline or UI variants from a single base color.
A compact helper that opens a styled floating preview window for a file (optionally jumping to a specific line/column), waits for a single keystroke, closes the window, and transparently re-feeds the keystroke to Neovim. Its only dependency is Snacks.win. The open → interact → feed-key-back lifecycle is a clean, reusable pattern for any plugin that wants a temporary popup that never swallows user input.
A filetype plugin binding a normal/visual-mode key that converts the word under the cursor or a single-line visual selection into a markdown link. It handles multibyte characters correctly via strcharpart/stridx, restores the cursor after the transform, drops back into insert mode at the link's URL slot, and registers complete undo_ftplugin cleanup. Self-contained (uses only the public nvim API) and a strong template for writing buffer-local ftplugin features that install and uninstall cleanly.