Skip to content

Neovim migration — Phase 7: Convert init.vim to init.lua #73

Description

@mattmenefee

Blocked by


Convert the Vimscript config to pure Lua. Mostly mechanical translation. Done last so previous phases stabilize first.

Depends on: Phases 3, 4, 5, 6.

Target structure

home/.config/nvim/
  init.lua
  lua/
    options.lua       -- everything that was `set xxx`
    keymaps.lua       -- everything that was map/nnoremap/etc.
    autocmds.lua      -- everything that was autocmd
    plugins.lua       -- lazy.nvim spec (moved from Phase 3)
    lsp.lua           -- LSP config (moved from Phase 4)
  after/
    ftplugin/
      markdown.lua    -- replaces inline `au BufRead *.md` blocks
      gitcommit.lua   -- replaces inline gitcommit autocmd
      ruby.lua        -- replaces the `*.axlsx`, `*.yml.enc*` filetype autocmds
      dockerfile.lua  -- replaces `Dockerfile*` autocmd

Translation pattern

  • set xxx=valvim.opt.xxx = val
  • map/nnoremap/etc. → vim.keymap.set('n', lhs, rhs, opts)
  • autocmd Event Pattern cmdvim.api.nvim_create_autocmd('Event', {...})
  • let g:foo = barvim.g.foo = bar

Filetype reorganization

Move filetype-specific behavior out of init.vim's big au BufRead,BufNewFile *.md ... blocks into proper after/ftplugin/<lang>.lua files — Neovim auto-loads these when the matching filetype is detected, which is cleaner than scattered autocmds.

Cleanup

  • Delete home/.config/nvim/init.vim
  • Verify nothing else in the repo references init.vim

Acceptance

  • home/.config/nvim/init.vim no longer exists
  • :checkhealth reports green across the board
  • All previous keybindings still work
  • Filetype-specific config lives in after/ftplugin/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions