74 lines
2.1 KiB
Lua
74 lines
2.1 KiB
Lua
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
|
vim.g.mapleader = " "
|
|
|
|
-- bootstrap lazy and all plugins
|
|
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
|
|
|
if not vim.uv.fs_stat(lazypath) then
|
|
local repo = "https://github.com/folke/lazy.nvim.git"
|
|
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
|
end
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
local lazy_config = require "configs.lazy"
|
|
|
|
-- Clean Markdown folding with Treesitter (headings + fenced code blocks only)
|
|
local markdown_folds = vim.api.nvim_create_augroup("MarkdownFolds", { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = "markdown",
|
|
group = markdown_folds,
|
|
callback = function()
|
|
vim.wo.foldmethod = "expr"
|
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- This is the magic line
|
|
vim.wo.foldlevel = 1 -- tweak if you want deeper levels open by default
|
|
vim.wo.foldcolumn = "1"
|
|
vim.wo.spell = true
|
|
vim.bo.spelllang = "en_us"
|
|
end,
|
|
})
|
|
|
|
-- load plugins
|
|
require("lazy").setup({
|
|
{
|
|
"NvChad/NvChad",
|
|
lazy = false,
|
|
branch = "v2.5",
|
|
import = "nvchad.plugins",
|
|
},
|
|
-- Beautiful in-editor Markdown rendering (bold, headings, --- lines, etc.)
|
|
{
|
|
"MeanderingProgrammer/render-markdown.nvim",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
|
lazy = false,
|
|
config = function()
|
|
require("render-markdown").setup({
|
|
-- Nice defaults for journaling
|
|
heading = { enabled = true },
|
|
code = { enabled = true },
|
|
bullet = { enabled = true },
|
|
dash = { enabled = true }, -- renders --- as nice line
|
|
quote = { enabled = true },
|
|
link = { enabled = true },
|
|
sign = { enabled = false }, -- keeps it clean
|
|
})
|
|
end,
|
|
},
|
|
|
|
{ import = "plugins" },
|
|
}, lazy_config)
|
|
|
|
-- load stuff for LaTeX
|
|
require("luasnip.loaders.from_lua").lazy_load({paths = "~/.config/nvim/lua/custom/snippets/"})
|
|
|
|
-- load theme
|
|
dofile(vim.g.base46_cache .. "defaults")
|
|
dofile(vim.g.base46_cache .. "statusline")
|
|
|
|
require "options"
|
|
require "autocmds"
|
|
|
|
vim.schedule(function()
|
|
require "mappings"
|
|
end)
|