added aerc config, added nvim plugins surround, markdown etc

This commit is contained in:
liph22
2025-12-27 22:11:28 +01:00
parent 37b59b8d19
commit 8f8400e9d6
25 changed files with 1976 additions and 236 deletions

View File

@@ -25,7 +25,6 @@
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" },
"markview.nvim": { "branch": "main", "commit": "0a5033326f703d99a8788e2d47753d6298195e8a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "8f1a3e6eecb638817e8999aaa16ada27cd54d867" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
@@ -40,14 +39,17 @@
"nvim-navic": { "branch": "master", "commit": "7d914a39a1ef8f4e22c2c4381abeef7c556f5a13" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" },
"nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"portal.nvim": { "branch": "main", "commit": "77d9d53fec945bfa407d5fd7120f1b4f117450ed" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "8aafe2cbd89cd4090f573a98cab6b20366576fde" },
"render-markdown.nvim": { "branch": "main", "commit": "07d088bf8bdadd159eb807b90eaee86a4778383f" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "e709d31454ee6e6157f0537f861f797bd44c0bad" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },

View File

@@ -0,0 +1,123 @@
return {
{
"OXY2DEV/markview.nvim",
lazy = false,
ft = "markdown",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
local presets = require("markview.presets")
require("markview").setup({
modes = { "n", "no", "c" },
hybrid_modes = { "n" },
callbacks = {
on_enable = function(_, win)
vim.wo[win].conceallevel = 2
vim.wo[win].concealcursor = ""
end,
},
markdown = {
headings = presets.headings.glow,
code_blocks = {
enable = true,
style = "language",
position = "overlay",
min_width = 60,
pad_amount = 2,
hl = "MarkviewCode",
},
block_quotes = {
enable = true,
default = {
border = "",
border_hl = "MarkviewBlockQuoteBorder",
},
},
tables = {
enable = true,
parts = {
top = { "", "", "", "", "" },
header = { "", "", "", "", "" },
separator = { "", "", "", "", "" },
row = { "", " ", "", " ", "" },
bottom = { "", "", "", "", "" },
},
use_virt_lines = true,
},
list_items = {
enable = true,
indent_size = 2,
shift_width = 2,
},
},
markdown_inline = {
enable = true,
checkboxes = {
enable = true,
checked = {
text = "",
hl = "MarkviewCheckboxChecked",
},
unchecked = {
text = "",
hl = "MarkviewCheckboxUnchecked",
},
custom = {
{
match_string = "!",
text = "!",
hl = "MarkviewCheckboxImportant",
},
{
match_string = "-",
text = "",
hl = "MarkviewCheckboxPending",
},
{
match_string = "~",
text = "",
hl = "MarkviewCheckboxProgress",
},
},
},
},
})
-- Force override colors AFTER markview sets them up
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.schedule(function()
vim.api.nvim_set_hl(0, "MarkviewCheckboxChecked", { fg = "#f9e2af", force = true })
vim.api.nvim_set_hl(0, "MarkviewCheckboxUnchecked", { fg = "#f9e2af", force = true })
vim.api.nvim_set_hl(0, "MarkviewCheckboxImportant", { fg = "#f9e2af", bold = true, force = true })
vim.api.nvim_set_hl(0, "MarkviewCheckboxPending", { fg = "#f9e2af", force = true })
vim.api.nvim_set_hl(0, "MarkviewCheckboxProgress", { fg = "#f9e2af", force = true })
end)
end,
})
-- Checkbox extras
require("markview.extras.checkboxes").setup({
default = "X",
remove_markers = false,
exit = true,
})
-- Keymaps
vim.keymap.set("n", "<leader>mt", "<cmd>Markview toggle<cr>", { desc = "Toggle Markview" })
vim.keymap.set("n", "<leader>ch", "<cmd>Checkboxes toggle<cr>", { desc = "Toggle checkbox" })
end,
},
}

View File

