Nvim is now running Lazy as its plugin Manager.

New keymaps
Nvim.leap instead of flash
This commit is contained in:
Thomas Naderer
2025-07-07 15:31:56 +02:00
parent e715400806
commit 83b031dfe5
10 changed files with 808 additions and 244 deletions

233
nvim/lua/plugins/init.lua Normal file
View File

@@ -0,0 +1,233 @@
-- ~/.config/nvim/lua/plugins/init.lua
return {
-- Colorschemes
{ "gruvbox-community/gruvbox", priority = 1000 },
{ "folke/tokyonight.nvim", priority = 1000 },
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{ "EdenEast/nightfox.nvim", priority = 1000 },
{ "rose-pine/neovim", name = "rose-pine", priority = 1000 },
{ "rebelot/kanagawa.nvim", priority = 1000 },
{ "sainnhe/everforest", priority = 1000 },
-- Auto-save
{
"okuuva/auto-save.nvim",
version = "v1.*",
event = { "InsertLeave", "TextChanged" },
opts = {
enabled = true,
execution_message = {
enabled = false,
},
trigger_events = {
immediate_save = { "BufLeave", "FocusLost" },
defer_save = { "InsertLeave", "TextChanged" },
cancel_defered_save = { "InsertEnter" },
},
},
},
-- File explorer
{ import = "plugins.nvim-tree" },
-- Treesitter
{ import = "plugins.treesitter" },
-- Rainbow delimiters
{ import = "plugins.rainbow_delimiters" },
-- Git integration
{
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
signcolumn = false, -- Disable signs by default
numhl = false, -- Disable number highlights by default
linehl = false, -- Disable line highlights by default
word_diff = false,
current_line_blame = false,
}
},
{ "tpope/vim-fugitive" },
-- Status line
{ import = "plugins.lualine" },
-- FZF
{
"junegunn/fzf",
build = function()
vim.fn["fzf#install"]()
end,
},
{ "junegunn/fzf.vim" },
-- Productivity
{ "numToStr/Comment.nvim", opts = {} },
{ "windwp/nvim-autopairs", opts = {} },
{ "tpope/vim-surround" },
-- Tmux navigation
{ "christoomey/vim-tmux-navigator" },
-- LaTeX
{ import = "plugins.vimtex" },
-- Org-mode
{
"nvim-orgmode/orgmode",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {},
},
-- Telescope
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>ff", ":Telescope find_files<CR>", desc = "Find files" },
{ "<leader>fg", ":Telescope live_grep<CR>", desc = "Live grep" },
{ "<leader>fb", ":Telescope buffers<CR>", desc = "Buffers" },
{ "<leader>fh", ":Telescope help_tags<CR>", desc = "Help tags" },
},
},
-- Yazi file manager
{
"mikavilpas/yazi.nvim",
keys = {
{ "<leader>y", ":Yazi<CR>", desc = "Open Yazi" },
},
opts = {
open_for_directories = false,
keymaps = {
show_help = "<F1>",
},
},
},
-- Leap (motion)
{
"ggandor/leap.nvim",
event = "VeryLazy",
config = function()
require('leap').add_default_mappings()
-- Override default s/S with f/F to avoid conflict with surround
vim.keymap.del({'n', 'x', 'o'}, 's')
vim.keymap.del({'n', 'x', 'o'}, 'S')
vim.keymap.set({'n', 'x', 'o'}, 'f', '<Plug>(leap-forward)')
vim.keymap.set({'n', 'x', 'o'}, 'F', '<Plug>(leap-backward)')
end,
},
-- Markdown
{ "SidOfc/mkdx" },
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" },
ft = { "markdown", "norg", "rmd", "org" },
config = function()
require('render-markdown').setup({
heading = {
enabled = true,
sign = true,
position = 'overlay',
icons = { '󰲡 ', '󰲣 ', '󰲥 ', '󰲧 ', '󰲩 ', '󰲫 ' },
backgrounds = {
'RenderMarkdownH1Bg',
'RenderMarkdownH2Bg',
'RenderMarkdownH3Bg',
'RenderMarkdownH4Bg',
'RenderMarkdownH5Bg',
'RenderMarkdownH6Bg',
},
foregrounds = {
'RenderMarkdownH1',
'RenderMarkdownH2',
'RenderMarkdownH3',
'RenderMarkdownH4',
'RenderMarkdownH5',
'RenderMarkdownH6',
},
},
})
-- Set highlights after ColorScheme event to ensure they persist
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
-- Translucent heading backgrounds with alpha blending
vim.api.nvim_set_hl(0, 'RenderMarkdownH1Bg', { bg = '#2d5a7b', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'RenderMarkdownH2Bg', { bg = '#3d5f4e', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'RenderMarkdownH3Bg', { bg = '#5f5e3a', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'RenderMarkdownH4Bg', { bg = '#5f4a3e', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'RenderMarkdownH5Bg', { bg = '#4e4a5f', fg = 'NONE' })
vim.api.nvim_set_hl(0, 'RenderMarkdownH6Bg', { bg = '#4a5e5f', fg = 'NONE' })
-- Bold, colored heading text
vim.api.nvim_set_hl(0, 'RenderMarkdownH1', { fg = '#88c0d0', bold = true })
vim.api.nvim_set_hl(0, 'RenderMarkdownH2', { fg = '#a3be8c', bold = true })
vim.api.nvim_set_hl(0, 'RenderMarkdownH3', { fg = '#ebcb8b', bold = true })
vim.api.nvim_set_hl(0, 'RenderMarkdownH4', { fg = '#d08770', bold = true })
vim.api.nvim_set_hl(0, 'RenderMarkdownH5', { fg = '#b48ead', bold = true })
vim.api.nvim_set_hl(0, 'RenderMarkdownH6', { fg = '#8fbcbb', bold = true })
end,
})
-- Apply highlights immediately
vim.schedule(function()
vim.cmd('doautocmd ColorScheme')
end)
end,
},
-- Code formatting
{ import = "plugins.prettier" },
-- Copilot
{
"zbirenbaum/copilot.lua",
event = "InsertEnter",
opts = {
suggestion = { enabled = true },
panel = { enabled = true },
},
},
-- Indent guides
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
},
-- UFO (folding)
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
event = "BufReadPost",
config = function()
vim.o.foldcolumn = "0"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
require("ufo").setup({
provider_selector = function(bufnr, filetype, buftype)
-- Disable for latex and markdown files
if filetype == "tex" or filetype == "latex" or filetype == "markdown" then
return ""
end
return { "treesitter", "indent" }
end,
})
end,
},
}

