1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-03-28 10:24:47 +01:00

NVIM: Improved structure and improved lazy loading

This commit is contained in:
2026-03-27 04:45:15 +01:00
parent 17a2e9f0ca
commit 8911a7c241
49 changed files with 396 additions and 346 deletions

View File

@@ -76,6 +76,7 @@
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
"tccs.nvim": { "branch": "master", "commit": "23fabbb0a65517307e571f63fe7a3760670086fe" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
"telescope-words.nvim": { "branch": "main", "commit": "295d51fe1e525fee18c0c164ad0ae5fb23273aa0" },
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
"tidy.nvim": { "branch": "main", "commit": "8b6921150b16f38f48a2459a844a0c2b4c916914" },

View File

@@ -0,0 +1,15 @@
return {
-- display available options for highlighted word
"tiyn/action-hints.nvim",
lazy = true, -- load as dependency
config = function()
require("action-hints").setup({
template = {
-- definition = { text = "D", color = "#add8e6" },
-- references = { text = "R%s", color = "#ff6666" },
definition = { text = Definition_sign, color = "#add8e6" },
references = { text = Reference_sign, color = "#ff6666" },
},
})
end,
}

View File

@@ -7,6 +7,7 @@ return {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons", -- optional dependency
},
lazy = false,
opts = {
theme = {
normal = { bg = "#272727" },

View File

@@ -1,8 +1,9 @@
return {
-- rainbow auto-pairs
-- rainbow and auto-pairs for parenthesis
"saghen/blink.pairs",
version = "*", -- (recommended) only required with prebuilt binaries
dependencies = "saghen/blink.download", -- download prebuilt binaries from github releases
dependencies = { "saghen/blink.download" }, -- download prebuilt binaries from github releases
lazy = false,
--- @module 'blink.pairs'
--- @type blink.pairs.Config
opts = {

View File

@@ -0,0 +1,5 @@
return {
-- nvim-cmp source for lsp
"hrsh7th/cmp-nvim-lsp",
lazy = true, -- load as dependency
}

View File

@@ -1,5 +1,6 @@
return {
-- commenting improvements
"numtostr/comment.nvim",
lazy = false,
opts = {},
}

View File

@@ -1,8 +1,7 @@
return {
-- improved csv handling
"hat0uma/csvview.nvim",
ft = "csv",
cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" },
ft = { "csv" },
opts = {
parser = { comments = { "#", "//" } },
keymaps = {

View File

@@ -0,0 +1,117 @@
return {
-- better predefined window layouts
"folke/edgy.nvim",
lazy = true, -- load as dependency
init = function()
vim.opt.laststatus = 3
vim.opt.splitkeep = "screen" -- or "topline" or "screen"
end,
opts = {
exit_when_last = false,
animate = {
enabled = false,
},
wo = {
winbar = true,
winfixwidth = true,
winfixheight = false,
winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
spell = false,
signcolumn = "no",
},
keys = {
-- -- close window
["q"] = function(win)
win:close()
end,
-- close sidebar
["Q"] = function(win)
win.view.edgebar:close()
end,
-- increase width
["<S-Right>"] = function(win)
win:resize("width", 3)
end,
-- decrease width
["<S-Left>"] = function(win)
win:resize("width", -3)
end,
-- increase height
["<S-Up>"] = function(win)
win:resize("height", 3)
end,
-- decrease height
["<S-Down>"] = function(win)
win:resize("height", -3)
end,
},
right = {
{
title = "OGPT Popup",
ft = "ogpt-popup",
size = { width = 0.2 },
wo = {
wrap = true,
},
},
{
title = "OGPT Parameters",
ft = "ogpt-parameters-window",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT Template",
ft = "ogpt-template",
size = { height = 6 },
},
{
title = "OGPT Sessions",
ft = "ogpt-sessions",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT System Input",
ft = "ogpt-system-window",
size = { height = 6 },
},
{
title = "OGPT",
ft = "ogpt-window",
size = { height = 0.5 },
wo = {
wrap = true,
},
},
{
title = "OGPT {{{selection}}}",
ft = "ogpt-selection",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPt {{{instruction}}}",
ft = "ogpt-instruction",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPT Chat",
ft = "ogpt-input",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
},
},
}

View File

@@ -1,4 +1,5 @@
return {
-- rename files in buffer
"tiyn/file-renamer.nvim",
cmd = { "Ren", "Renamer" },
}

View File

@@ -1,5 +1,6 @@
return {
-- display git status per line
"lewis6991/gitsigns.nvim",
lazy = true, -- load as dependency
opts = {},
}

View File

@@ -1,7 +1,7 @@
return {
-- preview definitions using floating windows
"rmagatti/goto-preview",
dependencies = "rmagatti/logger.nvim",
dependencies = { "rmagatti/logger.nvim" },
keys = {
{
"gpd",

View File

@@ -0,0 +1,14 @@
return {
-- display images inside neovim
"3rd/image.nvim",
lazy = true, -- load as dependency
opts = {
backend = "ueberzug",
max_width = 100,
max_height = 12,
max_height_window_percentage = math.huge,
max_width_window_percentage = math.huge,
window_overlap_clear_enabled = true,
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
},
}

View File

@@ -1,7 +1,7 @@
return {
-- show indentation lines
"lukas-reineke/indent-blankline.nvim",
event = "BufReadPre",
lazy = false,
main = "ibl",
opts = {},
}

View File

@@ -0,0 +1,10 @@
return {
-- open jupyter notebooks as their plain text alternatives
"GCBallesteros/jupytext.nvim",
lazy = true, -- load as dependency
opts = {
style = "markdown",
output_extension = "md",
force_ft = "markdown",
},
}

View File

@@ -1,6 +1,7 @@
return {
-- show function signature while typing
"ray-x/lsp_signature.nvim",
lazy = false,
opts = {
bind = true,
handler_opts = {

View File

@@ -4,26 +4,10 @@ return {
dependencies = {
"nvim-tree/nvim-web-devicons",
"tiyn/tccs.nvim",
{
"f-person/git-blame.nvim",
config = function()
vim.g.gitblame_display_virtual_text = 0
end,
},
{
"tiyn/action-hints.nvim",
config = function()
require("action-hints").setup({
template = {
-- definition = { text = "D", color = "#add8e6" },
-- references = { text = "R%s", color = "#ff6666" },
definition = { text = Definition_sign, color = "#add8e6" },
references = { text = Reference_sign, color = "#ff6666" },
},
})
end,
},
},
lazy = false,
opts = {
options = {
globalstatus = true,

View File

@@ -0,0 +1,11 @@
return {
-- snippet support
"l3mon4d3/luasnip",
version = "v2.*",
dependencies = { "saadparwaiz1/cmp_luasnip" },
lazy = true, -- load as dependency
-- build = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
}

View File

@@ -0,0 +1,23 @@
return {
-- bridge mason and null-ls
"jay-babu/mason-null-ls.nvim",
lazy = true, -- load as dependency
opts = {
automatic_installation = true,
ensure_installed = {
-- assembler
"asmfmt",
-- lua
"stylua",
-- markdown
"mdformat",
-- python
"isort",
"yapf",
-- shell
"shfmt",
-- yaml
"yamlfmt",
},
},
}

View File

@@ -2,49 +2,9 @@ return {
-- lang server installations
"williamboman/mason.nvim",
dependencies = {
{
"nvimtools/none-ls.nvim",
config = function()
require("null-ls").setup({
sources = {
-- assembler
require("null-ls").builtins.formatting.asmfmt,
-- lua
require("null-ls").builtins.formatting.stylua,
-- markdown
require("null-ls").builtins.formatting.mdformat,
-- python
require("null-ls").builtins.formatting.isort,
require("null-ls").builtins.formatting.yapf,
-- shell
require("null-ls").builtins.formatting.shfmt,
-- yaml
require("null-ls").builtins.formatting.yamlfmt,
},
})
end,
},
{
"jay-babu/mason-null-ls.nvim",
opts = {
automatic_installation = true,
ensure_installed = {
-- assembler
"asmfmt",
-- lua
"stylua",
-- markdown
"mdformat",
-- python
"isort",
"yapf",
-- shell
"shfmt",
-- yaml
"yamlfmt",
},
},
},
},
lazy = false,
opts = { ui = { icons = Install_signs } },
}

View File

@@ -1,5 +1,6 @@
return {
-- decorations for the current line mode
"mvllow/modes.nvim",
lazy = false,
opts = {},
}

View File

@@ -1,108 +1,14 @@
return {
-- jupyter notebook support
"benlubas/molten-nvim",
build = ":UpdateRemotePlugins",
version = "^1.0.0",
dependencies = {
{
"3rd/image.nvim",
opts = {
backend = "ueberzug",
max_width = 100,
max_height = 12,
max_height_window_percentage = math.huge,
max_width_window_percentage = math.huge,
window_overlap_clear_enabled = true,
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
},
},
{
"quarto-dev/quarto-nvim",
dependencies = {
"jmbuhr/otter.nvim",
"nvim-treesitter/nvim-treesitter",
},
keys = {
{
"<leader>rc",
function()
require("quarto.runner").run_cell()
end,
desc = "Quarto: Run cell",
},
{
"<leader>ra",
function()
require("quarto.runner").run_above()
end,
desc = "Quarto: Run cell and above",
},
{
"<leader>rA",
function()
require("quarto.runner").run_all()
end,
desc = "Quarto: Run all cells",
},
{
"<leader>rl",
function()
require("quarto.runner").run_line()
end,
desc = "Quarto: Run line",
},
{
"<leader>rr",
function()
require("quarto.runner").run_range()
end,
desc = "Quarto: Run visual range",
},
{
"<leader>rL",
function()
require("quarto.runner").run_all(true)
end,
desc = "Quarto: Run all cells of all languages",
},
},
opts = {
lspFeatures = {
languages = { "python" },
chunks = "all",
diagnostics = {
enabled = true,
triggers = { "BufWritePost" },
},
completion = {
enabled = true,
},
},
codeRunner = {
enabled = true,
default_method = "molten",
},
},
config = function(_, opts)
local quarto = require("quarto")
quarto.setup(opts)
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
quarto.activate()
end,
})
end,
},
{
"GCBallesteros/jupytext.nvim",
opts = {
style = "markdown",
output_extension = "md",
force_ft = "markdown",
},
},
},
build = ":UpdateRemotePlugins",
lazy = false,
init = function()
vim.g.molten_auto_open_output = false
vim.g.molten_wrap_output = true

View File

@@ -1,6 +1,7 @@
return {
-- generate annotations automatically
"danymat/neogen",
lazy = false,
opts = {
snippet_engine = "luasnip",
},

View File

@@ -0,0 +1,24 @@
return {
-- inject lsp diagnostics, etc
"nvimtools/none-ls.nvim",
lazy = true, -- load as dependency
config = function()
require("null-ls").setup({
sources = {
-- assembler
require("null-ls").builtins.formatting.asmfmt,
-- lua
require("null-ls").builtins.formatting.stylua,
-- markdown
require("null-ls").builtins.formatting.mdformat,
-- python
require("null-ls").builtins.formatting.isort,
require("null-ls").builtins.formatting.yapf,
-- shell
require("null-ls").builtins.formatting.shfmt,
-- yaml
require("null-ls").builtins.formatting.yamlfmt,
},
})
end,
}

View File

@@ -4,22 +4,13 @@ return {
dependencies = {
"nvim-lua/plenary.nvim",
"onsails/lspkind-nvim",
-- cmp sources
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"uga-rosa/cmp-dictionary",
"lukas-reineke/cmp-under-comparator",
-- luasnip
{
"l3mon4d3/luasnip",
config = function()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
version = "v2.*",
-- build = "make install_jsregexp",
dependencies = "saadparwaiz1/cmp_luasnip",
},
},
lazy = false,
config = function()
local cmp = require("cmp")
cmp.setup({

View File

@@ -1,6 +1,7 @@
return {
-- showing color of hex values, etc
"ChristianChiarulli/nvim-colorizer.lua",
lazy = false,
opts = {
filetypes = {
"*",

View File

@@ -1,8 +1,8 @@
return {
-- lillypond integration
"martineausimon/nvim-lilypond-suite",
ft = "lilypond",
dependencies = "uga-rosa/cmp-dictionary",
dependencies = { "uga-rosa/cmp-dictionary" },
ft = { "lilypond" },
opts = {
lilypond = {
mappings = {

View File

@@ -3,22 +3,9 @@ return {
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason-lspconfig.nvim",
{
"mrcjkb/rustaceanvim",
version = "^6",
lazy = false,
},
{
"hrsh7th/cmp-nvim-lsp",
config = function()
Capabilities = require("cmp_nvim_lsp").default_capabilities()
Capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
end,
},
},
lazy = false,
opts = {
automatic_setup = true,
ensure_installed = {
@@ -69,12 +56,17 @@ return {
},
pyright = {},
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
for name, config in pairs(servers) do
vim.lsp.config(
name,
vim.tbl_extend("force", config, {
on_attach = on_attach,
capabilities = Capabilities,
capabilities = capabilities,
flags = default_flags,
})
)

View File

@@ -5,6 +5,7 @@ return {
"kevinhwang91/nvim-hlslens",
"lewis6991/gitsigns.nvim",
},
lazy = false,
opts = {
marks = {
Cursor = { highlight = "Normal" },

View File

@@ -2,6 +2,6 @@ return {
-- additional quote/parantheses funtions
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
lazy = false,
opts = {},
}

View File

@@ -1,13 +1,10 @@
return {
-- fileexplorer on the side
"nvim-tree/nvim-tree.lua",
cmd = "NvimTreeToggle",
dependencies = {
{
"nvim-tree/nvim-web-devicons",
lazy = true,
},
},
cmd = { "NvimTreeToggle" },
keys = {
{
"<F2>",

View File

@@ -3,19 +3,10 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
-- automatically close html-tags
{
"windwp/nvim-ts-autotag",
opts = {
opts = {
enable_close = true,
enable_rename = true,
},
},
},
-- 'p00f/nvim-ts-rainbow', -- color brackets
"windwp/nvim-ts-autotag", -- automatically close html-tags
"nvim-treesitter/nvim-treesitter-context",
},
lazy = false,
config = function()
local treesitter = require("nvim-treesitter")
treesitter.setup()

View File

@@ -0,0 +1,11 @@
return {
-- automatically close tags with treesitter
"windwp/nvim-ts-autotag",
lazy = true, -- load as dependency
opts = {
opts = {
enable_close = true,
enable_rename = true,
},
},
}

View File

@@ -0,0 +1,8 @@
return {
-- git blame support
"f-person/git-blame.nvim",
lazy = true,
config = function()
vim.g.gitblame_display_virtual_text = 0
end,
}

View File

@@ -1,127 +1,11 @@
return {
-- ollama llm integration
"huynle/ogpt.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
{
"folke/edgy.nvim",
event = "VeryLazy",
init = function()
vim.opt.laststatus = 3
vim.opt.splitkeep = "screen" -- or "topline" or "screen"
end,
opts = {
exit_when_last = false,
animate = {
enabled = false,
},
wo = {
winbar = true,
winfixwidth = true,
winfixheight = false,
winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
spell = false,
signcolumn = "no",
},
keys = {
-- -- close window
["q"] = function(win)
win:close()
end,
-- close sidebar
["Q"] = function(win)
win.view.edgebar:close()
end,
-- increase width
["<S-Right>"] = function(win)
win:resize("width", 3)
end,
-- decrease width
["<S-Left>"] = function(win)
win:resize("width", -3)
end,
-- increase height
["<S-Up>"] = function(win)
win:resize("height", 3)
end,
-- decrease height
["<S-Down>"] = function(win)
win:resize("height", -3)
end,
},
right = {
{
title = "OGPT Popup",
ft = "ogpt-popup",
size = { width = 0.2 },
wo = {
wrap = true,
},
},
{
title = "OGPT Parameters",
ft = "ogpt-parameters-window",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT Template",
ft = "ogpt-template",
size = { height = 6 },
},
{
title = "OGPT Sessions",
ft = "ogpt-sessions",
size = { height = 6 },
wo = {
wrap = true,
},
},
{
title = "OGPT System Input",
ft = "ogpt-system-window",
size = { height = 6 },
},
{
title = "OGPT",
ft = "ogpt-window",
size = { height = 0.5 },
wo = {
wrap = true,
},
},
{
title = "OGPT {{{selection}}}",
ft = "ogpt-selection",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPt {{{instruction}}}",
ft = "ogpt-instruction",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
{
title = "OGPT Chat",
ft = "ogpt-input",
size = { width = 80, height = 4 },
wo = {
wrap = true,
},
},
},
},
},
},
keys = {
{

View File

@@ -7,7 +7,12 @@ return {
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
},
lazy = false,
opts = {
enable_keymaps = false,
init_filetypes = { "yaml", "tex" }
},
config = function(_, opts)
require("papis").setup(opts)
end,
}

View File

@@ -1,10 +1,10 @@
return {
-- navigate between projects using telescope
"gnikdroy/projections.nvim",
branch = "pre_release",
dependencies = {
"nvim-telescope/telescope.nvim",
},
branch = "pre_release",
keys = {
{
"<leader>fp",

View File

@@ -0,0 +1,80 @@
return {
-- quarto support
"quarto-dev/quarto-nvim",
dependencies = {
"jmbuhr/otter.nvim",
"nvim-treesitter/nvim-treesitter",
},
lazy = true, -- load as dependency
keys = {
{
"<leader>rc",
function()
require("quarto.runner").run_cell()
end,
desc = "Quarto: Run cell",
},
{
"<leader>ra",
function()
require("quarto.runner").run_above()
end,
desc = "Quarto: Run cell and above",
},
{
"<leader>rA",
function()
require("quarto.runner").run_all()
end,
desc = "Quarto: Run all cells",
},
{
"<leader>rl",
function()
require("quarto.runner").run_line()
end,
desc = "Quarto: Run line",
},
{
"<leader>rr",
function()
require("quarto.runner").run_range()
end,
desc = "Quarto: Run visual range",
},
{
"<leader>rL",
function()
require("quarto.runner").run_all(true)
end,
desc = "Quarto: Run all cells of all languages",
},
},
opts = {
lspFeatures = {
languages = { "python" },
chunks = "all",
diagnostics = {
enabled = true,
triggers = { "BufWritePost" },
},
completion = {
enabled = true,
},
},
codeRunner = {
enabled = true,
default_method = "molten",
},
},
config = function(_, opts)
local quarto = require("quarto")
quarto.setup(opts)
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
quarto.activate()
end,
})
end,
}

View File

@@ -5,6 +5,10 @@ return {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
ft = { "markdown" },
cond = function()
return vim.fn.expand("%:e") ~= "ipynb"
end,
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {

View File

@@ -1,6 +1,6 @@
return {
-- color and improve git merge conflicts
"spacedentist/resolve.nvim",
event = { "BufReadPre", "BufNewFile" },
lazy = false,
opts = {},
}

View File

@@ -0,0 +1,6 @@
return {
-- support for rust
"mrcjkb/rustaceanvim",
version = "^6",
lazy = false, -- this plugin is already lazy
}

View File

@@ -0,0 +1,6 @@
return {
-- fzf support for telescope
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
lazy = true, -- load as dependency
}

View File

@@ -4,7 +4,7 @@ return {
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-telescope/telescope-fzf-native.nvim",
"archie-judd/telescope-words.nvim",
},
keys = {

View File

@@ -1,7 +1,7 @@
return {
-- display inline diagnostics
"rachartier/tiny-inline-diagnostic.nvim",
event = "VeryLazy",
lazy = false,
priority = 1000,
opts = {
preset = "classic",

View File

@@ -2,6 +2,7 @@ return {
-- todo symbols and highlighting
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
lazy = false,
opts = {
keywords = {
ERRO = { icon = Error_sign, color = "error" },

View File

@@ -1,12 +1,7 @@
return {
-- list of errors
"folke/trouble.nvim",
dependencies = {
{
"nvim-tree/nvim-web-devicons",
lazy = true,
},
},
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{
"<F4>",

View File

@@ -1,4 +1,5 @@
return {
-- highlight other occurences of the same word
"RRethy/vim-illuminate",
lazy = false,
}

View File

@@ -1,6 +1,6 @@
return {
-- highlighting for the viper verification language
"tiyn/viper.nvim",
event = { "BufReadPre *.vpr", "FileType viper" },
opts = {}
ft = { "viper" },
opts = {},
}

View File

@@ -1,6 +1,7 @@
return {
-- improved keybindings, previewing them
"folke/which-key.nvim",
lazy = false,
config = function()
require("which-key").add({
{ mode = "n", "g", desc = "LSP: goto" },

View File

@@ -2,15 +2,13 @@ return {
-- improved wild menu
"gelguy/wilder.nvim",
dependencies = {
{
"nvim-tree/nvim-web-devicons",
lazy = true,
},
"roxma/nvim-yarp",
"roxma/vim-hug-neovim-rpc",
"romgrk/fzy-lua-native",
"nixprime/cpsm",
},
lazy = false,
opts = {
modes = { ":", "/", "?" },
accept_key = "<CR>",