From 8fcb6af306d210d567b18828bf293035f6d7fe00 Mon Sep 17 00:00:00 2001 From: alexion Date: Sat, 4 Jul 2026 18:02:20 -0400 Subject: [PATCH] nvim: in-line Markdown rendering --- .config/alacritty/alacritty.toml | 88 ++++++++++++++++++++ .config/dot/CLAUDE.md | 9 ++ .config/nvim/after/ftplugin/markdown.lua | 1 + .config/nvim/init.lua | 1 + .config/nvim/lazy-lock.json | 6 ++ .config/nvim/lua/config/lazy.lua | 23 +++++ .config/nvim/lua/config/options.lua | 6 -- .config/nvim/lua/plugins/nord.lua | 12 +++ .config/nvim/lua/plugins/render-markdown.lua | 6 ++ .config/nvim/lua/plugins/treesitter.lua | 30 +++++++ 10 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 .config/alacritty/alacritty.toml create mode 100644 .config/nvim/after/ftplugin/markdown.lua create mode 100644 .config/nvim/lazy-lock.json create mode 100644 .config/nvim/lua/config/lazy.lua create mode 100644 .config/nvim/lua/plugins/nord.lua create mode 100644 .config/nvim/lua/plugins/render-markdown.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..7411716 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -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" }, +] + diff --git a/.config/dot/CLAUDE.md b/.config/dot/CLAUDE.md index 0890474..3ce960a 100644 --- a/.config/dot/CLAUDE.md +++ b/.config/dot/CLAUDE.md @@ -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 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 `status.showUntrackedFiles=no` is set locally (see `dot init` below), and diff --git a/.config/nvim/after/ftplugin/markdown.lua b/.config/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..2848685 --- /dev/null +++ b/.config/nvim/after/ftplugin/markdown.lua @@ -0,0 +1 @@ +vim.opt_local.conceallevel = 2 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 688a7b5..865ca51 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,2 +1,3 @@ require("config.options") require("config.keymaps") +require("config.lazy") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..7361952 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -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" } +} diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..d2eea07 --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -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 }, +}) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 220a058..09b75e7 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -15,12 +15,6 @@ opt.expandtab = true 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.ignorecase = true diff --git a/.config/nvim/lua/plugins/nord.lua b/.config/nvim/lua/plugins/nord.lua new file mode 100644 index 0000000..5abee4a --- /dev/null +++ b/.config/nvim/lua/plugins/nord.lua @@ -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, +} diff --git a/.config/nvim/lua/plugins/render-markdown.lua b/.config/nvim/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..ed7c747 --- /dev/null +++ b/.config/nvim/lua/plugins/render-markdown.lua @@ -0,0 +1,6 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown" }, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = {}, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..749e09d --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -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, +}