feat(tests): replace MINRC with init.lua for lazygit.nvim testing

This commit is contained in:
Dheepak Krishnamurthy
2025-07-22 18:13:32 -04:00
parent 8797c0df3f
commit cdd3527e25
3 changed files with 47 additions and 23 deletions

View File

@@ -1,22 +0,0 @@
" If after installing lazygit.vim, you are having trouble getting it to work, try the following minimal vimrc file.
set nocompatible " be iMproved, required
filetype off " required
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.local/share/nvim/plugged')
Plug '~/gitrepos/lazygit.nvim'
" Initialize plugin system
call plug#end()
let mapleader = " "
nnoremap <silent> <leader>lg :LazyGit<CR>
" Save the above to a file `MINRC`, and run `nvim -u MINRC` and type `<leader>lg` in normal mode.

43
tests/init.lua Normal file
View File

@@ -0,0 +1,43 @@
-- Minimal Neovim Lua configuration for testing lazygit.nvim using lazy.nvim
-- Save this as init.lua and run with: nvim -u init.lua
-- Basic settings
vim.opt.compatible = false
-- Set leader key (must be set before lazy setup)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Set built-in colorscheme
vim.cmd([[colorscheme vim]])
-- Install lazy.nvim if it doesn't exist
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Plugin setup using lazy.nvim
require("lazy").setup({
{
dir = "~/gitrepos/lazygit.nvim",
name = "lazygit.nvim",
config = function()
-- Keybinding for LazyGit
vim.keymap.set("n", "<leader>lg", ":LazyGit<CR>", {
silent = true,
desc = "Open LazyGit",
})
end,
},
})
-- Instructions: Save this file and run `nvim -u init.lua` then type `<leader>lg` in normal mode