136
nvim/lua/plugins/lsp.lua Normal file
View File

@@ -0,0 +1,136 @@
-- ~/.config/nvim/lua/plugins/lsp.lua
return {
-- Mason (LSP installer)
{
"williamboman/mason.nvim",
build = ":MasonUpdate",
opts = {},
},
-- Mason LSP config integration
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "mason.nvim" },
opts = {
ensure_installed = { "lua_ls", "pyright", "texlab", "bashls", "marksman" },
},
},
-- LSP configuration
{
"neovim/nvim-lspconfig",
dependencies = {
"mason.nvim",
"mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Configure diagnostics to be hidden by default
vim.diagnostic.config({
virtual_text = false,
signs = false,
underline = false,
update_in_insert = false,
severity_sort = false,
})
-- Set up keymaps for LSP
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
end,
})
-- Language servers setup with capabilities
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.pyright.setup({
capabilities = capabilities,
})
lspconfig.texlab.setup({
capabilities = capabilities,
})
lspconfig.bashls.setup({
capabilities = capabilities,
})
lspconfig.marksman.setup({
capabilities = capabilities,
})
end,
},
-- Completion
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets", "evesdropper/luasnip-latex-snippets.nvim" },
build = "make install_jsregexp",
},
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
-- Load snippets
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/snippets" })
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if require("copilot.suggestion").is_visible() then
require("copilot.suggestion").accept()
elseif cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
})
end,
},
}

