fuck sessions

This commit is contained in:
Zacharias-Brohn
2025-02-09 01:49:57 +01:00
parent a0ecbb3dc8
commit 8107eac37c
11 changed files with 102 additions and 275 deletions
-45
View File
@@ -1,45 +0,0 @@
require("auto-session").setup {
enabled = true,
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 = false,
continue_restore_on_error = true,
show_auto_restore_notif = false,
cwd_change_handling = false,
lsp_stop_on_restore = false,
log_level = "error",
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,
}),
}
+2 -1
View File
@@ -19,6 +19,7 @@ vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes:1"
vim.opt.isfname:append("@-@")
@@ -27,7 +28,7 @@ vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
vim.opt.textwidth = 0
vim.opt.textwidth = 80
vim.opt.formatoptions = "tcrqnj"
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
+2 -1
View File
@@ -3,7 +3,8 @@ pcall(function()
dofile(vim.g.base46_cache .. "treesitter")
end)
return {
require('nvim-treesitter.configs').setup {
build = ":TSUpdate",
ensure_installed = "all",
sync_install = false,
auto_install = true,
-3
View File
@@ -15,6 +15,3 @@ autocmd('LspAttach', {
end
})
vim.filetype.add({
pattern = { [".*/hypr/.*%.conf$"] = "hyprlang" },
})
+24 -24
View File
@@ -1,27 +1,27 @@
local autocmd = vim.api.nvim_create_autocmd
-- user event that loads after UIEnter + only if file buf is there
autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),
callback = function(args)
local file = vim.api.nvim_buf_get_name(args.buf)
local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
if not vim.g.ui_entered and args.event == "UIEnter" then
vim.g.ui_entered = true
end
if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then
vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false })
vim.api.nvim_del_augroup_by_name "NvFilePost"
vim.schedule(function()
vim.api.nvim_exec_autocmds("FileType", {})
if vim.g.editorconfig then
require("editorconfig").config(args.buf)
end
end)
end
end,
})
-- autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
-- group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),
-- callback = function(args)
-- local file = vim.api.nvim_buf_get_name(args.buf)
-- local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
--
-- if not vim.g.ui_entered and args.event == "UIEnter" then
-- vim.g.ui_entered = true
-- end
--
-- if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then
-- vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false })
-- vim.api.nvim_del_augroup_by_name "NvFilePost"
--
-- vim.schedule(function()
-- vim.api.nvim_exec_autocmds("FileType", {})
--
-- if vim.g.editorconfig then
-- require("editorconfig").config(args.buf)
-- end
-- end)
-- end
-- end,
-- })
+7 -8
View File
@@ -19,7 +19,6 @@ M.on_attach = function(_, bufnr)
end, opts "List workspace folders")
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
map("n", "<leader>ra", require "nvchad.lsp.renamer", opts "NvRenamer")
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action")
map("n", "gr", vim.lsp.buf.references, opts "Show references")
@@ -67,13 +66,13 @@ M.defaults = function()
globals = { "vim" },
},
workspace = {
library = {
vim.fn.expand "$VIMRUNTIME/lua",
vim.fn.expand "$VIMRUNTIME/lua/vim/lsp",
vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
"${3rd}/luv/library",
},
-- library = {
-- vim.fn.expand "$VIMRUNTIME/lua",
-- vim.fn.expand "$VIMRUNTIME/lua/vim/lsp",
-- vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
-- vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
-- "${3rd}/luv/library",
-- },
maxPreload = 100000,
preloadFileSize = 10000,
},
-169
View File
@@ -1,169 +0,0 @@
return {
"nvim-lua/plenary.nvim",
{
"nvchad/base46",
build = function()
require("base46").load_all_highlights()
end,
},
{
"nvchad/ui",
lazy = false,
config = function()
require "nvchad"
end,
},
"nvzone/volt",
"nvzone/menu",
{ "nvzone/minty", cmd = { "Huefy", "Shades" } },
{
"nvim-tree/nvim-web-devicons",
opts = function()
dofile(vim.g.base46_cache .. "devicons")
return { override = require "nvchad.icons.devicons" }
end,
},
{
"lukas-reineke/indent-blankline.nvim",
event = "User FilePost",
opts = {
indent = { char = "", highlight = "IblChar" },
scope = { char = "", highlight = "IblScopeChar" },
},
config = function(_, opts)
dofile(vim.g.base46_cache .. "blankline")
local hooks = require "ibl.hooks"
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
require("ibl").setup(opts)
dofile(vim.g.base46_cache .. "blankline")
end,
},
-- file managing , picker etc
{
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
opts = function()
return require "nvchad.configs.nvimtree"
end,
},
{
"folke/which-key.nvim",
keys = { "<leader>", "<c-w>", '"', "'", "`", "c", "v", "g" },
cmd = "WhichKey",
opts = function()
dofile(vim.g.base46_cache .. "whichkey")
return {}
end,
},
-- formatting!
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = { lua = { "stylua" } },
},
},
-- git stuff
{
"lewis6991/gitsigns.nvim",
event = "User FilePost",
opts = function()
return require "nvchad.configs.gitsigns"
end,
},
-- lsp stuff
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
opts = function()
return require "nvchad.configs.mason"
end,
},
{
"neovim/nvim-lspconfig",
event = "User FilePost",
config = function()
require("nvchad.configs.lspconfig").defaults()
end,
},
-- load luasnips + cmp related in insert mode only
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{
-- snippet plugin
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("luasnip").config.set_config(opts)
require "nvchad.configs.luasnip"
end,
},
-- autopairing of (){}[] etc
{
"windwp/nvim-autopairs",
opts = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
-- setup cmp for autopairs
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
},
-- cmp sources plugins
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
opts = function()
return require "nvchad.configs.cmp"
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
cmd = "Telescope",
opts = function()
return require "nvchad.configs.telescope"
end,
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- event = { "BufReadPost", "BufNewFile" },
-- cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
-- build = ":TSUpdate",
-- opts = function()
-- return require "nvchad.configs.treesitter"
-- end,
-- config = function(_, opts)
-- require("nvim-treesitter.configs").setup(opts)
-- end,
-- },
}
+44 -15
View File
@@ -1,4 +1,48 @@
return {
{
"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",
},
},
},
},
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
@@ -126,13 +170,6 @@ return {
end,
},
{
"rmagatti/auto-session",
config = function()
require "configs.auto-session"
end,
},
{
"smolck/command-completion.nvim",
opts = {
@@ -230,14 +267,6 @@ return {
end,
},
{
"neovim/nvim-lspconfig",
event = "User FilePost",
config = function()
require("nvchad.configs.lspconfig").defaults()
end,
},
-- load luasnips + cmp related in insert mode only
{
"hrsh7th/nvim-cmp",