update nvim

This commit is contained in:
zack 2024-11-14 23:40:28 -05:00
parent 9aa6f3fdbe
commit 5eec7f512f
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
6 changed files with 170 additions and 4 deletions

8
flake.lock generated
View file

@ -2395,11 +2395,11 @@
"systems": "systems_18" "systems": "systems_18"
}, },
"locked": { "locked": {
"lastModified": 1730322983, "lastModified": 1731607548,
"narHash": "sha256-zsKDqUT18EG9ceR1ieYzRwrU/J7cVdocyFoXvQ4QMDM=", "narHash": "sha256-a0xLkdgQ4TIJVtY8fXnidtmsqlg63V9YYM7Hf32m7pk=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "e3da619b0a04a0f02d437a784318f142807a1e94", "rev": "49677f2d9b2cb94c36fe7a9df2bd5e9a8c00b94f",
"revCount": 74, "revCount": 75,
"type": "git", "type": "git",
"url": "https://git.zoeys.computer/zoey/zoeys.computer" "url": "https://git.zoeys.computer/zoey/zoeys.computer"
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -1,3 +1,4 @@
-- Autocmds are automatically loaded on the VeryLazy event -- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here -- Add any additional autocmds here
-- Create autocommand group

View file

@ -7,6 +7,84 @@ return {
}, },
}, },
"f-person/git-blame.nvim", "f-person/git-blame.nvim",
{
"3rd/image.nvim",
build = false,
lazy = false,
config = function()
require("image").setup({
backend = "kitty",
kitty_method = "normal",
processor = "magick_cli",
integrations = {
markdown = {
enabled = true,
},
},
})
end,
},
{
"nvimdev/dashboard-nvim",
event = "VimEnter",
lazy = true,
opts = function()
local logo = ""
logo = string.rep("\n", 12) .. logo .. "\n\n"
local opts = {
theme = "hyper",
hide = {
statusline = true,
},
config = {
header = vim.split(logo, "\n"),
shortcut = {
{
desc = "Find File",
action = "lua LazyVim.pick()()",
key = "f",
},
{
desc = "New File",
action = "ene | startinsert",
key = "n",
},
{
desc = "Lazy",
action = "Lazy",
icon = "󰒲 ",
key = "l",
},
{
desc = "Quit",
action = function()
vim.api.nvim_input("<cmd>qa<cr>")
end,
key = "q",
},
},
packages = { enable = true }, -- show how many plugins neovim loaded
project = { enable = true, limit = 8 },
mru = { limit = 10 },
},
}
-- Handle reopening dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
return opts
end,
},
{ "nvim-lualine/lualine.nvim", enabled = false }, { "nvim-lualine/lualine.nvim", enabled = false },
-- { -- {
-- "nvim-neorg/neorg", -- "nvim-neorg/neorg",

View file

@ -39,6 +39,7 @@ in {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;
extraLuaPackages = ps: [ps.magick];
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# Formatters # Formatters
alejandra # Nix alejandra # Nix
@ -49,6 +50,8 @@ in {
stylua stylua
rustywind rustywind
imagemagick
# LSP # LSP
lua-language-server lua-language-server
nixd nixd
@ -136,6 +139,89 @@ in {
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require('config.lazy') require('config.lazy')
local dashboardImage = vim.api.nvim_create_augroup("DashboardImage", { clear = true })
local img = require("image").from_file("${./NeoVim.png}")
local is_visible = false
-- Known image dimensions
local IMG_WIDTH = 50 -- characters
local IMG_HEIGHT = 14 -- lines
-- Debug notification function
local function debug_notify(message)
-- vim.notify(message, vim.log.levels.INFO)
end
-- Function to calculate centered position
local function center_image()
local win_width = vim.o.columns
local win_height = vim.o.lines
local x = math.floor((win_width - IMG_WIDTH) / 2)
local y = math.floor((win_height - IMG_HEIGHT) / 6)
return math.max(0, x), math.max(0, y)
end
-- Function to update image position
local function update_image()
debug_notify("Attempting to update image. is_visible = " .. tostring(is_visible))
if is_visible then
local x, y = center_image()
debug_notify("Positioning image at x=" .. x .. ", y=" .. y)
img:clear()
img:render()
img:move(x, y)
end
end
-- Show image on both VimEnter and when dashboard buffer is created
vim.api.nvim_create_autocmd({ "VimEnter", "BufWinEnter", "BufEnter" }, {
group = dashboardImage,
callback = function(ev)
local filetype = vim.api.nvim_buf_get_option(ev.buf, "filetype")
debug_notify("Event triggered: " .. ev.event .. ", filetype: " .. filetype)
if filetype == "dashboard" then
debug_notify("Dashboard detected, setting visible")
is_visible = true
vim.schedule(update_image)
end
end,
})
-- Handle window resize
vim.api.nvim_create_autocmd("VimResized", {
group = dashboardImage,
callback = function()
debug_notify("Window resized")
update_image()
end,
})
-- Clear image when leaving dashboard
vim.api.nvim_create_autocmd("BufLeave", {
group = dashboardImage,
callback = function()
debug_notify("Leaving buffer")
is_visible = false
img:clear()
end,
})
-- Catch when returning to dashboard
vim.api.nvim_create_autocmd("FileType", {
group = dashboardImage,
pattern = "dashboard",
callback = function()
debug_notify("FileType dashboard detected")
is_visible = true
vim.schedule(update_image)
end,
})
-- Initial debug message
debug_notify("Dashboard image setup loaded")
''; '';
}; };

View file

@ -38,6 +38,7 @@ in {
set -g @catppuccin_flavor "mocha" set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "basic" set -g @catppuccin_window_status_style "basic"
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -g allow-passthrough on
set -g status-right-length 100 set -g status-right-length 100
set -g status-left-length 100 set -g status-left-length 100