View File

@@ -1,73 +1,194 @@
local M = {} local colors = {
bg = "none",
fg = "#ebdbb2",
yellow = "#fabd2f",
cyan = "#8ec07c",
darkblue = "#458588",
green = "#b8bb26",
orange = "#fe8019",
violet = "#d3869b",
magenta = "#d3869b",
blue = "#83a598",
red = "#fb4934",
grey = "#504945",
black = "#282828",
white = "#fbf1c7",
darkgrey = "#3c3836",
lightgrey = "#665c54",
}
M.theme = function() local theme = {
local colors = {
darkgray = "#16161d",
gray = "#727169",
innerbg = nil,
outerbg = "#16161D",
normal = "#7e9cd8",
insert = "#98bb6c",
visual = "#ffa066",
replace = "#e46876",
command = "#e6c384",
}
return {
inactive = {
a = { fg = colors.gray, bg = colors.outerbg, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg },
c = { fg = colors.gray, bg = colors.innerbg },
},
visual = {
a = { fg = colors.darkgray, bg = colors.visual, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg },
c = { fg = colors.gray, bg = colors.innerbg },
},
replace = {
a = { fg = colors.darkgray, bg = colors.replace, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg },
c = { fg = colors.gray, bg = colors.innerbg },
},
normal = { normal = {
a = { fg = colors.darkgray, bg = colors.normal, gui = "bold" }, a = { fg = colors.black, bg = colors.blue, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg }, b = { fg = colors.blue, bg = colors.grey },
c = { fg = colors.gray, bg = colors.innerbg }, c = { fg = colors.white, bg = colors.darkgrey },
x = { fg = colors.white, bg = colors.darkgrey },
y = { fg = colors.blue, bg = colors.grey },
z = { fg = colors.black, bg = colors.blue, gui = "bold" },
}, },
insert = { insert = {
a = { fg = colors.darkgray, bg = colors.insert, gui = "bold" }, a = { fg = colors.black, bg = colors.green, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg }, b = { fg = colors.green, bg = colors.grey },
c = { fg = colors.gray, bg = colors.innerbg }, c = { fg = colors.white, bg = colors.darkgrey },
x = { fg = colors.white, bg = colors.darkgrey },
y = { fg = colors.green, bg = colors.grey },
z = { fg = colors.black, bg = colors.green, gui = "bold" },
},
visual = {
a = { fg = colors.black, bg = colors.magenta, gui = "bold" },
b = { fg = colors.magenta, bg = colors.grey },
c = { fg = colors.white, bg = colors.darkgrey },
x = { fg = colors.white, bg = colors.darkgrey },
y = { fg = colors.magenta, bg = colors.grey },
z = { fg = colors.black, bg = colors.magenta, gui = "bold" },
},
replace = {
a = { fg = colors.black, bg = colors.red, gui = "bold" },
b = { fg = colors.red, bg = colors.grey },
c = { fg = colors.white, bg = colors.darkgrey },
x = { fg = colors.white, bg = colors.darkgrey },
y = { fg = colors.red, bg = colors.grey },
z = { fg = colors.black, bg = colors.red, gui = "bold" },
}, },
command = { command = {
a = { fg = colors.darkgray, bg = colors.command, gui = "bold" }, a = { fg = colors.black, bg = colors.yellow, gui = "bold" },
b = { fg = colors.gray, bg = colors.outerbg }, b = { fg = colors.yellow, bg = colors.grey },
c = { fg = colors.gray, bg = colors.innerbg }, c = { fg = colors.white, bg = colors.darkgrey },
x = { fg = colors.white, bg = colors.darkgrey },
y = { fg = colors.yellow, bg = colors.grey },
z = { fg = colors.black, bg = colors.yellow, gui = "bold" },
}, },
} inactive = {
end a = { fg = colors.white, bg = colors.darkgrey },
b = { fg = colors.white, bg = colors.darkgrey },
c = { fg = colors.white, bg = colors.darkgrey },
},
}
require('lualine').setup { return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
event = "VeryLazy",
opts = {
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = M.theme(), -- Apply the custom theme theme = theme,
component_separators = { left = '', right = '' }, component_separators = { left = "", right = "" },
section_separators = { left = '', right = '' }, section_separators = { left = "", right = "" },
disabled_filetypes = { disabled_filetypes = {
statusline = {}, statusline = {},
winbar = {}, winbar = {},
}, },
ignore_focus = {}, ignore_focus = {},
always_divide_middle = true, always_divide_middle = true,
always_show_tabline = true, globalstatus = true,
globalstatus = false,
refresh = { refresh = {
statusline = 100, statusline = 100,
tabline = 100, tabline = 100,
winbar = 100, winbar = 100,
},
},
sections = {
lualine_a = {
{
"mode",
fmt = function(str)
local mode_map = {
["NORMAL"] = "N",
["INSERT"] = "I",
["VISUAL"] = "V",
["V-LINE"] = "VL",
["V-BLOCK"] = "VB",
["COMMAND"] = "C",
["REPLACE"] = "R",
["TERMINAL"] = "T"
} }
return mode_map[str] or str
end,
separator = { right = "" }
}
},
lualine_b = {
{
"branch",
icon = "󰘬",
separator = { right = "" }
},
{
"diff",
symbols = { added = "󰐕 ", modified = "󰝤 ", removed = "󰍵 " },
separator = { right = "" }
},
{
"diagnostics",
symbols = { error = "󰅚 ", warn = "󰀪 ", info = "󰋽 ", hint = "󰌶 " },
separator = { right = "" }
}
},
lualine_c = {
{
"filename",
path = 1,
shorting_target = 40,
symbols = { modified = "󰏫", readonly = "󰌾", unnamed = "󰡯" }
}
},
lualine_x = {
{
function()
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return ""
end
local client_names = {}
for _, client in pairs(clients) do
table.insert(client_names, client.name)
end
return "󰅠 " .. table.concat(client_names, ", ")
end,
color = { fg = colors.cyan },
separator = { left = "" }
},
{
"filesize",
cond = function() return vim.fn.getfsize(vim.fn.expand('%:p')) > 0 end,
separator = { left = "" }
},
{
"encoding",
cond = function() return vim.bo.fileencoding ~= 'utf-8' end,
separator = { left = "" }
},
{
"filetype",
icons_enabled = true,
separator = { left = "" }
}
},
lualine_y = {
{
"progress",
separator = { left = "" }
}
},
lualine_z = {
{
"location",
separator = { left = "" }
}
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { { "filename", path = 1 } },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
}, },
tabline = {}, tabline = {},
winbar = {}, winbar = {},
inactive_winbar = {}, inactive_winbar = {},
extensions = {} extensions = { "nvim-tree", "fzf", "lazy" },
},
} }

