Skip to content

Commit

Permalink
perf(optimizations of events): faster loading time, updated events
Browse files Browse the repository at this point in the history
  • Loading branch information
daUnknownCoder committed Feb 17, 2024
1 parent 5dbd344 commit 9525944
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 46 deletions.
7 changes: 4 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ vim.cmd([[autocmd VimEnter * highlight Function gui=italic guifg=orange]])
vim.cmd([[autocmd VimEnter * highlight StatusLine gui=italic guibg=NONE]])
vim.cmd([[autocmd VimEnter * highlight StatusLineNC gui=italic guibg=NONE]])
vim.cmd([[autocmd VimEnter * highlight NvimTreeIndentMarker guifg=#61afef]])
vim.cmd([[autocmd VimEnter * filetype plugin indent on]])
vim.cmd([[autocmd VimEnter * syntax on]])
vim.cmd([[autocmd BufRead,BufNewFile *.qml setfiletype qmljs]])
vim.cmd([[autocmd BufReadPost,BufNewFile * filetype plugin indent on]])
vim.cmd([[autocmd BufReadPost,BufNewFile * syntax on]])
vim.cmd([[autocmd BufReadPost,BufNewFile * lua require("codewindow").toggle_minimap()]])
vim.cmd([[autocmd BufReadPost,BufNewFile *.qml setfiletype qmljs]])
vim.cmd([[autocmd BufWritePost ~/.local/share/chezmoi/* ! chezmoi apply --source-path "%"]])
3 changes: 1 addition & 2 deletions lua/NeutronVim/plugins/Coding/surround.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
"echasnovski/mini.surround",
event = { "BufReadPost", "BufNewFile" },
event = { "BufReadPre", "BufNewFile" },
lazy = true,
version = "*",
config = function()
Expand All @@ -16,7 +16,6 @@ return {
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
replace = "gsr", -- Replace surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
})
end,
Expand Down
1 change: 1 addition & 0 deletions lua/NeutronVim/plugins/Editor/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ return {
keys = {
{ "<C-n>", "<cmd>NvimTreeFindFileToggle<cr>", desc = "NvimTree" },
},
event = "VimEnter",
config = function()
local nvimtree_status_ok, nvimtree = pcall(require, "nvim-tree")
if not nvimtree_status_ok then
Expand Down
2 changes: 1 addition & 1 deletion lua/NeutronVim/plugins/Editor/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ return {
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
lazy = true,
event = "BufEnter",
keys = {
{ "ff", "<cmd>Telescope find_files<CR>", desc = "Find Files Fuzzily" },
{ "fg", "<cmd>Telescope live_grep<CR>", desc = "Find Text" },
Expand Down
2 changes: 1 addition & 1 deletion lua/NeutronVim/plugins/Git-Integration/git.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
"lewis6991/gitsigns.nvim",
event = "BufRead",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
keys = {
{ ";j", "<cmd>lua require('gitsigns').next_hunk()<CR>", desc = "Next Hunk" },
{ ";k", "<cmd>lua require('gitsigns').prev_hunk()<CR>", desc = "Prev Hunk" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ return {
require("barbecue.ui").update()
end,
})
end
end,
}
1 change: 1 addition & 0 deletions lua/NeutronVim/plugins/LSP/codeaction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
{ "\\a", "<cmd>lua require('actions-preview').code_actions()<CR>", desc = "CodeActionMenu" },
},
lazy = true,
event = "LspAttach",
config = function()
require("actions-preview").setup({
telescope = {
Expand Down
2 changes: 1 addition & 1 deletion lua/NeutronVim/plugins/LSP/mason.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
"williamboman/mason.nvim",
event = { "BufReadPost", "BufNewFile" },
event = { "BufReadPre", "BufNewFile" },
lazy = true,
dependencies = {
{ "williamboman/mason-lspconfig.nvim", cmd = { "LspInstall", "LspUninstall" } },
Expand Down
2 changes: 1 addition & 1 deletion lua/NeutronVim/plugins/LSP/none-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
dependencies = {
"jay-babu/mason-null-ls.nvim",
},
event = { "BufReadPre", "BufNewFile" },
event = "VimEnter",
lazy = true,
config = function()
local none_ls_status_ok, none_ls = pcall(require, "null-ls")
Expand Down
2 changes: 1 addition & 1 deletion lua/NeutronVim/plugins/UI/noice.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
event = "VimEnter",
lazy = true,
opts = {
lsp = {
Expand Down
13 changes: 13 additions & 0 deletions lua/NeutronVim/plugins/Utils/codewindow.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
"gorbit99/codewindow.nvim",
config = function()
local codewindow_status_ok, codewindow = pcall(require, "codewindow")
if not codewindow_status_ok then
print("codewindow not found!")
end
codewindow.setup({
auto_enable = true,
width_multiplier = 5,
})
end,
}
11 changes: 0 additions & 11 deletions lua/NeutronVim/plugins/Utils/minimap.lua

This file was deleted.

47 changes: 23 additions & 24 deletions lua/NeutronVim/plugins/Utils/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
lazy = true,
event = { "BufReadPost", "BufNewFile" },
event = { "BufEnter" },
version = false,
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
config = function()
Expand All @@ -14,21 +14,31 @@ return {
---@diagnostic disable-next-line: missing-fields
treesitter.setup({
ensure_installed = {
"vimdoc",
"javascript",
"bash",
"c",
"css",
"diff",
"html",
"hyprlang",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"json",
"vim",
"regex",
"markdown_inline",
"bash",
"toml",
"html",
"rust",
"css",
"tsx",
"typescript",
"vim",
"vimdoc",
"yaml",
},
sync_install = false,
auto_install = true,
Expand All @@ -49,12 +59,15 @@ return {
},
},
})
vim.filetype.add({
pattern = { [".*/hyprland%.conf"] = "hyprlang" },
})
end,
},
{
"nvim-treesitter/playground",
keys = {
{ "<leader>ml", "<cmd>TSPlaygroundToggle<CR>", desc = "Toggle Playground" },
{ "<leader>mp", "<cmd>TSPlaygroundToggle<CR>", desc = "Toggle Playground" },
},
cmd = "TSPlaygroundToggle",
lazy = true,
Expand Down Expand Up @@ -126,18 +139,4 @@ return {
})
end,
},
{
"luckasRanarison/tree-sitter-hypr",
event = "BufRead */hypr/*.conf",
config = function()
require("nvim-treesitter.parsers").get_parser_configs().hypr = {
install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hypr",
files = { "src/parser.c" },
branch = "master",
},
filetype = "hypr",
}
end,
},
}

0 comments on commit 9525944

Please sign in to comment.