Compare commits

...

3 Commits

Author SHA1 Message Date
d98986006b
feat(nvim): add wrap & spell status in winbar
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 41s
2024-10-30 00:10:48 -05:00
2769e54b4e
feat(nvim): add keybind to toggle wrap 2024-10-30 00:10:40 -05:00
f77814bfd1
feat(nvim): install markview.nvim 2024-10-30 00:10:28 -05:00
5 changed files with 130 additions and 29 deletions

View File

@ -5,6 +5,13 @@ vim.opt_local.textwidth = 0
vim.keymap.set("n", "<leader>fr", "<cmd>MarkdownPreview<CR>", {
buffer = true,
})
vim.keymap.set("n", "<leader>ff", function()
vim.cmd("Markview hybridToggle")
local hybrid_state = require("markview").state.hybrid_mode and "Enabled" or "Disabled"
vim.notify(("%s Markview Hybrid Mode"):format(hybrid_state), vim.log.levels.INFO, { title = "Markview" })
end, {
buffer = true,
})
vim.keymap.set("n", "<C-Space>", function()
local cur_line = vim.fn.line(".")

View File

@ -53,6 +53,11 @@ M.setup = function()
vim.opt.spell = not vim.opt.spell:get()
end, { silent = true, desc = "Toggle Spell" })
-- Toggling wrap
vim.keymap.set("n", "<leader>sw", function()
vim.opt.wrap = not vim.opt.wrap:get()
end, { silent = true, desc = "Toggle Wrap" })
-- Set current focused file as cwd
vim.keymap.set("n", "<leader>cd", ":cd %:p:h<CR>", { silent = true, desc = "Change CWD to Current File" })

View File

@ -23,34 +23,7 @@ return {
}
local headlines = require("headlines")
headlines.setup({
markdown = {
bullets = bullets,
bullet_highlights = bullet_highlights,
fat_headline_lower_string = "",
query = vim.treesitter.query.parse(
"markdown",
[[
(atx_heading [
(atx_h1_marker)
(atx_h2_marker)
(atx_h3_marker)
(atx_h4_marker)
(atx_h5_marker)
(atx_h6_marker)
] @headline)
(thematic_break) @dash
(fenced_code_block) @codeblock
(block_quote_marker) @quote
(block_quote (paragraph (inline (block_continuation) @quote)))
(block_quote (paragraph (block_continuation) @quote))
(block_quote (list (list_item (paragraph (inline (block_continuation) @quote)))))
(block_quote (block_continuation) @quote)
]]
),
},
markdown = false,
rmd = {
bullets = bullets,
bullet_highlights = bullet_highlights,
@ -72,6 +45,6 @@ return {
callback = headlines.refresh,
})
end,
ft = { "markdown", "norg", "rmd", "org" },
ft = { "norg", "rmd", "org" },
},
}

View File

@ -542,6 +542,102 @@ return {
{
provider = "%=",
},
{
{
provider = seps.full.left,
hl = function()
return { fg = colors.sumiInk4, bg = utils.get_highlight("WinBar").bg }
end,
},
{
provider = function()
return "spell "
end,
hl = {
fg = colors.fujiWhite,
bg = colors.sumiInk4,
},
},
{
{
provider = seps.full.left,
hl = function()
return {
fg = vim.opt_local.spell:get() and colors.springGreen or colors.peachRed,
bg = colors.sumiInk4,
}
end,
},
{
provider = function()
return vim.opt_local.spell:get() and "" or ""
end,
hl = function()
return {
fg = colors.sumiInk0,
bg = vim.opt_local.spell:get() and colors.springGreen or colors.peachRed,
}
end,
},
{
provider = seps.full.right .. " ",
hl = function()
return {
fg = vim.opt_local.spell:get() and colors.springGreen or colors.peachRed,
bg = utils.get_highlight("WinBar").bg,
}
end,
},
},
},
{
{
provider = seps.full.left,
hl = function()
return { fg = colors.sumiInk4, bg = utils.get_highlight("WinBar").bg }
end,
},
{
provider = function()
return "wrap "
end,
hl = {
fg = colors.fujiWhite,
bg = colors.sumiInk4,
},
},
{
{
provider = seps.full.left,
hl = function()
return {
fg = vim.opt_local.wrap:get() and colors.springGreen or colors.peachRed,
bg = colors.sumiInk4,
}
end,
},
{
provider = function()
return vim.opt_local.wrap:get() and "" or ""
end,
hl = function()
return {
fg = colors.sumiInk0,
bg = vim.opt_local.wrap:get() and colors.springGreen or colors.peachRed,
}
end,
},
{
provider = seps.full.right .. " ",
hl = function()
return {
fg = vim.opt_local.wrap:get() and colors.springGreen or colors.peachRed,
bg = utils.get_highlight("WinBar").bg,
}
end,
},
},
},
{
update = {
"BufAdd",

View File

@ -0,0 +1,20 @@
return {
"OXY2DEV/markview.nvim",
lazy = false, -- Recommended
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("markview").setup({
hybrid_modes = { "n" },
checkboxes = {
enable = false,
},
list_items = {
enable = false,
},
})
vim.cmd("Markview hybridDisable")
end,
}