View File

@@ -0,0 +1,56 @@
return {
"marko-cerovac/material.nvim",
priority = 1000,
config = function()
require('material').setup({
contrast = {
terminal = false,
sidebars = false,
floating_windows = false,
cursor_line = false,
lsp_virtual_text = false,
non_current_windows = false,
filetypes = {},
},
styles = {
comments = { italic = true },
strings = {},
keywords = {},
functions = {},
variables = {},
operators = {},
types = {},
},
plugins = {
"dap",
"gitsigns",
"indent-blankline",
"lspsaga",
"mini",
"neo-tree",
"nvim-cmp",
"nvim-navic",
"nvim-tree",
"nvim-web-devicons",
"telescope",
"trouble",
"which-key",
},
disable = {
colored_cursor = false,
borders = false,
background = false,
term_colors = false,
eob_lines = false
},
high_visibility = {
lighter = false,
darker = false
},
lualine_style = "default",
async_loading = true,
custom_colors = nil,
custom_highlights = {},
})
end
}

View File

@@ -1,7 +1,29 @@
local M = {} return {
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "<leader>e", ":NvimTreeToggle<CR>", desc = "Toggle file tree" },
},
config = function()
vim.fn.sign_define("NvimTreeDiagnosticErrorIcon", { text = "", texthl = "DiagnosticError" })
vim.fn.sign_define("NvimTreeDiagnosticWarnIcon", { text = "", texthl = "DiagnosticWarn" })
vim.fn.sign_define("NvimTreeDiagnosticInfoIcon", { text = "", texthl = "DiagnosticInfo" })
vim.fn.sign_define("NvimTreeDiagnosticHintIcon", { text = "", texthl = "DiagnosticHint" })
function M.setup() local git_enabled = false
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) local function toggle_git_signs()
git_enabled = not git_enabled
require("nvim-tree").setup({
git = {
enable = git_enabled,
ignore = false,
},
})
require("nvim-tree.api").tree.reload()
print("Git signs " .. (git_enabled and "enabled" or "disabled"))
end
vim.keymap.set("n", "<leader>tg", toggle_git_signs, { desc = "Toggle git signs" })
require("nvim-tree").setup({ require("nvim-tree").setup({
view = { view = {
@@ -13,21 +35,21 @@ vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = tru
highlight_opened_files = "all", highlight_opened_files = "all",
icons = { icons = {
glyphs = { glyphs = {
default = "", default = "",
symlink = "", symlink = "",
folder = { folder = {
arrow_closed = "", arrow_closed = "",
arrow_open = "", arrow_open = "",
default = "", default = "",
open = "", open = "",
}, },
git = { git = {
unstaged = "", unstaged = "",
staged = "", staged = "",
unmerged = "", unmerged = "",
renamed = "", renamed = "",
untracked = "", untracked = "",
deleted = "", deleted = "",
ignored = "", ignored = "",
}, },
}, },
@@ -40,10 +62,10 @@ vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = tru
enable = true, enable = true,
show_on_dirs = true, show_on_dirs = true,
icons = { icons = {
hint = "", hint = "",
info = "", info = "",
warning = "", warning = "",
error = "", error = "",
}, },
}, },
filters = { filters = {
@@ -55,10 +77,9 @@ vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = tru
}, },
}, },
git = { git = {
enable = true, enable = false,
ignore = false, ignore = false,
}, },
}) })
end end,
}
return M

