This commit is contained in:
Zacharias-Brohn
2025-02-12 17:49:37 +01:00
parent 8107eac37c
commit 8b359f0b34
11 changed files with 259 additions and 200 deletions
+26 -1
View File
@@ -6,7 +6,20 @@
local M = {}
M.base46 = {
theme = "gruvbox",
theme = "one_light",
theme_toggle = {
"one_light",
"one_light",
},
-- transparency = true,
changed_themes = {
one_light = {
base_16 = {
base0B = "#3b743b"
}
}
}
-- hl_override = {
-- Comment = { italic = true },
@@ -14,4 +27,16 @@ M.base46 = {
-- },
}
M.ui = {
statusline = {
theme = "default",
separator_style = "round",
},
tabufline = {
enabled = true,
lazyload = false,
}
}
return M
+45
View File
@@ -0,0 +1,45 @@
require("auto-session").setup {
enabled = true,
-- log_level = 'debug',
root_dir = vim.fn.stdpath "data" .. "/sessions/",
auto_save = true,
auto_restore = true,
auto_create = true,
suppressed_dirs = "/home/zach",
allowed_dirs = nil,
auto_restore_last_session = false,
use_git_branch = false,
lazy_support = true,
bypass_save_filetypes = nil,
close_unsupported_windows = true,
args_allow_single_directory = true,
args_allow_files_auto_save = true,
continue_restore_on_error = true,
show_auto_restore_notif = true,
cwd_change_handling = false,
lsp_stop_on_restore = false,
session_lens = {
load_on_setup = true,
theme_conf = {
-- test
},
previewer = false,
mappings = {
delete_session = { "i", "<C-D>" },
alternate_session = { "i", "<C-S>" },
copy_session = { "i", "<C-Y>" },
},
session_control = {
control_dir = vim.fn.stdpath "data" .. "/auto_session/",
control_filename = "session_control.json",
},
},
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
callback = function()
vim.cmd( "SessionSave" )
end,
}),
}
+5 -1
View File
@@ -1,7 +1,11 @@
require("CopilotChat").setup {
system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of a jerk. Do not use profanity.",
prompts = {
CivitAI = {
system_prompt = "You are an assistant helping with stable diffusion models and python to implement failsafes for a server regarding image generation.",
},
Insult = {
system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of a jerk, and make sure to insult the user a lot. Use vulgar language if necessary.",
}
}
},
}
+5 -17
View File
@@ -87,7 +87,6 @@ vim.diagnostic.config({
})
local lspconfig = require "lspconfig"
local nvlsp = require "nvchad.configs.lspconfig"
-- EXAMPLE
local servers = {
@@ -102,25 +101,14 @@ local servers = {
"zls",
}
for _, server in ipairs(servers) do
lspconfig[server].setup {
}
end
-- lspconfig.hyprls.setup {
-- root_dir = vim.fs.root( 0, 'hyprland.conf' ),
-- single_file_support = false,
-- filetypes = { "conf" },
-- }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }
+23
View File
@@ -0,0 +1,23 @@
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Load all the default modules
["core.concealer"] = {}, -- Allows for use of icons
["core.highlights"] = {},
["core.autocommands"] = {},
["core.integrations.treesitter"] = {},
["core.neorgcmd"] = {},
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
my_workspace = "~/neorg"
}
}
},
["core.export"] = {}, -- Export functionality
["core.latex.renderer"] = {
config = {
render_on_enter = true,
}
}
}
})
+97 -80
View File
@@ -2,7 +2,23 @@ vim.notify = require('notify')
local dap = require('dap')
require('notify').setup({
max_width = 40,
render = "wrapped-default",
timeout = 6000,
max_width = 50,
minimum_width = 50,
level = "info",
fps = 60,
icons = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = "",
},
on_open = function(win)
-- vim.api.nvim_win_set_option(win, 'wrap', true)
vim.api.nvim_win_set_option(win, 'breakat', ' ')
end,
})
-- Utility functions shared between progress reports for LSP and DAP
@@ -10,133 +26,134 @@ require('notify').setup({
local client_notifs = {}
local function get_notif_data(client_id, token)
if not client_notifs[client_id] then
client_notifs[client_id] = {}
end
if not client_notifs[client_id] then
client_notifs[client_id] = {}
end
if not client_notifs[client_id][token] then
client_notifs[client_id][token] = {}
end
if not client_notifs[client_id][token] then
client_notifs[client_id][token] = {}
end
return client_notifs[client_id][token]
return client_notifs[client_id][token]
end
local spinner_frames = { "", "", "", "", "", "", "", "" }
local function update_spinner(client_id, token)
local notif_data = get_notif_data(client_id, token)
local notif_data = get_notif_data(client_id, token)
if notif_data.spinner then
local new_spinner = (notif_data.spinner + 1) % #spinner_frames
notif_data.spinner = new_spinner
if notif_data.spinner then
local new_spinner = (notif_data.spinner + 1) % #spinner_frames
notif_data.spinner = new_spinner
notif_data.notification = vim.notify(nil, nil, {
hide_from_history = true,
icon = spinner_frames[new_spinner],
replace = notif_data.notification,
})
notif_data.notification = vim.notify(nil, nil, {
hide_from_history = true,
icon = spinner_frames[new_spinner],
replace = notif_data.notification,
})
vim.defer_fn(function()
update_spinner(client_id, token)
end, 100)
end
vim.defer_fn(function()
update_spinner(client_id, token)
end, 100)
end
end
local function format_title(title, client_name)
return client_name .. (#title > 0 and ": " .. title or "")
return client_name .. (#title > 0 and ": " .. title or "")
end
local function format_message(message, percentage)
return (percentage and percentage .. "%\t" or "") .. (message or "")
return (percentage and percentage .. "%\t" or "") .. (message or "")
end
-- LSP integration
-- Make sure to also have the snippet with the common helper functions in your config!
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
local client_id = ctx.client_id
local client_id = ctx.client_id
local val = result.value
local val = result.value
if not val.kind then
return
end
if not val.kind then
return
end
local notif_data = get_notif_data(client_id, result.token)
local notif_data = get_notif_data(client_id, result.token)
if val.kind == "begin" then
local message = format_message(val.message, val.percentage)
if val.kind == "begin" then
local message = format_message(val.message, val.percentage)
notif_data.notification = vim.notify(message, "info", {
title = format_title(val.title, vim.lsp.get_client_by_id(client_id).name),
icon = spinner_frames[1],
timeout = false,
hide_from_history = false,
})
notif_data.notification = vim.notify(message, "info", {
title = format_title(val.title, vim.lsp.get_client_by_id(client_id).name),
icon = spinner_frames[1],
timeout = false,
hide_from_history = false,
})
notif_data.spinner = 1
update_spinner(client_id, result.token)
elseif val.kind == "report" and notif_data then
notif_data.notification = vim.notify(format_message(val.message, val.percentage), "info", {
replace = notif_data.notification,
hide_from_history = false,
})
elseif val.kind == "end" and notif_data then
notif_data.notification =
vim.notify(val.message and format_message(val.message) or "Complete", "info", {
icon = "",
replace = notif_data.notification,
timeout = 3000,
})
notif_data.spinner = 1
update_spinner(client_id, result.token)
elseif val.kind == "report" and notif_data then
notif_data.notification = vim.notify(format_message(val.message, val.percentage), "info", {
replace = notif_data.notification,
hide_from_history = false,
})
elseif val.kind == "end" and notif_data then
notif_data.notification =
vim.notify(val.message and format_message(val.message) or "Complete", "info", {
icon = "",
replace = notif_data.notification,
timeout = 6000,
})
notif_data.spinner = nil
end
notif_data.spinner = nil
end
end
-- table from lsp severity to vim severity.
local severity = {
"error",
"warn",
"info",
"info", -- map both hint and info to info?
"error",
"warn",
"info",
"info", -- map both hint and info to info?
}
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
vim.notify(method.message, severity[params.type])
vim.notify(method.message, severity[params.type])
end
-- DAP integration
-- Make sure to also have the snippet with the common helper functions in your config!
dap.listeners.before['event_progressStart']['progress-notifications'] = function(session, body)
local notif_data = get_notif_data("dap", body.progressId)
local notif_data = get_notif_data("dap", body.progressId)
local message = format_message(body.message, body.percentage)
notif_data.notification = vim.notify(message, "info", {
title = format_title(body.title, session.config.type),
icon = spinner_frames[1],
timeout = false,
hide_from_history = false,
})
local message = format_message(body.message, body.percentage)
notif_data.notification = vim.notify(message, "info", {
title = format_title(body.title, session.config.type),
icon = spinner_frames[1],
timeout = false,
hide_from_history = false,
})
notif_data.notification.spinner = 1,
update_spinner("dap", body.progressId)
notif_data.notification.spinner = 1,
update_spinner("dap", body.progressId)
end
dap.listeners.before['event_progressUpdate']['progress-notifications'] = function(session, body)
local notif_data = get_notif_data("dap", body.progressId)
notif_data.notification = vim.notify(format_message(body.message, body.percentage), "info", {
replace = notif_data.notification,
hide_from_history = false,
})
local notif_data = get_notif_data("dap", body.progressId)
notif_data.notification = vim.notify(format_message(body.message, body.percentage), "info", {
replace = notif_data.notification,
hide_from_history = false,
})
end
dap.listeners.before['event_progressEnd']['progress-notifications'] = function(session, body)
local notif_data = client_notifs["dap"][body.progressId]
notif_data.notification = vim.notify(body.message and format_message(body.message) or "Complete", "info", {
icon = "",
replace = notif_data.notification,
timeout = 3000
})
notif_data.spinner = nil
local notif_data = client_notifs["dap"][body.progressId]
notif_data.notification = vim.notify(body.message and format_message(body.message) or "Complete", "info", {
icon = "",
replace = notif_data.notification,
timeout = 6000
})
notif_data.spinner = nil
end
+1 -22
View File
@@ -1,68 +1,47 @@
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.nvim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes:1"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
vim.opt.textwidth = 80
vim.opt.formatoptions = "tcrqnj"
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.o.laststatus = 3
vim.o.clipboard = "unnamedplus"
vim.o.cursorline = true
vim.o.cursorlineopt = "number"
vim.opt.fillchars = { eob = " " }
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.mouse = "a"
vim.o.number = true
vim.o.numberwidth = 3
vim.o.ruler = false
vim.o.showmode = false
vim.opt.shortmess:append "sI"
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.timeoutlen = 400
vim.opt.whichwrap:append "<>[]hl"
vim.g.loaded_node_provider = 0
vim.g.loaded_python3_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_ruby_provider = 0
-- add binaries installed by mason.nvim to path
local is_windows = vim.fn.has "win32" ~= 0
local sep = is_windows and "\\" or "/"
local delim = is_windows and ";" or ":"
+17 -52
View File
@@ -1,46 +1,15 @@
return {
{
"vhyrro/luarocks.nvim",
priority = 1000,
config = true,
},
{
"cameronr/auto-session",
opts = {
enabled = true,
-- log_level = 'debug',
root_dir = vim.fn.stdpath "data" .. "/sessions/",
auto_save = true,
auto_restore = true,
auto_create = true,
suppressed_dirs = nil,
allowed_dirs = nil,
auto_restore_last_session = false,
use_git_branch = false,
lazy_support = true,
bypass_save_filetypes = nil,
close_unsupported_windows = true,
args_allow_single_directory = true,
args_allow_files_auto_save = true,
continue_restore_on_error = false,
show_auto_restore_notif = true,
cwd_change_handling = false,
lsp_stop_on_restore = false,
session_lens = {
load_on_setup = true,
theme_conf = {
-- test
},
previewer = false,
mappings = {
delete_session = { "i", "<C-D>" },
alternate_session = { "i", "<C-S>" },
copy_session = { "i", "<C-Y>" },
},
session_control = {
control_dir = vim.fn.stdpath "data" .. "/auto_session/",
control_filename = "session_control.json",
},
},
},
opts = function()
return require "configs.auto-session"
end,
},
{
@@ -100,18 +69,6 @@ return {
end,
},
-- {
-- "mfussenegger/nvim-jdtls",
-- lazy = true,
-- dependencies = {
-- "mfussenegger/nvim-dap",
-- },
-- config = function()
-- require "configs.jdtls"
-- end,
-- },
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
dependencies = {
@@ -321,4 +278,12 @@ return {
return require "nvchad.configs.telescope"
end,
},
{
"nvim-neorg/neorg",
dependencies = "3rd/image.nvim",
config = function()
require "configs.neorg"
end,
},
}