feat: finalize migration to chezmoi and modernize configuration logic
- Modularize Hyprland config into hyprland.d/ - Implement infinitely scalable monitor/workspace logic using templates and loop-based data structures - Consolidate host-specific configs (hyprlock, hyprpaper, waybar) into single templates - Resolve waybar symlink conflict and fix template execution errors - Integrate chezmoi data variables for scale, resolution, and peripherals
This commit is contained in:
30
dot_config/nvim/lua/community.lua
Normal file
30
dot_config/nvim/lua/community.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
-- AstroCommunity: import any community modules here
|
||||
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
|
||||
-- This guarantees that the specs are processed before any user plugins.
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrocommunity",
|
||||
{ import = "astrocommunity.colorscheme.catppuccin" },
|
||||
-- these packs can set up things such as Treesitter, Language Servers, additional language specific plugins, and more!
|
||||
{ import = "astrocommunity.snippet.nvim-snippets" },
|
||||
{ import = "astrocommunity.pack.lua" },
|
||||
{ import = "astrocommunity.pack.hyprlang" },
|
||||
{ import = "astrocommunity.pack.java" },
|
||||
{ import = "astrocommunity.pack.rust" },
|
||||
{ import = "astrocommunity.pack.go" },
|
||||
{ import = "astrocommunity.pack.docker" },
|
||||
{ import = "astrocommunity.pack.json" },
|
||||
{ import = "astrocommunity.pack.html-css" },
|
||||
{ import = "astrocommunity.pack.sql" },
|
||||
{ import = "astrocommunity.pack.typescript" },
|
||||
{ import = "astrocommunity.pack.toml" },
|
||||
{ import = "astrocommunity.pack.xml" },
|
||||
{ import = "astrocommunity.pack.yaml" },
|
||||
{ import = "astrocommunity.pack.python" },
|
||||
{ import = "astrocommunity.pack.kotlin" },
|
||||
{ import = "astrocommunity.pack.php" },
|
||||
|
||||
{ import = "astrocommunity.markdown-and-latex.vimtex" },
|
||||
-- import/override with your plugins folder
|
||||
}
|
||||
32
dot_config/nvim/lua/lazy_setup.lua
Normal file
32
dot_config/nvim/lua/lazy_setup.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
require("lazy").setup({
|
||||
{
|
||||
"AstroNvim/AstroNvim",
|
||||
version = "^5", -- Remove version tracking to elect for nightly AstroNvim
|
||||
import = "astronvim.plugins",
|
||||
opts = { -- AstroNvim options must be set here with the `import` key
|
||||
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
|
||||
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
|
||||
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
|
||||
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
|
||||
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
|
||||
},
|
||||
},
|
||||
{ import = "community" },
|
||||
{ import = "plugins" },
|
||||
} --[[@as LazySpec]], {
|
||||
-- Configure any other `lazy.nvim` configuration options here
|
||||
install = { colorscheme = { "astrotheme", "habamax" } },
|
||||
ui = { backdrop = 100 },
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins, add more to your liking
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
} --[[@as LazyConfig]])
|
||||
83
dot_config/nvim/lua/plugins/astrocore.lua
Normal file
83
dot_config/nvim/lua/plugins/astrocore.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
|
||||
-- Configuration documentation can be found with `:h astrocore`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
-- Configure core features of AstroNvim
|
||||
features = {
|
||||
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
|
||||
autopairs = true, -- enable autopairs at start
|
||||
cmp = true, -- enable completion at start
|
||||
diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup
|
||||
highlighturl = true, -- highlight URLs at start
|
||||
notifications = true, -- enable notifications at start
|
||||
},
|
||||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||
diagnostics = {
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
},
|
||||
-- passed to `vim.filetype.add`
|
||||
filetypes = {
|
||||
-- see `:h vim.filetype.add` for usage
|
||||
extension = {
|
||||
foo = "fooscript",
|
||||
},
|
||||
filename = {
|
||||
[".foorc"] = "fooscript",
|
||||
},
|
||||
pattern = {
|
||||
[".*/etc/foo/.*"] = "fooscript",
|
||||
},
|
||||
},
|
||||
-- vim options can be configured here
|
||||
options = {
|
||||
opt = { -- vim.opt.<key>
|
||||
relativenumber = true, -- sets vim.opt.relativenumber
|
||||
number = true, -- sets vim.opt.number
|
||||
spell = false, -- sets vim.opt.spell
|
||||
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
|
||||
wrap = false, -- sets vim.opt.wrap
|
||||
},
|
||||
g = { -- vim.g.<key>
|
||||
-- configure global vim variables (vim.g)
|
||||
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
|
||||
-- This can be found in the `lua/lazy_setup.lua` file
|
||||
},
|
||||
},
|
||||
-- Mappings can be configured through AstroCore as well.
|
||||
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
|
||||
mappings = {
|
||||
-- first key is the mode
|
||||
n = {
|
||||
-- second key is the lefthand side of the map
|
||||
|
||||
-- navigate buffer tabs
|
||||
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
||||
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
||||
|
||||
-- mappings seen under group name "Buffer"
|
||||
["<Leader>bd"] = {
|
||||
function()
|
||||
require("astroui.status.heirline").buffer_picker(
|
||||
function(bufnr) require("astrocore.buffer").close(bufnr) end
|
||||
)
|
||||
end,
|
||||
desc = "Close buffer from tabline",
|
||||
},
|
||||
|
||||
-- tables with just a `desc` key will be registered with which-key if it's installed
|
||||
-- this is useful for naming menus
|
||||
-- ["<Leader>b"] = { desc = "Buffers" },
|
||||
|
||||
-- setting a mapping to false will disable it
|
||||
-- ["<C-S>"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
107
dot_config/nvim/lua/plugins/astrolsp.lua
Normal file
107
dot_config/nvim/lua/plugins/astrolsp.lua
Normal file
@@ -0,0 +1,107 @@
|
||||
-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine
|
||||
-- Configuration documentation can be found with `:h astrolsp`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
-- Configuration table of features provided by AstroLSP
|
||||
features = {
|
||||
codelens = true, -- enable/disable codelens refresh on start
|
||||
inlay_hints = false, -- enable/disable inlay hints on start
|
||||
semantic_tokens = true, -- enable/disable semantic token highlighting
|
||||
},
|
||||
-- customize lsp formatting options
|
||||
formatting = {
|
||||
-- control auto formatting on save
|
||||
format_on_save = {
|
||||
enabled = true, -- enable or disable format on save globally
|
||||
allow_filetypes = { -- enable format on save for specified filetypes only
|
||||
-- "go",
|
||||
},
|
||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||
-- "python",
|
||||
},
|
||||
},
|
||||
disabled = { -- disable formatting capabilities for the listed language servers
|
||||
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
|
||||
-- "lua_ls",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
-- return true
|
||||
-- end
|
||||
},
|
||||
-- enable servers that you already have installed without mason
|
||||
servers = {
|
||||
-- "pyright"
|
||||
},
|
||||
-- ensure servers are installed
|
||||
ensure_installed = {
|
||||
"ltex",
|
||||
},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
|
||||
},
|
||||
-- customize how language servers are attached
|
||||
handlers = {
|
||||
-- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server
|
||||
-- function(server, opts) require("lspconfig")[server].setup(opts) end
|
||||
|
||||
-- the key is the server that is being setup with `lspconfig`
|
||||
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
|
||||
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
|
||||
},
|
||||
-- Configure buffer local auto commands to add when attaching a language server
|
||||
autocmds = {
|
||||
-- first key is the `augroup` to add the auto commands to (:h augroup)
|
||||
lsp_codelens_refresh = {
|
||||
-- Optional condition to create/delete auto command group
|
||||
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
|
||||
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
|
||||
-- the auto commands will be deleted for that buffer
|
||||
cond = "textDocument/codeLens",
|
||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||
-- list of auto commands to set
|
||||
{
|
||||
-- events to trigger
|
||||
event = { "InsertLeave", "BufEnter" },
|
||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||
desc = "Refresh codelens (buffer)",
|
||||
callback = function(args)
|
||||
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- mappings to be set up on attaching of a language server
|
||||
mappings = {
|
||||
n = {
|
||||
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
|
||||
gD = {
|
||||
function() vim.lsp.buf.declaration() end,
|
||||
desc = "Declaration of current symbol",
|
||||
cond = "textDocument/declaration",
|
||||
},
|
||||
["<Leader>uY"] = {
|
||||
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
|
||||
desc = "Toggle LSP semantic highlight (buffer)",
|
||||
cond = function(client)
|
||||
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||
on_attach = function(client, bufnr)
|
||||
-- this would disable semanticTokensProvider for all clients
|
||||
-- client.server_capabilities.semanticTokensProvider = nil
|
||||
end,
|
||||
},
|
||||
}
|
||||
37
dot_config/nvim/lua/plugins/astroui.lua
Normal file
37
dot_config/nvim/lua/plugins/astroui.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
-- AstroUI provides the basis for configuring the AstroNvim User Interface
|
||||
-- Configuration documentation can be found with `:h astroui`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astroui",
|
||||
---@type AstroUIOpts
|
||||
opts = {
|
||||
-- change colorscheme
|
||||
colorscheme = "catppuccin",
|
||||
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
|
||||
highlights = {
|
||||
init = { -- this table overrides highlights in all themes
|
||||
-- Normal = { bg = "#000000" },
|
||||
},
|
||||
astrodark = { -- a table of overrides/changes when applying the astrotheme theme
|
||||
-- Normal = { bg = "#000000" },
|
||||
},
|
||||
},
|
||||
-- Icons can be configured throughout the interface
|
||||
icons = {
|
||||
-- configure the loading of the lsp in the status line
|
||||
LSPLoading1 = "⠋",
|
||||
LSPLoading2 = "⠙",
|
||||
LSPLoading3 = "⠹",
|
||||
LSPLoading4 = "⠸",
|
||||
LSPLoading5 = "⠼",
|
||||
LSPLoading6 = "⠴",
|
||||
LSPLoading7 = "⠦",
|
||||
LSPLoading8 = "⠧",
|
||||
LSPLoading9 = "⠇",
|
||||
LSPLoading10 = "⠏",
|
||||
},
|
||||
},
|
||||
}
|
||||
29
dot_config/nvim/lua/plugins/autopairs.lua
Normal file
29
dot_config/nvim/lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
config = function(plugin, opts)
|
||||
require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
|
||||
-- add more custom autopairs configuration such as custom rules
|
||||
local npairs = require "nvim-autopairs"
|
||||
local Rule = require "nvim-autopairs.rule"
|
||||
local cond = require "nvim-autopairs.conds"
|
||||
npairs.add_rules(
|
||||
{
|
||||
Rule("$", "$", { "tex", "latex" })
|
||||
-- don't add a pair if the next character is %
|
||||
:with_pair(cond.not_after_regex "%%")
|
||||
-- don't add a pair if the previous character is xxx
|
||||
:with_pair(
|
||||
cond.not_before_regex("xxx", 3)
|
||||
)
|
||||
-- don't move right when repeat character
|
||||
:with_move(cond.none())
|
||||
-- don't delete if the next character is xx
|
||||
:with_del(cond.not_after_regex "xx")
|
||||
-- disable adding a newline when you press <cr>
|
||||
:with_cr(cond.none()),
|
||||
},
|
||||
-- disable for .vim files, but it work for another filetypes
|
||||
Rule("a", "a", "-vim")
|
||||
)
|
||||
end,
|
||||
}
|
||||
39
dot_config/nvim/lua/plugins/blink-latex.lua
Normal file
39
dot_config/nvim/lua/plugins/blink-latex.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
return {
|
||||
-- Let blink.cmp consume nvim-cmp sources
|
||||
{ "saghen/blink.compat", version = "2.*", lazy = true, opts = {} },
|
||||
|
||||
-- Add vimtex + latex symbol sources to blink.cmp
|
||||
{
|
||||
"Saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"micangl/cmp-vimtex", -- environments, \cite, \ref, etc. via vimtex
|
||||
"kdheepak/cmp-latex-symbols", -- math symbols via LaTeX macros
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
opts.sources.providers = opts.sources.providers or {}
|
||||
opts.sources.default = opts.sources.default or { "lsp", "path", "snippets", "buffer" }
|
||||
|
||||
-- Only turn on the LaTeX sources for TeX filetypes
|
||||
opts.sources.per_filetype = vim.tbl_deep_extend("force", opts.sources.per_filetype or {}, {
|
||||
tex = { inherit_defaults = true, "vimtex", "latex_symbols" },
|
||||
plaintex = { inherit_defaults = true, "vimtex", "latex_symbols" },
|
||||
})
|
||||
|
||||
-- Expose nvim-cmp sources to blink via blink.compat
|
||||
opts.sources.providers.vimtex = {
|
||||
name = "vimtex",
|
||||
module = "blink.compat.source",
|
||||
}
|
||||
opts.sources.providers.latex_symbols = {
|
||||
name = "latex_symbols",
|
||||
module = "blink.compat.source",
|
||||
-- Insert LaTeX commands (e.g. \alpha) instead of Unicode characters:
|
||||
opts = { strategy = 2 }, -- documented in cmp-latex-symbols README
|
||||
score_offset = -2, -- keep it below LSP/snippets in relevance
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
17
dot_config/nvim/lua/plugins/latex-snippets.lua
Normal file
17
dot_config/nvim/lua/plugins/latex-snippets.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Gilles Castel-style LaTeX snippets for LuaSnip
|
||||
return {
|
||||
-- Make sure autosnippets are enabled globally
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
opts = function(_, opts) opts.enable_autosnippets = true end,
|
||||
},
|
||||
|
||||
-- The LaTeX snippets themselves
|
||||
{
|
||||
"iurimateus/luasnip-latex-snippets.nvim",
|
||||
ft = { "tex", "plaintex", "markdown" },
|
||||
dependencies = { "L3MON4D3/LuaSnip", "lervag/vimtex" },
|
||||
opts = { use_treesitter = false, allow_on_markdown = true }, -- use vimtex to detect math mode
|
||||
config = function(_, opts) require("luasnip-latex-snippets").setup(opts) end,
|
||||
},
|
||||
}
|
||||
5
dot_config/nvim/lua/plugins/lsp_signature.lua
Normal file
5
dot_config/nvim/lua/plugins/lsp_signature.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "BufRead",
|
||||
config = function() require("lsp_signature").setup() end,
|
||||
}
|
||||
66
dot_config/nvim/lua/plugins/ltex.lua
Normal file
66
dot_config/nvim/lua/plugins/ltex.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
-- Grammar & spell checking for LaTeX/Markdown via LanguageTool (LTeX-LS)
|
||||
return {
|
||||
-- Tell AstroLSP to manage the ltex server and pass our settings
|
||||
{
|
||||
"AstroNvim/astrolsp",
|
||||
---@param opts AstroLSPOpts
|
||||
opts = function(_, opts)
|
||||
opts.servers = opts.servers or {}
|
||||
if not vim.tbl_contains(opts.servers, "ltex") then table.insert(opts.servers, "ltex") end
|
||||
|
||||
-- Extend the ltex server configuration
|
||||
opts.config = require("astrocore").extend_tbl(opts.config or {}, {
|
||||
ltex = {
|
||||
filetypes = { "tex", "plaintex", "bib", "markdown" },
|
||||
settings = {
|
||||
ltex = {
|
||||
-- Run checks on save for performance; switch to "edit" if you prefer live feedback
|
||||
checkFrequency = "save",
|
||||
-- Pick the language you want LTeX to check as the document language
|
||||
language = "en-GB",
|
||||
-- Mother tongue helps the grammar engine (adjust to your preference)
|
||||
additionalRules = { motherTongue = "de-DE" },
|
||||
-- Let ltex_extra manage dictionaries/rules on disk
|
||||
dictionary = {
|
||||
["en-GB"] = {},
|
||||
["de-DE"] = {},
|
||||
["fr-FR"] = {},
|
||||
},
|
||||
disabledRules = {
|
||||
["en-GB"] = {},
|
||||
["de-DE"] = {},
|
||||
["fr-FR"] = {},
|
||||
},
|
||||
hiddenFalsePositives = {
|
||||
["en-GB"] = {},
|
||||
["de-DE"] = {},
|
||||
["fr-FR"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- hook up ltex_extra when the server attaches
|
||||
on_attach = function(client, bufnr)
|
||||
local ok, ltex_extra = pcall(require, "ltex_extra")
|
||||
if ok then
|
||||
ltex_extra.setup {
|
||||
-- load both EN+DE dictionaries; change to your set
|
||||
load_langs = { "en-GB", "de-DE", "fr-FR" },
|
||||
init_check = true,
|
||||
-- store per-project files in .ltex (add to .gitignore if you want)
|
||||
path = ".ltex",
|
||||
log_level = "none",
|
||||
}
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Companion plugin: add-to-dictionary / disable-rule / hide-false-positive
|
||||
{
|
||||
"barreiroleo/ltex_extra.nvim",
|
||||
ft = { "tex", "plaintex", "markdown" },
|
||||
lazy = true,
|
||||
},
|
||||
}
|
||||
18
dot_config/nvim/lua/plugins/luasnip.lua
Normal file
18
dot_config/nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
enabled = true,
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
config = function(plugin, opts)
|
||||
-- run the default astronvim config that calls the setup call
|
||||
require "astronvim.plugins.configs.luasnip"(plugin, opts)
|
||||
-- lazy load snippets from friendly-snippets
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
-- add more custom luasnip configuration such as filetype extend or custom snippets
|
||||
require("luasnip").filetype_extend("javascript", { "javascriptreact" })
|
||||
end,
|
||||
}
|
||||
28
dot_config/nvim/lua/plugins/mason.lua
Normal file
28
dot_config/nvim/lua/plugins/mason.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Mason
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
-- use mason-tool-installer for automatically installing Mason packages
|
||||
{
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
-- overrides `require("mason-tool-installer").setup(...)`
|
||||
opts = {
|
||||
-- Make sure to use the names found in `:Mason`
|
||||
ensure_installed = {
|
||||
-- install language servers
|
||||
"lua-language-server",
|
||||
|
||||
-- install formatters
|
||||
"stylua",
|
||||
|
||||
-- install debuggers
|
||||
"debugpy",
|
||||
|
||||
-- install any other package
|
||||
"tree-sitter-cli",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
135
dot_config/nvim/lua/plugins/md-kiss.lua
Normal file
135
dot_config/nvim/lua/plugins/md-kiss.lua
Normal file
@@ -0,0 +1,135 @@
|
||||
-- Minimal Markdown + math workflow (FOSS/KISS):
|
||||
-- - Blink completion of LaTeX symbols in Markdown
|
||||
-- - :MdPdf for one-shot Pandoc -> PDF (LuaLaTeX) and open in Zathura (auto-reload)
|
||||
-- - :MdWatch / :MdWatchStop to rebuild on save via `entr`
|
||||
return {
|
||||
-- Markdown gets LaTeX symbol completion (inserts \alpha, not α)
|
||||
{
|
||||
"Saghen/blink.cmp",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
opts.sources.per_filetype = vim.tbl_deep_extend("force", opts.sources.per_filetype or {}, {
|
||||
markdown = { inherit_defaults = true, "latex_symbols" },
|
||||
})
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
|
||||
-- Ensure Treesitter grammars for Markdown editing
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
for _, lang in ipairs { "markdown", "markdown_inline" } do
|
||||
if not vim.tbl_contains(opts.ensure_installed, lang) then table.insert(opts.ensure_installed, lang) end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Commands + keymaps
|
||||
{
|
||||
"AstroNvim/astrocore",
|
||||
init = function()
|
||||
local function have(bin) return vim.fn.executable(bin) == 1 end
|
||||
|
||||
local function pandoc_cmd(input_md)
|
||||
local stem = input_md:gsub("%.md$", "")
|
||||
local md = vim.fn.shellescape(input_md)
|
||||
local pdf = vim.fn.shellescape(stem .. ".pdf")
|
||||
local cmd = ("pandoc %s -o %s --from=markdown+tex_math_dollars+raw_tex --pdf-engine=lualatex --citeproc"):format(
|
||||
md,
|
||||
pdf
|
||||
)
|
||||
return cmd, (stem .. ".pdf")
|
||||
end
|
||||
|
||||
-- One-shot: build PDF and open Zathura once (it auto-reloads)
|
||||
vim.api.nvim_create_user_command("MdPdf", function()
|
||||
if not have "pandoc" then
|
||||
vim.notify("MdPdf: pandoc not found. Install pandoc.", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
local name = vim.api.nvim_buf_get_name(0)
|
||||
if name == "" or not name:match "%.md$" then
|
||||
vim.notify("MdPdf: open a Markdown (*.md) file", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local cmd, pdf = pandoc_cmd(name)
|
||||
vim.fn.jobstart({ "sh", "-c", cmd }, {
|
||||
detach = true,
|
||||
on_exit = function()
|
||||
if have "zathura" and not vim.g._mdpdf_zathura_opened then
|
||||
vim.g._mdpdf_zathura_opened = true
|
||||
vim.fn.jobstart({ "zathura", "--fork", pdf }, { detach = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
end, {})
|
||||
|
||||
-- Continuous: watch with entr and rebuild on change
|
||||
vim.api.nvim_create_user_command("MdWatch", function()
|
||||
if not have "pandoc" then
|
||||
vim.notify("MdWatch: pandoc not found. Install pandoc.", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
if not have "entr" then
|
||||
vim.notify("MdWatch: entr not found. Install entr.", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
local name = vim.api.nvim_buf_get_name(buf)
|
||||
if name == "" or not name:match "%.md$" then
|
||||
vim.notify("MdWatch: open a Markdown (*.md) file", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
-- First build (also opens Zathura once)
|
||||
vim.cmd "MdPdf"
|
||||
|
||||
local cmd, _ = pandoc_cmd(name)
|
||||
local qfile = vim.fn.shellescape(name)
|
||||
local pipeline = ("printf %%s\\n %s | entr -r sh -c %s"):format(qfile, vim.fn.shellescape(cmd))
|
||||
local jobid = vim.fn.jobstart({ "sh", "-c", pipeline }, { detach = false })
|
||||
if jobid <= 0 then
|
||||
vim.notify("MdWatch: failed to start entr", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
vim.b.md_kiss_watch_job = jobid
|
||||
vim.notify("MdWatch: watching " .. name .. " (use :MdWatchStop to stop)", vim.log.levels.INFO)
|
||||
|
||||
-- Auto-stop when buffer unloads
|
||||
vim.api.nvim_create_autocmd({ "BufUnload", "BufWipeout" }, {
|
||||
buffer = buf,
|
||||
once = true,
|
||||
callback = function()
|
||||
if vim.b.md_kiss_watch_job then pcall(vim.fn.jobstop, vim.b.md_kiss_watch_job) end
|
||||
end,
|
||||
})
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("MdWatchStop", function()
|
||||
local job = vim.b.md_kiss_watch_job
|
||||
if job then
|
||||
pcall(vim.fn.jobstop, job)
|
||||
vim.b.md_kiss_watch_job = nil
|
||||
vim.notify("MdWatch: stopped", vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("MdWatch: no watcher running for this buffer", vim.log.levels.WARN)
|
||||
end
|
||||
end, {})
|
||||
|
||||
-- Buffer-local keymaps for Markdown
|
||||
local group = vim.api.nvim_create_augroup("md_kiss_keys", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = group,
|
||||
pattern = "markdown",
|
||||
callback = function(args)
|
||||
vim.keymap.set("n", "<leader>mP", "<cmd>MdPdf<CR>", { buffer = args.buf, desc = "Markdown → PDF (Pandoc)" })
|
||||
vim.keymap.set("n", "<leader>mw", "<cmd>MdWatch<CR>", { buffer = args.buf, desc = "Watch & rebuild (entr)" })
|
||||
vim.keymap.set("n", "<leader>mW", "<cmd>MdWatchStop<CR>", { buffer = args.buf, desc = "Stop watch" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
19
dot_config/nvim/lua/plugins/nabla.lua
Normal file
19
dot_config/nvim/lua/plugins/nabla.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Lightweight inline ASCII preview for LaTeX math
|
||||
return {
|
||||
"jbyuki/nabla.nvim",
|
||||
ft = { "tex", "plaintex", "markdown" },
|
||||
keys = {
|
||||
-- Popup preview for the expression under cursor
|
||||
{ "<leader>mp", function() require("nabla").popup() end, desc = "Math: popup preview" },
|
||||
|
||||
-- Toggle inline virtual rendering; re-enable wrap after toggle (nabla toggles it off)
|
||||
{
|
||||
"<leader>mv",
|
||||
function()
|
||||
require("nabla").toggle_virt { autogen = true }
|
||||
vim.wo.wrap = true
|
||||
end,
|
||||
desc = "Math: toggle inline preview",
|
||||
},
|
||||
},
|
||||
}
|
||||
24
dot_config/nvim/lua/plugins/none-ls.lua
Normal file
24
dot_config/nvim/lua/plugins/none-ls.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize None-ls sources
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
-- opts variable is the default configuration table for the setup function call
|
||||
-- local null_ls = require "null-ls"
|
||||
|
||||
-- Check supported formatters and linters
|
||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
|
||||
-- Only insert new sources, do not replace the existing ones
|
||||
-- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function)
|
||||
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
|
||||
-- Set a formatter
|
||||
-- null_ls.builtins.formatting.stylua,
|
||||
-- null_ls.builtins.formatting.prettier,
|
||||
})
|
||||
end,
|
||||
}
|
||||
40
dot_config/nvim/lua/plugins/obsidian.lua
Normal file
40
dot_config/nvim/lua/plugins/obsidian.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
---@type LazySpec
|
||||
return {
|
||||
"obsidian-nvim/obsidian.nvim",
|
||||
version = "*", -- recommended, use latest release instead of latest commit
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
|
||||
-- event = {
|
||||
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
|
||||
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
|
||||
-- -- refer to `:h file-pattern` for more examples
|
||||
-- "BufReadPre path/to/my-vault/*.md",
|
||||
-- "BufNewFile path/to/my-vault/*.md",
|
||||
-- },
|
||||
dependencies = {
|
||||
-- Required.
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
||||
-- see above for full list of optional dependencies ☝️
|
||||
},
|
||||
---@module 'obsidian'
|
||||
---@type obsidian.config.ClientOpts
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "uni",
|
||||
path = "~/Documents/uni",
|
||||
},
|
||||
},
|
||||
-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
|
||||
completion = {
|
||||
-- Enables completion using nvim_cmp
|
||||
nvim_cmp = false,
|
||||
-- Enables completion using blink.cmp
|
||||
blink = true,
|
||||
-- Trigger completion at 2 chars.
|
||||
min_chars = 2,
|
||||
},
|
||||
},
|
||||
}
|
||||
25
dot_config/nvim/lua/plugins/pandoc.lua
Normal file
25
dot_config/nvim/lua/plugins/pandoc.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
-- A vimtex-like workflow for compiling Markdown to PDF using pandoc
|
||||
return {
|
||||
"arminveres/md-pdf.nvim",
|
||||
lazy = true,
|
||||
-- Set up a keymap for compiling
|
||||
keys = {
|
||||
{
|
||||
"<Leader>mc",
|
||||
function()
|
||||
-- The plugin's main function to convert markdown to pdf
|
||||
require("md-pdf").convert_md_to_pdf()
|
||||
end,
|
||||
desc = "Markdown Compile",
|
||||
},
|
||||
},
|
||||
-- Configure the plugin
|
||||
opts = {
|
||||
-- Set zathura as the PDF viewer to match the vimtex setup
|
||||
preview_cmd = function()
|
||||
return "zathura"
|
||||
end,
|
||||
-- other options...
|
||||
ignore_viewer_state = true, -- Auto-recompile PDF on each write
|
||||
},
|
||||
}
|
||||
4
dot_config/nvim/lua/plugins/presence.lua
Normal file
4
dot_config/nvim/lua/plugins/presence.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"andweeb/presence.nvim",
|
||||
event = "VimEnter",
|
||||
}
|
||||
22
dot_config/nvim/lua/plugins/snacks.lua
Normal file
22
dot_config/nvim/lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
dashboard = {
|
||||
preset = {
|
||||
header = table.concat({
|
||||
" █████ ███████ ████████ ██████ ██████ ",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"███████ ███████ ██ ██████ ██ ██",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"██ ██ ███████ ██ ██ ██ ██████ ",
|
||||
"",
|
||||
"███ ██ ██ ██ ██ ███ ███",
|
||||
"████ ██ ██ ██ ██ ████ ████",
|
||||
"██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"██ ████ ████ ██ ██ ██",
|
||||
}, "\n"),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
10
dot_config/nvim/lua/plugins/treesitter-latex.lua
Normal file
10
dot_config/nvim/lua/plugins/treesitter-latex.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- Ensure Treesitter knows about LaTeX (nabla benefits, and some plugins use it)
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
if not vim.tbl_contains(opts.ensure_installed, "latex") then table.insert(opts.ensure_installed, "latex") end
|
||||
end
|
||||
end,
|
||||
}
|
||||
15
dot_config/nvim/lua/plugins/treesitter.lua
Normal file
15
dot_config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Treesitter
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
}
|
||||
5
dot_config/nvim/lua/plugins/user.lua
Normal file
5
dot_config/nvim/lua/plugins/user.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
---@type LazySpec
|
||||
return {
|
||||
-- You can disable default plugins as follows:
|
||||
--{ "max397574/better-escape.nvim", enabled = false },
|
||||
}
|
||||
22
dot_config/nvim/lua/plugins/vimtex.lua
Normal file
22
dot_config/nvim/lua/plugins/vimtex.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"lervag/vimtex",
|
||||
ft = { "tex", "latex" }, -- lazy-load on filetype
|
||||
init = function()
|
||||
-- Viewer
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
|
||||
-- Compiler: latexmk + LuaLaTeX
|
||||
vim.g.vimtex_compiler_method = "latexmk"
|
||||
-- Option A: pass -lualatex explicitly to latexmk
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
options = {
|
||||
"-lualatex",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
"-file-line-error",
|
||||
},
|
||||
}
|
||||
-- Option B (also helpful): make LuaLaTeX the default engine for latexmk
|
||||
vim.g.vimtex_compiler_latexmk_engines = { _ = "-lualatex" }
|
||||
end,
|
||||
}
|
||||
6
dot_config/nvim/lua/polish.lua
Normal file
6
dot_config/nvim/lua/polish.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
-- This will run last in the setup process.
|
||||
-- This is just pure lua so anything that doesn't
|
||||
-- fit in the normal config locations above can go here
|
||||
|
||||
-- Set the conceal level for prettier formatting in LaTeX and Markdown
|
||||
vim.opt.conceallevel = 2
|
||||
Reference in New Issue
Block a user