@@ -1,225 +0,0 @@
return {
{
"OXY2DEV/markview.nvim",
lazy = false,
ft = "markdown",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
local presets = require("markview.presets")
require("markview").setup({
modes = { "n", "no", "c" },
hybrid_modes = { "n" },
callbacks = {
on_enable = function(_, win)
vim.wo[win].conceallevel = 2
vim.wo[win].concealcursor = ""
end,
},
-- Glow headings preset
headings = presets.headings.glow,
-- Code blocks configuration
code_blocks = {
enable = true,
style = "language",
position = "overlay",
min_width = 60,
pad_amount = 2,
pad_char = " ",
language_names = {
{ "py", "python" },
{ "cpp", "C++" },
{ "js", "javascript" },
{ "ts", "typescript" },
{ "sh", "bash" },
},
hl = "MarkviewCode",
sign = true,
sign_hl = "MarkviewCodeSign",
},
-- Block quotes configuration
block_quotes = {
enable = true,
default = {
border = "",
border_hl = "MarkviewBlockQuoteBorder",
},
callouts = {
{
match_string = "NOTE",
callout_preview = "󰋽 Note",
callout_preview_hl = "MarkviewBlockQuoteNote",
border = "",
border_hl = "MarkviewBlockQuoteNote",
},
{
match_string = "TIP",
callout_preview = "󰌶 Tip",
callout_preview_hl = "MarkviewBlockQuoteTip",
border = "",
border_hl = "MarkviewBlockQuoteTip",
},
{
match_string = "IMPORTANT",
callout_preview = " Important",
callout_preview_hl = "MarkviewBlockQuoteImportant",
border = "",
border_hl = "MarkviewBlockQuoteImportant",
},
{
match_string = "WARNING",
callout_preview = " Warning",
callout_preview_hl = "MarkviewBlockQuoteWarn",
border = "",
border_hl = "MarkviewBlockQuoteWarn",
},
{
match_string = "CAUTION",
callout_preview = " Caution",
callout_preview_hl = "MarkviewBlockQuoteError",
border = "",
border_hl = "MarkviewBlockQuoteError",
},
},
},
-- Checkboxes configuration
checkboxes = {
enable = true,
checked = {
text = "",
hl = "MarkviewCheckboxChecked",
scope_hl = nil,
},
unchecked = {
text = "",
hl = "MarkviewCheckboxUnchecked",
scope_hl = nil,
},
custom = {
{
match_string = "!",
text = "!",
hl = "MarkviewCheckboxImportant",
scope_hl = nil,
},
{
match_string = "-",
text = "",
hl = "MarkviewCheckboxPending",
scope_hl = nil,
},
{
match_string = "~",
text = "",
hl = "MarkviewCheckboxProgress",
scope_hl = nil,
},
},
},
-- Tables with rounded borders
tables = {
enable = true,
parts = {
top = { "", "", "", "", "" },
header = { "", "", "", "", "" },
separator = { "", "", "", "", "" },
row = { "", " ", "", " ", "" },
bottom = { "", "", "", "", "" },
overlap = { "" },
},
hl = {
"MarkviewTableHeader",
"MarkviewTableBorder",
"MarkviewTableBorder",
"MarkviewTableBorder",
"MarkviewTableBorder",
},
use_virt_lines = true,
},
-- List items
list_items = {
enable = true,
indent_size = 2,
shift_width = 2,
marker_minus = {
add_padding = true,
text = "",
hl = "MarkviewListItemMinus",
},
marker_plus = {
add_padding = true,
text = "",
hl = "MarkviewListItemPlus",
},
marker_star = {
add_padding = true,
text = "",
hl = "MarkviewListItemStar",
},
},
})
-- Catppuccin Mocha colors
vim.cmd([[
" Code blocks - Catppuccin Mocha
highlight MarkviewCode guibg=#181825
highlight MarkviewCodeSign guifg=#89b4fa
" Block quotes - Catppuccin Mocha
highlight MarkviewBlockQuoteBorder guifg=#6c7086
highlight MarkviewBlockQuoteNote guifg=#89b4fa
highlight MarkviewBlockQuoteTip guifg=#a6e3a1
highlight MarkviewBlockQuoteImportant guifg=#cba6f7
highlight MarkviewBlockQuoteWarn guifg=#fab387
highlight MarkviewBlockQuoteError guifg=#f38ba8
" Checkboxes - Catppuccin Mocha
highlight MarkviewCheckboxChecked guifg=#a6e3a1
highlight MarkviewCheckboxUnchecked guifg=#6c7086
highlight MarkviewCheckboxImportant guifg=#f38ba8 gui=bold
highlight MarkviewCheckboxPending guifg=#fab387
highlight MarkviewCheckboxProgress guifg=#89b4fa
" List items - Catppuccin Mocha
highlight MarkviewListItemMinus guifg=#89b4fa
highlight MarkviewListItemPlus guifg=#a6e3a1
highlight MarkviewListItemStar guifg=#cba6f7
" Tables - Catppuccin Mocha
highlight MarkviewTableHeader guifg=#cba6f7 gui=bold
highlight MarkviewTableBorder guifg=#6c7086
]])
-- Setup checkbox toggle extras
require("markview.extras.checkboxes").setup({
default = "X",
remove_markers = false,
exit = true,
default_marker = "-",
default_state = "X",
})
-- Keymaps
vim.keymap.set("n", "<leader>mt", "<cmd>Markview toggle<cr>", { desc = "Toggle Markview" })
vim.keymap.set("n", "<leader>ch", "<cmd>Checkboxes toggle<cr>", { desc = "Toggle checkbox" })
end,
},
}

