nvim bump + switch from packer -> lazy

This commit is contained in:
agryphus 2024-12-11 14:54:20 -05:00
parent cc99d55125
commit c28dd3e9a9
12 changed files with 209 additions and 203 deletions

View file

@ -1,4 +1,4 @@
require("andrew.remap")
require("andrew.packer")
require("andrew.lazy")
require("andrew.set")

119
lua/andrew/lazy.lua Normal file
View file

@ -0,0 +1,119 @@
-- 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({
-- Terminal file manager support
-- "DreamMaoMao/yazi.nvim",
{
"mikavilpas/yazi.nvim",
event = "VeryLazy",
},
-- Dashboard buffer
{
"goolord/alpha-nvim",
-- dependencies = { 'echasnovski/mini.icons' },
dependencies = { 'nvim-tree/nvim-web-devicons' },
},
-- Zen mode
"folke/zen-mode.nvim",
-- Show valid keys mid key chord
"folke/which-key.nvim",
-- config = function()
-- vim.o.timeout = true
-- vim.o.timeoutlen = 300
-- end
-- Find files and strings
{
'nvim-telescope/telescope.nvim', tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' },
},
{
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate"
},
-- Themes
"aktersnurra/no-clown-fiesta.nvim",
"ellisonleao/gruvbox.nvim",
{ 'rose-pine/neovim', as = 'rose-pine' },
'Mofiqul/vscode.nvim',
-- Referencing a hex code highlights it in that color
"norcalli/nvim-colorizer.lua",
-- Relative line numbers disappear when not actively in buffer
"jeffkreeftmeijer/vim-numbertoggle",
-- History visualizer
"mbbill/undotree",
-- See function signatures when typing them
{
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {},
config = function(_, opts) require'lsp_signature'.setup(opts) end
},
-- Left-side file tree dispaly
{
"nvim-tree/nvim-tree.lua",
requires = {
"nvim-tree/nvim-web-devicons", -- for file icons
},
},
-- Shows current mode on bottom of screen
"itchyny/lightline.vim",
-- LSP
{'VonHeikemen/lsp-zero.nvim', branch = 'v4.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
-- Better diagnostics
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
-- Linting
"jose-elias-alvarez/null-ls.nvim",
-- Git wrapper
"tpope/vim-fugitive",
-- Latex editing in vim
"lervag/vimtex",
-- Auto comment
"numToStr/Comment.nvim",
})

View file

@ -1,138 +0,0 @@
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require("packer").startup(function(use)
use "wbthomason/packer.nvim"
-- QML syntax highlighting
use "peterhoeg/vim-qml"
-- Terminal file manager support
use "DreamMaoMao/yazi.nvim"
-- Coq support
use "whonore/Coqtail"
-- Dashboard buffer
use "goolord/alpha-nvim"
-- Show valid keys mid key chord
use {
"folke/which-key.nvim",
config = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end
}
-- File manager in nvim
use {
"ptzz/lf.vim",
requires = { {"voldikss/vim-floaterm"} },
}
vim.cmd("let g:lf_map_keys = 0") -- Need to put here or else doesn't work
-- Zen mode
use "folke/zen-mode.nvim"
-- Find files and strings
use {
"nvim-telescope/telescope.nvim", tag = "0.1.4",
requires = { {"nvim-lua/plenary.nvim"} }
}
-- Treesitter
use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"})
-- Themes
use "aktersnurra/no-clown-fiesta.nvim"
use "ellisonleao/gruvbox.nvim"
use { 'rose-pine/neovim', as = 'rose-pine' }
use 'Mofiqul/vscode.nvim'
-- Referencing a hex code highlights it in that color
use "norcalli/nvim-colorizer.lua"
-- Relative line numbers disappear when not actively in buffer
use "jeffkreeftmeijer/vim-numbertoggle"
-- History visualizer
use "mbbill/undotree"
-- See function signatures when typing them
use "ray-x/lsp_signature.nvim"
require "lsp_signature".setup({})
-- Left-side file tree dispaly
use {
"nvim-tree/nvim-tree.lua",
requires = {
"nvim-tree/nvim-web-devicons", -- for file icons
},
tag = "nightly" -- optional, updated every week
}
-- Shows current mode on bottom of screen
use "itchyny/lightline.vim"
-- LSP
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v3.x',
requires = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'hrsh7th/cmp-buffer'}, -- Optional
{'hrsh7th/cmp-path'}, -- Optional
{'saadparwaiz1/cmp_luasnip'}, -- Optional
{'hrsh7th/cmp-nvim-lua'}, -- Optional
-- Snippets
{'L3MON4D3/LuaSnip'}, -- Required
{'rafamadriz/friendly-snippets'}, -- Optional
}
}
-- Better diagnostics
use {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
}
-- Linting
use "jose-elias-alvarez/null-ls.nvim"
-- Git wrapper
use("tpope/vim-fugitive")
-- Latex editing in vim
use "lervag/vimtex"
-- Auto comment
use "numToStr/Comment.nvim"
-- Jupyter notebook integration
-- use {
-- "glacambre/firenvim",
-- run = function() vim.fn["firenvim#install"](0) end
-- }
if packer_bootstrap then
require('packer').sync()
end
end)

View file

@ -46,6 +46,35 @@ vim.keymap.set("n", "<leader>tc",
end,
{desc = "Toggle color column"})
vim.keymap.set("n", "<leader>t", "<noop>", {desc = "Toggle"})
vim.keymap.set("n", "<leader>tl",
function ()
if vim.wo.number == false and vim.wo.relativenumber == false then
vim.wo.number = true
print("absolute numbers")
elseif vim.wo.number == true and vim.wo.relativenumber == false then
vim.wo.relativenumber = true
print("relative line numbers")
else
vim.wo.number = false
vim.wo.relativenumber = false
print("no line numbers")
end
end,
{desc = "Toggle line numbers"})
vim.keymap.set("n", "<leader>tw",
function ()
if vim.wo.wrap then
vim.wo.wrap = false
print("nowrap")
else
vim.wo.wrap = true
print("wrap")
end
end,
{desc = "Toggle line wrapping"})
-- case insensitive search
vim.keymap.set("n", "<leader>/", "/\\c")
vim.keymap.set("n", "<leader>?", "?\\c")