From cc3d4d53760cf5f9589bbe74314b53dbe4c2b53d Mon Sep 17 00:00:00 2001 From: Patrick Pagni Date: Thu, 28 May 2026 10:38:59 +0100 Subject: [PATCH] backup: vim.pack config before lazy.nvim migration --- TEST | 24 ++++++++++++++++++++++ config/lazy.lua | 35 +++++++++++++++++++++++++++++++++ init.lua | 27 +++++-------------------- lazy-lock.json | 5 +++++ lua/custom/plugins/claude.lua | 24 ++++++++++++++++++++++ lua/custom/plugins/init.lua | 12 ++++++----- lua/custom/plugins/lsp.lua | 18 +++++++++++++++++ lua/custom/plugins/markdown.lua | 10 ++++++++++ lua/custom/plugins/notebook.lua | 25 +++++++++++++++++++++++ lua/custom/plugins/oil.lua | 7 +++++++ lua/custom/plugins/themes.lua | 21 ++++++++++++++++++++ 11 files changed, 181 insertions(+), 27 deletions(-) create mode 100644 TEST create mode 100644 config/lazy.lua create mode 100644 lazy-lock.json create mode 100644 lua/custom/plugins/claude.lua create mode 100644 lua/custom/plugins/lsp.lua create mode 100644 lua/custom/plugins/markdown.lua create mode 100644 lua/custom/plugins/notebook.lua create mode 100644 lua/custom/plugins/oil.lua create mode 100644 lua/custom/plugins/themes.lua diff --git a/TEST b/TEST new file mode 100644 index 00000000..12d9ac99 --- /dev/null +++ b/TEST @@ -0,0 +1,24 @@ + 1. Move the cursor to this line. + + 2. Press [v](v) and move the cursor to the fifth item below. Notice that the + text is highlighted. + + 3. Press the `:`{normal} character. At the bottom of the screen + + `:'<,'>`{vim} + + will appear. + + 4. Type + + `w TEST`{vim} + + where TEST is a filename that does not exist yet. Verify that you see + + `:'<,'>w TEST`{vim} + + before you press ``{normal}. + + 5. Neovim will write the selected lines to the file TEST. Use `:!{unix:(ls),win:(dir)}`{vim} to see it. + Do not remove it yet! We will use it in the next lesson. + diff --git a/config/lazy.lua b/config/lazy.lua new file mode 100644 index 00000000..f5ee74c9 --- /dev/null +++ b/config/lazy.lua @@ -0,0 +1,35 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/init.lua b/init.lua index 5d29c72d..8243ef02 100644 --- a/init.lua +++ b/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` @@ -377,24 +377,6 @@ do }, } - -- [[ Colorscheme ]] - -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command under that to load whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - vim.pack.add { gh 'folke/tokyonight.nvim' } - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' -- Highlight todo, notes, etc in comments vim.pack.add { gh 'folke/todo-comments.nvim' } @@ -961,14 +943,15 @@ do -- 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.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.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' end diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000..d1002b12 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,5 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "mini.icons": { "branch": "main", "commit": "9c7b1b90b15bdd69c52f6e31889dbc9987c30ec4" }, + "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" } +} diff --git a/lua/custom/plugins/claude.lua b/lua/custom/plugins/claude.lua new file mode 100644 index 00000000..8360b0c9 --- /dev/null +++ b/lua/custom/plugins/claude.lua @@ -0,0 +1,24 @@ +return { + "coder/claudecode.nvim", + dependencies = { "folke/snacks.nvim" }, + config = true, + keys = { + { "a", nil, desc = "AI/Claude Code" }, + { "ac", "ClaudeCode", desc = "Toggle Claude" }, + { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, + { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, + { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, + { "am", "ClaudeCodeSelectModel", desc = "Select Claude model" }, + { "ab", "ClaudeCodeAdd %", desc = "Add current buffer" }, + { "as", "ClaudeCodeSend", mode = "v", desc = "Send to Claude" }, + { + "as", + "ClaudeCodeTreeAdd", + desc = "Add file", + ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" }, + }, + -- Diff management + { "aa", "ClaudeCodeDiffAccept", desc = "Accept diff" }, + { "ad", "ClaudeCodeDiffDeny", desc = "Deny diff" }, + }, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index c05db465..b9554a8f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,9 +5,11 @@ -- Iterate over all Lua files in the plugins directory and load them local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') -for file_name, type in vim.fs.dir(plugins_dir) do - if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then - local module = file_name:gsub('%.lua$', '') - require('custom.plugins.' .. module) - end + for file_name, type in vim.fs.dir(plugins_dir) do + if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then + local module = file_name:gsub('%.lua$', '') + require('custom.plugins.' .. module) + end end + +--return {} diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua new file mode 100644 index 00000000..b725d518 --- /dev/null +++ b/lua/custom/plugins/lsp.lua @@ -0,0 +1,18 @@ +-- Define the configuration for the dbt language server +vim.lsp.config('dbt', { + -- The command to start the server + -- Ensure 'dbt-language-server' is in your system $PATH + cmd = { "dbt-language-server" }, + + -- The filetypes this server should attach to + filetypes = { "sql", "yaml" }, + + -- How to find the project root (replaces util.root_pattern) + root_markers = { "dbt_project.yml" }, + + -- General settings (standard for most servers) + settings = {}, +}) + +-- Tell Neovim to actually use/enable this server +vim.lsp.enable('dbt') diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua new file mode 100644 index 00000000..f06a4bcf --- /dev/null +++ b/lua/custom/plugins/markdown.lua @@ -0,0 +1,10 @@ +return { + 'brianhuster/live-preview.nvim', + dependencies = { + -- You can choose one of the following pickers + 'nvim-telescope/telescope.nvim', + 'ibhagwan/fzf-lua', + 'echasnovski/mini.pick', + 'folke/snacks.nvim', + }, +} diff --git a/lua/custom/plugins/notebook.lua b/lua/custom/plugins/notebook.lua new file mode 100644 index 00000000..d85e37b2 --- /dev/null +++ b/lua/custom/plugins/notebook.lua @@ -0,0 +1,25 @@ +return { + { + "benlubas/molten-nvim", + version = "^1.0.0", -- use version <2.0.0 to avoid breaking changes + dependencies = { "3rd/image.nvim" }, + build = ":UpdateRemotePlugins", + init = function() + -- these are examples, not defaults. Please see the readme + vim.g.molten_image_provider = "image.nvim" + vim.g.molten_output_win_max_height = 20 + end, + }, + { + 'willothy/wezterm.nvim', + config = true + }, + + { + "3rd/image.nvim", + build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239 + opts = { + processor = "magick_cli", + } + } +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..0a6ec428 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,7 @@ +-- Initialize the icons (optional, but highly recommended for Oil) +require('mini.icons').setup({}) + +-- Initialize and configure Oil +require('oil').setup({ + -- You can add any custom oil options here later! +}) diff --git a/lua/custom/plugins/themes.lua b/lua/custom/plugins/themes.lua new file mode 100644 index 00000000..45654b29 --- /dev/null +++ b/lua/custom/plugins/themes.lua @@ -0,0 +1,21 @@ +-- [[ Colorscheme ]] +-- You can easily change to a different colorscheme. +-- Change the name of the colorscheme plugin below, and then +-- change the command under that to load whatever the name of that colorscheme is. +-- +-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. +vim.pack.add { 'folke/tokyonight.nvim' } +---@diagnostic disable-next-line: missing-fields +require('tokyonight').setup { + styles = { + comments = { italic = false }, -- Disable italics in comments + }, +} + +vim.pack.add({ + { src = "https://gitlab.com/motaz-shokry/gruvbox.nvim" } +}) + +require("gruvbox").setup() -- for configs +vim.cmd("colorscheme gruvbox-medium") -- apply the theme +