feat(nvim): tidy old config, improve startup time
This commit is contained in:
@@ -98,13 +98,6 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- fix https://github.com/neovim/neovim/issues/21856
|
|
||||||
vim.api.nvim_create_autocmd({ "VimLeave" }, {
|
|
||||||
callback = function()
|
|
||||||
vim.fn.jobstart("", { detach = true })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- MkDir
|
-- MkDir
|
||||||
vim.api.nvim_create_user_command("MakeDirectory", function()
|
vim.api.nvim_create_user_command("MakeDirectory", function()
|
||||||
---@diagnostic disable-next-line: missing-parameter
|
---@diagnostic disable-next-line: missing-parameter
|
||||||
@@ -116,25 +109,3 @@ vim.api.nvim_create_user_command("MakeDirectory", function()
|
|||||||
vim.notify("Directory already exists", vim.log.levels.WARN, { title = "Nvim" })
|
vim.notify("Directory already exists", vim.log.levels.WARN, { title = "Nvim" })
|
||||||
end
|
end
|
||||||
end, { desc = "Create directory if it doesn't exist" })
|
end, { desc = "Create directory if it doesn't exist" })
|
||||||
|
|
||||||
-- Neovide config
|
|
||||||
if vim.g.neovide then
|
|
||||||
local global = vim.g
|
|
||||||
vim.o.guifont = "monospace:h14"
|
|
||||||
global.neovide_padding_top = 0
|
|
||||||
global.neovide_padding_bottom = 0
|
|
||||||
global.neovide_padding_right = 0
|
|
||||||
global.neovide_padding_left = 0
|
|
||||||
global.neovide_hide_mouse_when_typing = true
|
|
||||||
global.neovide_cursor_animation_length = 0.05
|
|
||||||
global.neovide_cursor_trail_size = 0.15
|
|
||||||
global.neovide_confirm_quit = true
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
|
||||||
callback = function()
|
|
||||||
-- A dumb way to clear annoying NeoVim startup screen
|
|
||||||
vim.cmd("normal ia")
|
|
||||||
vim.cmd("normal u")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -30,15 +30,14 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
lazy = false,
|
|
||||||
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
|
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
|
||||||
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-tree").setup(require("plugins.nvim-tree"))
|
require("nvim-tree").setup(require("plugins.nvim-tree"))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
@@ -51,16 +50,14 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
|
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.rainbow-delimiters")
|
require("plugins.rainbow-delimiters")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("ibl").setup(require("plugins.indent-blankline"))
|
require("ibl").setup(require("plugins.indent-blankline"))
|
||||||
end
|
end
|
||||||
@@ -68,7 +65,7 @@ local plugins = {
|
|||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = { "hrsh7th/cmp-nvim-lsp" },
|
dependencies = { "hrsh7th/cmp-nvim-lsp" },
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.lsp.lspconfig")
|
require("plugins.lsp.lspconfig")
|
||||||
require("plugins.lsp.others")
|
require("plugins.lsp.others")
|
||||||
@@ -129,7 +126,7 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
dependencies = { { "rafamadriz/friendly-snippets", lazy = true } },
|
dependencies = { { "rafamadriz/friendly-snippets", lazy = true } },
|
||||||
build = "make install_jsregexp",
|
build = "make install_jsregexp",
|
||||||
config = function()
|
config = function()
|
||||||
@@ -146,23 +143,21 @@ local plugins = {
|
|||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
"onsails/lspkind.nvim"
|
"onsails/lspkind.nvim"
|
||||||
},
|
},
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("cmp").setup(require("plugins.cmp.cmp"))
|
require("cmp").setup(require("plugins.cmp.cmp"))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("Comment").setup(require("plugins.comment"))
|
require("Comment").setup(require("plugins.comment"))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "hrsh7th/nvim-cmp" },
|
dependencies = { "hrsh7th/nvim-cmp" },
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-autopairs").setup(require("plugins.autopairs"))
|
require("nvim-autopairs").setup(require("plugins.autopairs"))
|
||||||
@@ -170,15 +165,13 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
lazy = false,
|
|
||||||
config = function()
|
config = function()
|
||||||
require("bufferline").setup(require("plugins.bufferline"))
|
require("bufferline").setup(require("plugins.bufferline"))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("gitsigns").setup(require("plugins.gitsigns"))
|
require("gitsigns").setup(require("plugins.gitsigns"))
|
||||||
end
|
end
|
||||||
@@ -193,23 +186,13 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alexghergh/nvim-tmux-navigation",
|
"alexghergh/nvim-tmux-navigation",
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
|
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"natecraddock/sessions.nvim",
|
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("sessions").setup(require("plugins.sessions"))
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"natecraddock/workspaces.nvim",
|
"natecraddock/workspaces.nvim",
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = { "nvim-telescope/telescope.nvim", "natecraddock/sessions.nvim" },
|
dependencies = { "nvim-telescope/telescope.nvim", "natecraddock/sessions.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
@@ -237,13 +220,12 @@ local plugins = {
|
|||||||
end
|
end
|
||||||
}, ]]
|
}, ]]
|
||||||
{
|
{
|
||||||
"lukas-reineke/headlines.nvim",
|
'MeanderingProgrammer/render-markdown.nvim',
|
||||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||||
config = true, -- or `opts = {}`
|
opts = {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
@@ -259,7 +241,6 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"voldikss/vim-floaterm",
|
"voldikss/vim-floaterm",
|
||||||
lazy = false,
|
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.floaterm")
|
require("plugins.floaterm")
|
||||||
@@ -267,8 +248,7 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
lazy = false,
|
event = "BufEnter",
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -288,7 +268,7 @@ local plugins = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pest-parser/pest.vim",
|
"pest-parser/pest.vim",
|
||||||
event = "VeryLazy",
|
ft = "pest",
|
||||||
opts = {}
|
opts = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
M = {
|
|
||||||
events = { "VimLeavePre" },
|
|
||||||
indent = {
|
|
||||||
tab_char = "▏"
|
|
||||||
},
|
|
||||||
session_filepath = vim.fn.stdpath("data") .. "/session",
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user