View File

@@ -0,0 +1,227 @@
-- nvim-surround configuration with autopairs, treesitter, and comment integration
-- Place this in ~/.config/nvim/lua/plugins/nvim-surround.lua (for lazy.nvim)
return {
-- nvim-surround: manipulate surroundings
{
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require("nvim-surround").setup({
keymaps = {
insert = "<C-g>s",
insert_line = "<C-g>S",
normal = "ys",
normal_cur = "yss",
normal_line = "yS",
normal_cur_line = "ySS",
visual = "S",
visual_line = "gS",
delete = "ds",
change = "cs",
change_line = "cS",
},
-- Custom surrounds
surrounds = {
-- Function call surround
["f"] = {
add = function()
local result = require("nvim-surround.config").get_input("Enter function name: ")
if result then
return { { result .. "(" }, { ")" } }
end
end,
find = function()
return require("nvim-surround.config").get_selection({ motion = "a(" })
end,
delete = "^([^(]+%()().-(%))()$",
change = {
target = "^([^(]+%()().-(%))()$",
replacement = function()
local result = require("nvim-surround.config").get_input("Enter function name: ")
if result then
return { { result .. "(" }, { ")" } }
end
end,
},
},
-- Markdown code block
["c"] = {
add = function()
local lang = require("nvim-surround.config").get_input("Enter language: ")
return { { "```" .. (lang or "") }, { "```" } }
end,
},
-- HTML/JSX tag with class
["C"] = {
add = function()
local class = require("nvim-surround.config").get_input("Enter class name: ")
if class then
return { { '<div class="' .. class .. '">' }, { "</div>" } }
end
end,
},
-- Template literal (JavaScript/TypeScript)
["`"] = {
add = { "`", "`" },
find = "`.-`",
delete = "^(`)().-(`)()$",
},
},
-- Use treesitter for better text object detection
move_cursor = "begin",
indent_lines = function(start, stop)
local b = vim.bo
-- Only indent if the buffer is not a special filetype
if b.ft ~= "help" and b.ft ~= "man" and b.ft ~= "qf" then
vim.cmd(string.format("silent normal! %dG=%dG", start, stop))
end
end,
})
end,
},
-- nvim-autopairs: auto-close brackets with integration
{
"windwp/nvim-autopairs",
event = "InsertEnter",
dependencies = { "hrsh7th/nvim-cmp" },
config = function()
local npairs = require("nvim-autopairs")
local Rule = require("nvim-autopairs.rule")
local cond = require("nvim-autopairs.conds")
npairs.setup({
check_ts = true, -- Use treesitter
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0,
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
enable_moveright = true,
enable_afterquote = true,
enable_check_bracket_line = true,
enable_bracket_in_quote = true,
enable_abbr = false,
break_undo = true,
map_cr = true,
map_bs = true,
map_c_h = false,
map_c_w = false,
})
-- Add spacing inside pairs
local brackets = { { "(", ")" }, { "[", "]" }, { "{", "}" } }
npairs.add_rules({
Rule(" ", " "):with_pair(function(opts)
local pair = opts.line:sub(opts.col - 1, opts.col)
return vim.tbl_contains({
brackets[1][1] .. brackets[1][2],
brackets[2][1] .. brackets[2][2],
brackets[3][1] .. brackets[3][2],
}, pair)
end),
})
for _, bracket in pairs(brackets) do
npairs.add_rules({
Rule(bracket[1] .. " ", " " .. bracket[2])
:with_pair(function()
return false
end)
:with_move(function(opts)
return opts.prev_char:match(".%" .. bracket[2]) ~= nil
end)
:use_key(bracket[2]),
})
end
-- Add arrow function for JavaScript/TypeScript
npairs.add_rules({
Rule("%(.*%)%s*=>$", " { }", { "typescript", "typescriptreact", "javascript", "javascriptreact" })
:use_regex(true)
:set_end_pair_length(2),
})
-- Integration with nvim-cmp
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require("cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
},
-- Comment.nvim: smart commenting with treesitter
{
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"nvim-treesitter/nvim-treesitter",
"JoosepAlviste/nvim-ts-context-commentstring", -- For better JSX/TSX comments
},
config = function()
require("Comment").setup({
-- Use treesitter for comment detection
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
padding = true,
sticky = true,
ignore = "^$", -- Ignore empty lines
-- LHS of toggle mappings in NORMAL mode
toggler = {
line = "gcc", -- Line-comment toggle
block = "gbc", -- Block-comment toggle
},
-- LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
line = "gc", -- Line-comment keymap
block = "gb", -- Block-comment keymap
},
-- LHS of extra mappings
extra = {
above = "gcO", -- Add comment on the line above
below = "gco", -- Add comment on the line below
eol = "gcA", -- Add comment at the end of line
},
mappings = {
basic = true,
extra = true,
},
})
end,
},
-- nvim-ts-context-commentstring: JSX/TSX comment support
{
"JoosepAlviste/nvim-ts-context-commentstring",
lazy = true,
opts = {
enable_autocmd = false, -- Disable auto commands, Comment.nvim handles it
},
},
}