View File

@@ -1,20 +1,17 @@
-- plugins/outline.lua return {
local M = {} "hedyhli/outline.nvim",
cmd = "Outline",
M.setup = function() keys = {
vim.api.nvim_set_keymap('n', '<leader>o', ':Outline<CR>', { noremap = true, silent = true }) { "<leader>o", ":Outline<CR>", desc = "Toggle outline" },
require('outline').setup({
show_guides = true, -- Show outline guides
auto_close = false, -- Do not auto-close the outline
auto_open = true, -- Automatically open the outline
preview_lines = 10, -- Number of preview lines to show
keymaps = { -- Custom key mappings for the outline
jump = 'o', -- Jump to the selected item
expand_collapse = 'u', -- Expand or collapse an item
}, },
}) opts = {
end show_guides = true,
auto_close = false,
return M auto_open = true,
preview_lines = 10,
keymaps = {
jump = "o",
expand_collapse = "u",
},
},
}

View File

@@ -1,8 +1,14 @@
local null_ls = require("null-ls") return {
"nvimtools/none-ls.nvim",
null_ls.setup({ dependencies = { "nvim-lua/plenary.nvim" },
debug = false, -- set to true if you want log spam config = function()
local null_ls = require("null-ls")
null_ls.setup({
debug = false,
sources = { sources = {
-- null_ls.builtins.diagnostics.markdownlint.with({
-- filetypes = { "markdown", "markdown.pandoc", "pandoc" },
-- }),
null_ls.builtins.formatting.prettier.with({ null_ls.builtins.formatting.prettier.with({
filetypes = { "markdown", "markdown.pandoc", "pandoc" }, filetypes = { "markdown", "markdown.pandoc", "pandoc" },
}), }),
@@ -17,4 +23,6 @@ null_ls.setup({
}) })
end end
end, end,
}) })
end,
}

