mirror of
https://git.aramjonghu.nl/AramJonghu/nvim.git
synced 2026-03-22 09:41:10 +01:00
fuck sessions
This commit is contained in:
+24
-24
@@ -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,
|
||||
-- })
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
-- },
|
||||
}
|
||||
Reference in New Issue
Block a user