View File

@@ -0,0 +1,172 @@
return {
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
ft = { "markdown" },
opts = {
-- File types to enable rendering
file_types = { "markdown" },
-- Code block configuration
code = {
-- Show language name and icon
enabled = true,
-- Position: 'left', 'right', 'language'
sign = true,
-- Style for code blocks
style = "full",
-- Position of language name (left or right)
position = "left",
-- Disable if you don't want the background
disable_background = false,
-- Width of code block
width = "full",
-- Language icon on the right
right_pad = 1,
left_pad = 1,
-- Border around code blocks
border = "thin",
-- Highlight for the language label
highlight = "RenderMarkdownCode",
highlight_inline = "RenderMarkdownCodeInline",
},
-- Heading configuration
heading = {
enabled = true,
sign = true,
icons = { "󰲡 ", "󰲣 ", "󰲥 ", "󰲧 ", "󰲩 ", "󰲫 " },
backgrounds = {
"RenderMarkdownH1Bg",
"RenderMarkdownH2Bg",
"RenderMarkdownH3Bg",
"RenderMarkdownH4Bg",
"RenderMarkdownH5Bg",
"RenderMarkdownH6Bg",
},
foregrounds = {
"RenderMarkdownH1",
"RenderMarkdownH2",
"RenderMarkdownH3",
"RenderMarkdownH4",
"RenderMarkdownH5",
"RenderMarkdownH6",
},
},
-- Checkbox configuration
checkbox = {
enabled = true,
render_modes = false,
bullet = false,
left_pad = 0,
right_pad = 1,
unchecked = {
icon = "󰄱 ",
highlight = "RenderMarkdownUnchecked",
scope_highlight = nil,
},
checked = {
icon = "󰱒 ",
highlight = "RenderMarkdownChecked",
scope_highlight = nil,
},
-- Custom checkbox states
custom = {
urgent = {
raw = "[!]",
rendered = "󰀦 ",
highlight = "RenderMarkdownUrgent",
},
},
},
-- Block Quotes
quote = {
enabled = true,
render_modes = false,
icon = "",
repeat_linebreak = false,
highlight = {
"RenderMarkdownQuote1",
"RenderMarkdownQuote2",
"RenderMarkdownQuote3",
"RenderMarkdownQuote4",
"RenderMarkdownQuote5",
"RenderMarkdownQuote6",
},
},
-- Table configuration
pipe_table = {
enabled = true,
style = "full",
cell = "padded",
border = {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
},
},
config = function(_, opts)
require("render-markdown").setup(opts)
-- Function to apply colors
local function apply_colors()
local colors = {
-- Heading colors (gradient from red to blue)
h1 = { fg = "#ff6b6b", bg = "#3d1f1f" },
h2 = { fg = "#ffa07a", bg = "#3d2a1f" },
h3 = { fg = "#ffd700", bg = "#3d3d1f" },
h4 = { fg = "#98fb98", bg = "#1f3d1f" },
h5 = { fg = "#87ceeb", bg = "#1f2a3d" },
h6 = { fg = "#dda0dd", bg = "#2a1f3d" },
-- Code block colors
code = { bg = "#1e1e2e" },
-- Checkbox colors
checked = { fg = "#a6e3a1" },
unchecked = { fg = "#6c7086" },
urgent = { fg = "#f38ba8" },
}
-- Apply heading colors
for i = 1, 6 do
local h = "h" .. i
vim.api.nvim_set_hl(0, "RenderMarkdownH" .. i, { fg = colors[h].fg, bold = true })
vim.api.nvim_set_hl(0, "RenderMarkdownH" .. i .. "Bg", { bg = colors[h].bg })
end
-- Apply code block colors
vim.api.nvim_set_hl(0, "RenderMarkdownCode", { bg = colors.code.bg })
vim.api.nvim_set_hl(0, "RenderMarkdownCodeInline", { bg = colors.code.bg })
-- Apply checkbox colors with force
vim.api.nvim_set_hl(0, "RenderMarkdownChecked", { fg = colors.checked.fg, default = false })
vim.api.nvim_set_hl(0, "RenderMarkdownUnchecked", { fg = colors.unchecked.fg, default = false })
vim.api.nvim_set_hl(0, "RenderMarkdownUrgent", { fg = colors.urgent.fg, bold = true, default = false })
end
-- Apply colors immediately
apply_colors()
-- Re-apply colors after colorscheme changes
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = apply_colors,
})
end,
},
},
}

View File

@@ -6,14 +6,33 @@ return {
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = {
"bash", -- For bash code blocks
"html", -- For HTML code blocks
"sql", -- For SQL code blocks
"dockerfile", -- For Docker code blocks
"markdown",
"markdown_inline",
-- Your code block languages
"python",
"java",
"sql",
"bash",
"html",
-- Other languages you use
"lua",
"vim",
},
-- Auto install missing parsers
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
-- Enable syntax highlighting
highlight = {
enable = true,
-- Optional: disable markdown highlighting if render-markdown handles it
-- disable = { 'markdown' },
},
-- Enable indentation
indent = {
enable = true,
},
})
end,
},