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

@ -200,7 +200,7 @@ hl(0, 'NvimTreeCursorLine', { fg = palette.yellow })
hl(0, 'NvimTreeEndOfBuffer', { fg = palette.medium_gray })
hl(0, 'NvimTreeIndentMarker', { fg = palette.medium_gray })
hl(0, 'NvimTreeFolderIcon', { fg = palette.yellow })
hl(0, 'WhichKeyFloat', { bg = nil })
hl(0, 'WhichKeyBorder', { fg = palette.medium_gray, bg = palette.accent })
hl(0, 'WhichKeyDesc', { link = "function" })
hl(0, 'WhichKey', { fg = palette.medium_gray_blue })
hl(0, 'WhichKeyGroup', { fg = palette.gray_blue, bold = true })

View file

@ -1,52 +1,44 @@
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
math.randomseed(os.time())
local function pick_color()
local colors = {"String", "Identifier", "Keyword", "Number"}
return colors[math.random(#colors)]
end
local function footer()
local total_plugins = #vim.tbl_keys(packer_plugins)
local version = vim.version()
local nvim_version_info = " NVIM v" .. version.major .. "." .. version.minor .. "." .. version.patch
return nvim_version_info .. " 󰏖 " .. total_plugins .. " plugins"
local total_plugins = #require("lazy").plugins()
local version = vim.version()
local nvim_version_info = " NVIM v" .. version.major .. "." .. version.minor .. "." .. version.patch
return nvim_version_info .. " 󰏖 " .. total_plugins .. " plugins"
end
-- Set header
dashboard.section.header.val = {
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣭⣿⣶⣿⣦⣼⣆ ",
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
" ⠈ ⠈⢿⣿⣟⠦⠄⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
" ⣸⣿⣿⢧⠄⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
" ⢠⣿⣿⣿⠈ ⠡⠌⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿ ",
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷⠄ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
"⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
"⠙⠃ ⣼⣿⡟⠌ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿⠐⣿⣿⡇ ⠛⠻⢷⣄",
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ⠁",
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣀⣤⣾⡿⠃ ",
"⢀⣀⠀⣠⣀⣠⣾⣿⣿⡿⠛⠋⠉⠉⠉ ⠉⠉⠉⠉⠛⠻⣿⣿⣷⣄⣀⢿⡽⢻⣦",
"⠻⠶⠾⠿⠿⠿⠋⠉ N E O V I M ⠉⠻⠿⠿⠿⠿⠿⠋",
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣭⣿⣶⣿⣦⣼⣆ ",
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
" ⠈ ⠈⢿⣿⣟⠦⠄⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
" ⣸⣿⣿⢧⠄⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
" ⢠⣿⣿⣿⠈ ⠡⠌⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿ ",
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷⠄ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
"⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
"⠙⠃ ⣼⣿⡟⠌ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿⠐⣿⣿⡇ ⠛⠻⢷⣄",
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ⠁",
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣀⣤⣾⡿⠃ ",
"⢀⣀⠀⣠⣀⣠⣾⣿⣿⡿⠛⠋⠉⠉⠉ ⠉⠉⠉⠉⠛⠻⣿⣿⣷⣄⣀⢿⡽⢻⣦",
"⠻⠶⠾⠿⠿⠿⠋⠉ N E O V I M ⠉⠻⠿⠿⠿⠿⠿⠋",
}
-- Set menu
dashboard.section.buttons.val = {
dashboard.button( "e", " New file" , ":ene <BAR> startinsert <CR>"),
dashboard.button( "q", "󰩈 Quit NVIM", ":qa<CR>"),
dashboard.button( "e", " New file" , ":ene <BAR> startinsert <CR>"),
dashboard.button( "q", "󰩈 Quit NVIM", ":qa<CR>"),
}
vim.api.nvim_create_autocmd("VimEnter", {
once = true,
callback = function()
math.randomseed(os.time())
local fg_color = tostring(math.random(0, 12))
local hi_setter = "hi AlphaHeader ctermfg="
vim.cmd(hi_setter .. fg_color)
end
once = true,
callback = function()
math.randomseed(os.time())
local fg_color = tostring(math.random(0, 12))
local hi_setter = "hi AlphaHeader ctermfg="
vim.cmd(hi_setter .. fg_color)
end
})
dashboard.section.footer.val = footer()

View file

@ -1,4 +1,4 @@
local wk = require("which-key")
wk.register({g = { name = "git" }, prefix = "<leader>"})
-- wk.add({g = { name = "git" }, prefix = "<leader>"})
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Git status" })

View file

@ -59,11 +59,13 @@ cmp.setup({
}
})
-- DIAGNOSTICS
-- Show all diagnostics on current line in floating window
vim.api.nvim_set_keymap(
'n', 'gl', ':lua vim.diagnostic.open_float()<CR>',
{ noremap = true, silent = true }
)
vim.keymap.set("n", "gl", ":lua vim.diagnostic.open_float()<CR>",
{ noremap = true, silent = true })
vim.keymap.set("n", "<leader>le", ":LspStop<CR>",
{ desc = "LSP Stop" })
vim.keymap.set("n", "<leader>ls", ":LspStart<CR>",
{ desc = "LSP Start" })

View file

@ -1,10 +1,10 @@
-- set termguicolors to enable highlight groups
vim.opt.termguicolors = true
require("nvim-tree").setup()
vim.keymap.set("n", "<leader>pt", vim.cmd.NvimTreeToggle)
-- sets transparent background
vim.cmd[[hi NvimTreeNormal guibg=NONE ctermbg=NONE]]
-- -- set termguicolors to enable highlight groups
-- vim.opt.termguicolors = true
--
-- require("nvim-tree").setup()
--
-- vim.keymap.set("n", "<leader>pt", vim.cmd.NvimTreeToggle)
--
-- -- sets transparent background
-- vim.cmd[[hi NvimTreeNormal guibg=NONE ctermbg=NONE]]
--

View file

@ -8,19 +8,20 @@ require("telescope").setup{
local wk = require("which-key")
-- <leader> p
wk.register({p = { name = "project" }, prefix = "<leader>"})
vim.keymap.set("n", "<leader>p", "<noop>", {desc = "Project"})
vim.keymap.set("n", "<leader>pf", builtin.find_files, {desc = "Project find"})
vim.keymap.set("n", "<leader>ps", function ()
vim.keymap.set("n", "<leader>ps",
function ()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end , {desc = "Project search"})
end,
{ desc = "Project search" })
-- <leader> f
wk.register({f = { name = "find" }, prefix = "<leader>"})
-- wk.add({f = { name = "find" }, prefix = "<leader>"})
vim.keymap.set("n", "<leader>fr", builtin.oldfiles, { desc = "Find recent" })
-- <leader> h
wk.register({h = { name = "help" }, prefix = "<leader>"})
-- wk.add({h = { name = "help" }, prefix = "<leader>"})
vim.keymap.set("n", "<leader>ht", builtin.colorscheme, { desc = "Load theme" })
vim.keymap.set("n", "<leader>hf", builtin.commands , { desc = "Describe function" })
vim.keymap.set("n", "<leader>hk", builtin.keymaps , { desc = "Describe key" })

View file

@ -1,11 +1,11 @@
require("which-key").setup({
window = {
win = {
border = "single", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 0, 0, 0, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
padding = { 0, 2, 0, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent
padding = { 0, 0, 0, 0 }, -- extra window padding [top, right, bottom, left]
zindex = 1000, -- positive value to position WhichKey above other floating windows.
wo = {
winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent
},
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
@ -14,3 +14,4 @@ require("which-key").setup({
align = "left", -- align columns left, center or right
},
})