diff --git a/.gitignore b/.gitignore index b5f4f2b..eeb7bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ local .DS_Store -nvim/plugin/ gh/ .claude .wrangler diff --git a/assimilate.sh b/assimilate.sh index c8234b6..ab21e14 100755 --- a/assimilate.sh +++ b/assimilate.sh @@ -213,7 +213,7 @@ clone_pinned https://github.com/erikw/tmux-powerline "$HOME/.tmux/plugins/tmux-p # Install neovim on Linux from a pinned upstream tarball (macOS gets it via Brewfile). # AL2023 doesn't ship neovim in its default dnf repos. Lands in $HOME/.local so no -# root needed, and runs before the PackerSync block below so the plugin sync works. +# root needed, and runs before the lazy.nvim sync below so plugin setup works. NVIM_VERSION=0.12.4 NVIM_SHA256=012bf3fcac5ade43914df3f174668bf64d05e049a4f032a388c027b1ebd78628 NVIM_BIN="$HOME/.local/bin/nvim" @@ -232,15 +232,14 @@ if [ "$OS" = "Linux" ] && [ "$ARCH" = "x86_64" ] && { [ ! -x "$NVIM_BIN" ] || [ fi if [ "$OS" = "Linux" ] && [ "$ARCH" = "x86_64" ] && [ -x "$NVIM_BIN" ]; then - # Prefer the pinned nvim for PackerSync, even when the host has another version. + # Prefer the pinned nvim for plugin sync, even when the host has another version. export PATH="$HOME/.local/bin:$PATH" fi -# Install Packer (nvim plugin manager) and run PackerSync — only if nvim is available +# lazy.nvim self-bootstraps (clones itself, pinned in nvim/lua/config/plugins.lua) +# on first launch. Restore the committed lock state when nvim is available. if command -v nvim >/dev/null; then - clone_pinned https://github.com/wbthomason/packer.nvim "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3 # 2023-08-24, matches plugins.lua pin - - nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' || true + nvim --headless "+Lazy! restore" +qa || true fi echo "> Assimilation successful!" diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json deleted file mode 100644 index c5d03b8..0000000 --- a/nvim/coc-settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "suggest.noselect": false, - "python.autoComplete.showAdvancedMembers": false, - "python.jediEnabled": true, - "python.linting.mypyEnabled": true -} diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..3312ef9 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,23 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "gruvbox.nvim": { "branch": "main", "commit": "61b0b3be2f0cfd521667403a0367298144d6c165" }, + "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-lspconfig": { "branch": "master", "commit": "d224a1920728ba129880efc700d4a0180ac4ecbb" }, + "nvim-tree.lua": { "branch": "master", "commit": "5e4475d8bf7a3646164e01d9b65ef68369b17e3c" }, + "nvim-treesitter": { "branch": "main", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "21417212f640a1dad28a1408f04468819848f5e7" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" }, + "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, + "vim-gitgutter": { "branch": "main", "commit": "fe0e8a2630eef548e4122096e4e2241f42208fe3" } +} diff --git a/nvim/lua/config/plugins.lua b/nvim/lua/config/plugins.lua index 3932def..e49c221 100644 --- a/nvim/lua/config/plugins.lua +++ b/nvim/lua/config/plugins.lua @@ -1,80 +1,96 @@ --- Automatically run :PackerCompile whenever plugins.lua is updated with an autocommand: -vim.api.nvim_create_autocmd('BufWritePost', { - group = vim.api.nvim_create_augroup('PACKER', { clear = true }), - pattern = 'plugins.lua', - command = 'source | PackerCompile', -}) +-- Leader must be set before lazy.nvim loads so that lazy `keys` specs below +-- bind against the intended leader (also set in remaps.lua). +vim.g.mapleader = " " +vim.g.maplocalleader = " " -return require('packer').startup(function(use) - -- Packer can manage itself - use { - 'wbthomason/packer.nvim', - commit = 'ea0cc3c', - } +-- Bootstrap lazy.nvim (pinned to a stable tag; it self-installs on first launch, +-- so no separate clone step is needed in assimilate.sh). +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local out = vim.fn.system({ + "git", "clone", "--filter=blob:none", + "--branch=v11.17.5", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) + if vim.v.shell_error ~= 0 then + error("Error cloning lazy.nvim:\n" .. out) + end +end +vim.opt.rtp:prepend(lazypath) - -- Devicons - -- Required by nvim-tree, lualine, and bufferline - use { +require("lazy").setup({ + -- Devicons — required by nvim-tree, lualine, and bufferline + { 'nvim-tree/nvim-web-devicons', tag = 'nerd-v3.2-compat', - } + }, -- Nvim file tree - use { + { 'nvim-tree/nvim-tree.lua', commit = '5e4475d', + dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() require("config.plugins.nvim-tree") - end - } + end, + }, - -- Markdown preview - use({ + -- Markdown preview (load only for markdown files) + { "iamcco/markdown-preview.nvim", commit = 'a923f5f', - run = function() vim.fn["mkdp#util#install"]() end, - }) + ft = "markdown", + build = function() vim.fn["mkdp#util#install"]() end, + }, -- Syntax highlighting - use { + { 'nvim-treesitter/nvim-treesitter', tag = 'v0.10.0', - run = function() + build = function() local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) ts_update() end, config = function() require("config.plugins.nvim-treesitter") - end - } + end, + }, - -- Fuzzyfinder - use { + -- Fuzzyfinder (load on its keys / :Telescope) + { 'nvim-telescope/telescope.nvim', tag = '0.1.1', - requires = { { 'nvim-lua/plenary.nvim' } }, + dependencies = { 'nvim-lua/plenary.nvim' }, + cmd = 'Telescope', + keys = { '', 'pf', 'ps', 'vh' }, config = function() require("config.plugins.telescope") - end - } + end, + }, - -- Git - use { + -- Git (load on :Git / gs) + { 'tpope/vim-fugitive', commit = '46eaf89', - } + cmd = { 'Git', 'G' }, + keys = { { 'gs', 'Git', desc = 'Git status' } }, + config = function() + require("config.plugins.fugitive") + end, + }, -- LSP - use { + { 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x', - requires = { + dependencies = { -- LSP Support { 'neovim/nvim-lspconfig' }, -- Required { -- Optional 'williamboman/mason.nvim', - run = function() + build = function() pcall(vim.cmd, 'MasonUpdate') end, }, @@ -87,57 +103,60 @@ return require('packer').startup(function(use) }, config = function() require("config.plugins.lsp") - end - } + end, + }, - -- Gruvbox - use { + -- Gruvbox (colorscheme — load first, before other UI plugins) + { "ellisonleao/gruvbox.nvim", tag = '2.0.0', + priority = 1000, + lazy = false, config = function() require("config.plugins.colors") - end - } + end, + }, -- GitGutter - use { + { 'airblade/vim-gitgutter', commit = 'fe0e8a2', config = function() require("config.plugins.gitgutter") - end - } + end, + }, -- Lualine - use { + { 'nvim-lualine/lualine.nvim', commit = '2248ef2', + dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() require("config.plugins.lualine") - end - } + end, + }, -- Vertical indent lines - use { + { "lukas-reineke/indent-blankline.nvim", tag = 'v3.3.7', - } + }, -- bufferline - use { + { 'akinsho/bufferline.nvim', tag = "v4.9.1", - config = function () + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() require("config.plugins.bufferline") - end - } + end, + }, -- Comments - -- add this to your lua/plugins.lua, lua/plugins/init.lua, or the file you keep your other plugins: - use { + { 'numToStr/Comment.nvim', config = function() require('Comment').setup() - end - } -end) + end, + }, +}) diff --git a/nvim/lua/config/plugins/nvim-treesitter.lua b/nvim/lua/config/plugins/nvim-treesitter.lua index 978f385..bd091bc 100644 --- a/nvim/lua/config/plugins/nvim-treesitter.lua +++ b/nvim/lua/config/plugins/nvim-treesitter.lua @@ -1,6 +1,6 @@ require("nvim-treesitter").setup { ensure_installed = { - "help", + "vimdoc", "lua", "javascript", "python",