View File

@@ -1,29 +1,31 @@
-- Rainbow Delimiters Configuration return {
local rainbow_delimiters = require 'rainbow-delimiters' "HiPhish/rainbow-delimiters.nvim",
config = function()
local rainbow_delimiters = require("rainbow-delimiters")
---@type rainbow_delimiters.config ---@type rainbow_delimiters.config
vim.g.rainbow_delimiters = { vim.g.rainbow_delimiters = {
strategy = { strategy = {
[''] = rainbow_delimiters.strategy['global'], [""] = rainbow_delimiters.strategy["global"],
vim = rainbow_delimiters.strategy['local'], vim = rainbow_delimiters.strategy["local"],
}, },
query = { query = {
[''] = 'rainbow-delimiters', [""] = "rainbow-delimiters",
lua = 'rainbow-blocks', lua = "rainbow-blocks",
}, },
priority = { priority = {
[''] = 110, [""] = 110,
lua = 210, lua = 210,
}, },
highlight = { highlight = {
'RainbowDelimiterRed', "RainbowDelimiterRed",
'RainbowDelimiterYellow', "RainbowDelimiterYellow",
'RainbowDelimiterBlue', "RainbowDelimiterBlue",
'RainbowDelimiterOrange', "RainbowDelimiterOrange",
'RainbowDelimiterGreen', "RainbowDelimiterGreen",
'RainbowDelimiterViolet', "RainbowDelimiterViolet",
'RainbowDelimiterCyan', "RainbowDelimiterCyan",
}, },
}
end,
} }

View File

@@ -1,11 +1,22 @@
require'nvim-treesitter.configs'.setup { return {
ensure_installed = { "c", "lua", "python", "javascript", "markdown", "markdown_inline", "html", "css" }, "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "c", "lua", "python", "javascript", "markdown", "markdown_inline", "html", "css", "bash", "vim", "vimdoc" },
sync_install = false, sync_install = false,
auto_install = true, auto_install = true,
ignore_install = {},
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false,
disable = function(lang, buf) disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
local filename = vim.api.nvim_buf_get_name(buf) local filename = vim.api.nvim_buf_get_name(buf)
if lang == "latex" or filename:match("%.bib$") then if lang == "latex" or filename:match("%.bib$") then
return true return true
@@ -16,7 +27,7 @@ require'nvim-treesitter.configs'.setup {
indent = { indent = {
enable = true, enable = true,
disable = { "tex", "bib", "markdown" } disable = { "tex", "bib", "markdown" },
}, },
incremental_selection = { incremental_selection = {
@@ -28,9 +39,12 @@ require'nvim-treesitter.configs'.setup {
node_decremental = "grm", node_decremental = "grm",
}, },
}, },
} })
vim.opt.foldmethod = "expr" -- Better folding setup
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldmethod = "expr"
vim.opt.foldlevel = 2 vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldenable = true vim.opt.foldlevel = 20
vim.opt.foldenable = false
end,
}

View File

