nvim: in-line Markdown rendering

This commit is contained in:
2026-07-04 18:02:20 -04:00
parent 9a4263ce8b
commit 8fcb6af306
10 changed files with 176 additions and 6 deletions

View File

@@ -0,0 +1,88 @@
[general]
working_directory = "None"
live_config_reload = true
[env]
TERM = "xterm-256color"
WINIT_X11_SCALE_FACTOR = "1.0"
[window]
dimensions = { columns = 100, lines = 30 }
dynamic_padding = true
decorations = "Full"
opacity = 0.8
title = "Alacritty@CachyOS"
class = { instance = "Alacritty", general = "Alacritty" }
decorations_theme_variant = "Dark"
[scrolling]
history = 10000
multiplier = 3
[font]
normal = { family = "MesloLGS Nerd Font Mono", style = "Regular" }
bold = { family = "MesloLGS Nerd Font Mono", style = "Bold" }
italic = { family = "MesloLGS Nerd Font Mono", style = "Italic" }
bold_italic = { family = "MesloLGS Nerd Font Mono", style = "Bold Italic" }
size = 12.0
[colors]
draw_bold_text_with_bright_colors = true
[colors.primary]
background = "0x2E3440"
foreground = "0xD8DEE9"
[colors.normal]
black = "0x3B4252"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x88C0D0"
white = "0xE5E9F0"
[colors.bright]
black = "0x4C566A"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x8FBCBB"
white = "0xECEFF4"
[selection]
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
save_to_clipboard = true
[cursor]
style = { shape = "Underline", blinking = "Off" }
unfocused_hollow = true
thickness = 0.15
[mouse]
hide_when_typing = true
bindings = [
{ mouse = "Middle", mods = "None", action = "PasteSelection" },
]
[keyboard]
bindings = [
{ key = "Paste", mods = "None", action = "Paste" },
{ key = "Copy", mods = "None", action = "Copy" },
{ key = "L", mods = "Control", action = "ClearLogNotice" },
{ key = "L", mods = "Control", mode = "~Vi", chars = "\f" },
{ key = "PageUp", mods = "Shift", mode = "~Alt", action = "ScrollPageUp" },
{ key = "PageDown", mods = "Shift", mode = "~Alt", action = "ScrollPageDown" },
{ key = "Home", mods = "Shift", mode = "~Alt", action = "ScrollToTop" },
{ key = "End", mods = "Shift", mode = "~Alt", action = "ScrollToBottom" },
{ key = "V", mods = "Control|Shift", action = "Paste" },
{ key = "C", mods = "Control|Shift", action = "Copy" },
{ key = "F", mods = "Control|Shift", action = "SearchForward" },
{ key = "B", mods = "Control|Shift", action = "SearchBackward" },
{ key = "C", mods = "Control|Shift", mode = "Vi", action = "ClearSelection" },
{ key = "Key0", mods = "Control", action = "ResetFontSize" },
]

View File

@@ -12,6 +12,15 @@ config, git identity, the `dot` function itself, and more. To see everything
tracked, run `dot ls-tree -r --name-only HEAD` from `$HOME` (paths are shown tracked, run `dot ls-tree -r --name-only HEAD` from `$HOME` (paths are shown
relative to cwd, so running it from elsewhere silently truncates the list). relative to cwd, so running it from elsewhere silently truncates the list).
For an agent driving this through separate tool calls: `cd ~` in one call does
not reliably carry over to the next, since each call may reset to the
project's working directory. Always `cd "$HOME"` and run the `ls-tree` (or any
other cwd-sensitive `dot`/`git` command) in that *same* call — e.g.
`cd "$HOME" && dot ls-tree -r --name-only HEAD` — rather than trusting a prior
`cd` to have stuck. Getting this wrong silently narrows the listing to
whatever the leftover cwd happens to be, which reads as "this file isn't
tracked" when it actually is.
## Always add by explicit path ## Always add by explicit path
`status.showUntrackedFiles=no` is set locally (see `dot init` below), and `status.showUntrackedFiles=no` is set locally (see `dot init` below), and

View File

@@ -0,0 +1 @@
vim.opt_local.conceallevel = 2

View File

@@ -1,2 +1,3 @@
require("config.options") require("config.options")
require("config.keymaps") require("config.keymaps")
require("config.lazy")

View File

@@ -0,0 +1,6 @@
{
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"nord.nvim": { "branch": "main", "commit": "87394d4fc35c901bbe38326a78d31ab1ead826b6" },
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" }
}

View File

@@ -0,0 +1,23 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "nord" } },
checker = { enabled = false },
})

View File

@@ -15,12 +15,6 @@ opt.expandtab = true
opt.mouse = "a" opt.mouse = "a"
-- Neovim's built-in default colors paint their own dark/light background even
-- without a colorscheme; clear it so the terminal's own background shows through.
for _, group in ipairs({ "Normal", "NormalNC", "NormalFloat", "SignColumn" }) do
vim.api.nvim_set_hl(0, group, { bg = "none" })
end
opt.undofile = true opt.undofile = true
opt.ignorecase = true opt.ignorecase = true

View File

@@ -0,0 +1,12 @@
return {
"gbprod/nord.nvim",
lazy = false,
priority = 1000,
opts = {
transparent = true,
},
config = function(_, opts)
require("nord").setup(opts)
vim.cmd.colorscheme("nord")
end,
}

View File

@@ -0,0 +1,6 @@
return {
"MeanderingProgrammer/render-markdown.nvim",
ft = { "markdown" },
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {},
}

View File

@@ -0,0 +1,30 @@
return {
"nvim-treesitter/nvim-treesitter",
branch = "master",
build = ":TSUpdate",
opts = {
ensure_installed = {
"markdown",
"markdown_inline",
"lua",
"bash",
"fish",
"rust",
"javascript",
"typescript",
"java",
"kotlin",
"c",
"cpp",
"html",
"css",
"python",
},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}