Replay personal customizations onto the new vim.pack kickstart base
Re-apply the user's customizations (previously living as an uncommitted
diff on the OLD lazy.nvim kickstart base) onto the new single-file
vim.pack-based kickstart, adapting them to the new architecture:
- Enable Nerd Font (have_nerd_font = true).
- VimTeX: lua/custom/plugins/vimtex.lua (ported from the lazy `lazy=false`
spec to vim.pack; globals set before load, zathura viewer, latexmk) plus
the three <leader>l keymaps.
- nvim-java: lua/custom/plugins/nvim-java.lua installs the plugin only
(mirrors the user's original `return { 'nvim-java/nvim-java' }`; wiring
is finished in a later commit).
- LSP servers: add jdtls, plus ty (Astral's Python type checker) and ruff.
ty is not in nvim-lspconfig, so it's defined via the new vim.lsp.config
API (cmd/filetypes/root_markers) instead of the old lspconfig.configs path.
- Mason: exclude ty and ruff from auto-install (installed separately via uv).
- conform: re-apply the user's formatter entries.
- treesitter: add `latex` to the installed parsers.
- Enable the optional kickstart modules the user had on (debug, indent_line,
lint, autopairs, neo-tree, gitsigns) and the custom.plugins loader, via the
new base's `require` mechanism (not lazy `import`).
- lint.lua: guard markdownlint behind `vim.fn.executable`.
- debug.lua: add java-debug-adapter and java-test to mason-nvim-dap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
f0a2108ed5
commit
348560c779
53
init.lua
53
init.lua
|
|
@ -99,7 +99,7 @@ do
|
|||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = false
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
|
@ -705,6 +705,30 @@ do
|
|||
|
||||
stylua = {}, -- Used to format Lua code
|
||||
|
||||
-- Java language server (installed via Mason).
|
||||
jdtls = {},
|
||||
|
||||
-- ty: Astral's Python type checker. Not yet shipped by nvim-lspconfig, so we
|
||||
-- define the whole config here (ported from the old `lspconfig.configs.ty`
|
||||
-- approach to the new `vim.lsp.config` API). Installed separately via uv, so
|
||||
-- it is excluded from Mason below.
|
||||
ty = {
|
||||
cmd = { 'ty', 'server' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = { 'pyproject.toml', 'ty.toml', '.git' },
|
||||
},
|
||||
|
||||
-- ruff: Python linter/formatter LSP. nvim-lspconfig ships the base `ruff`
|
||||
-- config (cmd, etc.); this only overlays init_options. Installed separately
|
||||
-- via uv, so it is excluded from Mason below.
|
||||
ruff = {
|
||||
init_options = {
|
||||
settings = {
|
||||
fixAll = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Special Lua Config, as recommended by neovim help docs
|
||||
lua_ls = {
|
||||
on_init = function(client)
|
||||
|
|
@ -758,6 +782,9 @@ do
|
|||
--
|
||||
-- You can press `g?` for help in this menu.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
-- ty and ruff are installed separately via uv (~/.local/bin), so exclude them
|
||||
-- from Mason auto-install.
|
||||
ensure_installed = vim.tbl_filter(function(name) return name ~= 'ty' and name ~= 'ruff' end, ensure_installed)
|
||||
vim.list_extend(ensure_installed, {
|
||||
-- You can add other tools here that you want Mason to install
|
||||
})
|
||||
|
|
@ -796,12 +823,12 @@ do
|
|||
},
|
||||
-- You can also specify external formatters in here.
|
||||
formatters_by_ft = {
|
||||
-- rust = { 'rustfmt' },
|
||||
lua = { 'stylua' },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
-- python = { "isort", "black" },
|
||||
--
|
||||
python = { 'isort', 'black' },
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
SQL = { 'sql-formatter' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -904,7 +931,7 @@ do
|
|||
vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } }
|
||||
|
||||
-- Ensure basic parsers are installed
|
||||
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||
local parsers = { 'bash', 'c', 'diff', 'html', 'latex', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||
require('nvim-treesitter').install(parsers)
|
||||
|
||||
---@param buf integer
|
||||
|
|
@ -966,17 +993,17 @@ do
|
|||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug'
|
||||
-- require 'kickstart.plugins.indent_line'
|
||||
-- require 'kickstart.plugins.lint'
|
||||
-- require 'kickstart.plugins.autopairs'
|
||||
-- require 'kickstart.plugins.neo-tree'
|
||||
-- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
|
||||
require 'kickstart.plugins.debug'
|
||||
require 'kickstart.plugins.indent_line'
|
||||
require 'kickstart.plugins.lint'
|
||||
require 'kickstart.plugins.autopairs'
|
||||
require 'kickstart.plugins.neo-tree'
|
||||
require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
|
||||
|
||||
-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- require 'custom.plugins'
|
||||
require 'custom.plugins'
|
||||
end
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
-- nvim-java: Java IDE layer on top of jdtls.
|
||||
-- https://github.com/nvim-java/nvim-java
|
||||
--
|
||||
-- NOTE: This only installs the plugin (mirroring the user's original
|
||||
-- `return { 'nvim-java/nvim-java' }` spec). It is NOT yet initialized, so jdtls
|
||||
-- currently runs vanilla. Wiring (`require('java').setup()`) is finished later.
|
||||
vim.pack.add { 'https://github.com/nvim-java/nvim-java' }
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
-- VimTeX: LaTeX support (compile, view, errors)
|
||||
-- https://github.com/lervag/vimtex
|
||||
--
|
||||
-- Ported from the user's lazy.nvim spec (lazy = false) to this base's `vim.pack`
|
||||
-- imperative style. VimTeX reads its `vim.g.vimtex_*` settings when it is sourced,
|
||||
-- so we set them BEFORE `vim.pack.add` loads the plugin (the equivalent of the old
|
||||
-- lazy `init` hook).
|
||||
|
||||
-- Viewer settings (adjust based on your PDF viewer)
|
||||
vim.g.vimtex_view_method = 'zathura' -- Use 'skim' on macOS, 'sumatra' on Windows, etc.
|
||||
|
||||
-- Compiler settings
|
||||
vim.g.vimtex_compiler_method = 'latexmk' -- Default compiler backend
|
||||
|
||||
-- Optional: Disable some features if you don't need them
|
||||
vim.g.vimtex_quickfix_enabled = 1 -- Enable quickfix window for errors
|
||||
vim.g.vimtex_syntax_enabled = 1 -- Syntax highlighting (works with Tree-sitter too)
|
||||
|
||||
-- Set TeX flavor (usually not needed, but good to know)
|
||||
vim.g.tex_flavor = 'latex'
|
||||
|
||||
vim.pack.add { 'https://github.com/lervag/vimtex' }
|
||||
|
||||
-- LaTeX keymaps (which-key group label is defined in init.lua: `<leader>l` = [L]aTeX)
|
||||
vim.keymap.set('n', '<leader>ll', '<cmd>VimtexCompile<CR>', { desc = 'Compile LaTeX' })
|
||||
vim.keymap.set('n', '<leader>lv', '<cmd>VimtexView<CR>', { desc = 'View PDF' })
|
||||
vim.keymap.set('n', '<leader>le', '<cmd>VimtexErrors<CR>', { desc = 'Show Errors' })
|
||||
|
|
@ -42,6 +42,8 @@ require('mason-nvim-dap').setup {
|
|||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
'java-debug-adapter',
|
||||
'java-test',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
|
|||
|
||||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
|
||||
-- Only enable markdownlint if it is actually installed (it is not installed here),
|
||||
-- otherwise nvim-lint errors on every markdown buffer.
|
||||
markdown = vim.fn.executable 'markdownlint' == 1 and { 'markdownlint' } or {},
|
||||
}
|
||||
|
||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||
|
|
|
|||
Loading…
Reference in New Issue