@@ -1,59 +1,35 @@
-- File: ~/.config/nvim/lua/plugins/vimtex.lua return {
"lervag/vimtex",
ft = { "tex", "latex" },
config = function()
-- VimTeX Configuration
vim.g.vimtex_view_method = "skim"
vim.g.vimtex_view_skim_sync = 1
vim.g.vimtex_view_skim_activate = 1
vim.g.vimtex_compiler_method = "latexmk"
vim.g.vimtex_quickfix_mode = 0
vim.g.vimtex_syntax_enabled = 1
vim.g.vimtex_fold_enabled = 1
vim.g.vimtex_format_enabled = 1
-- VimTeX Configuration -- Custom TeX Engine Commands
vim.g.vimtex_view_method = 'skim' -- Use Skim as the PDF viewer vim.api.nvim_create_user_command("LuaTeX", "!lualatex %", { nargs = 0 })
vim.g.vimtex_view_skim_sync = 1 -- Enable forward search with Skim vim.api.nvim_create_user_command("XeTeX", "!xelatex %", { nargs = 0 })
vim.g.vimtex_view_skim_activate = 1 -- Activate Skim on compilation vim.api.nvim_create_user_command("PdfLaTeX", "!pdflatex %", { nargs = 0 })
vim.api.nvim_create_user_command("ViewPDF", "!open -a Skim " .. vim.fn.expand("%:r") .. ".pdf", { nargs = 0 })
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for LaTeX compilation vim.api.nvim_create_user_command("CheckErrors", '!grep -i error %.log || echo "No errors found!"', { nargs = 0 })
vim.g.vimtex_quickfix_mode = 0 -- Disable automatic quickfix window vim.api.nvim_create_user_command(
vim.g.vimtex_syntax_enabled = 1 -- Enable VimTeX syntax highlighting "CleanAuxFiles",
vim.g.vimtex_fold_enabled = 1 -- Enable VimTeX syntax highlighting "!rm -f *.aux *.log *.out *.toc *.bbl *.blg *.synctex.gz *.fls *.fdb_latexmk",
vim.g.vimtex_format_enabled = 1 -- Enable VimTeX syntax highlighting
-- Custom TeX Engine Commands
vim.api.nvim_create_user_command(
'LuaTeX',
'!lualatex %',
{ nargs = 0 } { nargs = 0 }
) )
vim.api.nvim_create_user_command( -- Keybindings for TeX Workflow
'XeTeX', vim.keymap.set("n", "<leader>ll", ":LuaTeX<CR>", { noremap = true, silent = true })
'!xelatex %', vim.keymap.set("n", "<leader>lx", ":XeTeX<CR>", { noremap = true, silent = true })
{ nargs = 0 } vim.keymap.set("n", "<leader>lp", ":PdfLaTeX<CR>", { noremap = true, silent = true })
) vim.keymap.set("n", "<leader>lv", ":ViewPDF<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>le", ":CheckErrors<CR>", { noremap = true, silent = true })
vim.api.nvim_create_user_command( vim.keymap.set("n", "<leader>lc", ":CleanAuxFiles<CR>", { noremap = true, silent = true })
'PdfLaTeX', end,
'!pdflatex %', }
{ nargs = 0 }
)
-- View PDF Command
vim.api.nvim_create_user_command(
'ViewPDF',
'!open -a Skim ' .. vim.fn.expand('%:r') .. '.pdf',
{ nargs = 0 }
)
-- Check for Errors in Log File
vim.api.nvim_create_user_command(
'CheckErrors',
'!grep -i error %.log || echo "No errors found!"',
{ nargs = 0 }
)
vim.api.nvim_create_user_command(
'CleanAuxFiles',
'!rm -f *.aux *.log *.out *.toc *.bbl *.blg *.synctex.gz *.fls *.fdb_latexmk',
{ nargs = 0 }
)
-- Keybindings for TeX Workflow
vim.keymap.set('n', '<leader>ll', ':LuaTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lx', ':XeTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lp', ':PdfLaTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lv', ':ViewPDF<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>le', ':CheckErrors<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lc', ':CleanAuxFiles<CR>', { noremap = true, silent = true })