feat(nvim): add markup concealments

This commit is contained in:
Price Hiller 2024-02-14 14:31:26 -06:00
parent c9a5d45ca1
commit ff1de2cb01
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
6 changed files with 32 additions and 30 deletions

View File

@ -1,5 +1,4 @@
vim.opt_local.tabstop = 2
vim.opt_local.conceallevel = 0
vim.opt_local.shiftwidth = 2
vim.opt_local.textwidth = 120

View File

@ -4,11 +4,11 @@
(list_marker_star)
(list_marker_plus)
(list_marker_minus)
]) @markup.list.markdown
(#offset! @markup.list.markdown 0 0 0 -1)
]) @markup.list
(#offset! @markup.list 0 0 0 -1)
(#set! conceal "•")
)
; checkboxes
((task_list_marker_unchecked) @markup.list.unchecked.markdown (#set! conceal ""))
((task_list_marker_checked) @markup.list.checked.markdown (#set! conceal "󰄲"))
((task_list_marker_unchecked) @markup.list.unchecked (#set! conceal ""))
((task_list_marker_checked) @markup.list.checked (#set! conceal "󰄲"))

View File

@ -3,3 +3,27 @@
@punctuation.special
(#any-of? @punctuation.special "-" "*" "+")
(#set! conceal "•"))
((checkbox !status) @markup.list.unchecked (#set! conceal ""))
((checkbox
status:
(expr)
@org-checkbox-content (#any-of? @org-checkbox-content "x" "X")) @markup.list.checked
(#set! conceal "󰄲"))
((checkbox
status:
(expr)
@org-checkbox-content (#any-of? @org-checkbox-content "-")) @markup.list.indeterminate
(#set! conceal "󰍵"))
; Table highlights
(row
"|" @punctuation.special)
(cell
"|" @punctuation.special)
(table
(row
(cell (contents) @markup.heading))
(hr) @punctuation.special)

View File

@ -221,9 +221,10 @@ return {
["@OrgTSBlock.org"] = { fg = colors.fujiGray, bold = true, italic = true },
["@OrgTSDirective.org"] = { link = "@OrgTSBlock.org" },
-- Markdown specific
["@markdown_check_undone"] = { fg = colors.carpYellow },
["@markdown_check_ndone"] = { fg = colors.springGreen },
-- Markup specific
["@markup.list.checked"] = { fg = colors.springGreen },
["@markup.list.indeterminate"] = { fg = colors.carpYellow },
["@markup.list.unchecked"] = { fg = colors.crystalBlue },
}
return overrides

View File

@ -4,23 +4,6 @@ return {
branch = "nightly",
dependencies = {
{ "nvim-treesitter/nvim-treesitter" },
{
"akinsho/org-bullets.nvim",
opts = {
concealcursor = true,
symbols = {
list = "",
headlines = {
"󰀘",
"",
"󰺕",
"",
"󰬪",
"󱆭",
},
},
},
},
},
event = "VeryLazy",
ft = { "org" },

View File

@ -1,5 +0,0 @@
syn match org_table_sep /\(|\|\-\|+\)/ contained
syn match org_table_header /|.*|/ contained contains=org_table_sep
syn match org_table_header_region /|.*|\_s*|\_s*\(-+\|\-\).*|\_s*$/ contained contains=org_table_header
syn match org_table /|.*|\_s*$/ contained contains=org_table_sep,org_table_header_region
syn match org_table_region /^\s*|.*|\_s*$/ contains=org_table