Compare commits

..

2 Commits

Author SHA1 Message Date
antoine.lenours 128996be26 Add textwidth to 80 on markdown files 2025-05-28 16:12:23 +02:00
antoine.lenours e5bdddc7cb Add spell checking for french and markdown preview 2025-05-27 13:52:59 +02:00
6 changed files with 101 additions and 10 deletions

View File

@ -20,5 +20,7 @@ M.base46 = {
-- lazyload = false
-- }
--}
vim.defer_fn(function()
pcall(require, "custom.filetype")
end, 0)
return M

View File

@ -1,15 +1,17 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
css = { "prettier" },
html = { "prettier" },
python = { "ruff" },
markdown = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
},
}
return options

View File

@ -0,0 +1,30 @@
return {
enabled = true,
anti_conceal = {
enabled = true,
-- Which elements to always show, ignoring anti conceal behavior. Values can either be
-- booleans to fix the behavior or string lists representing modes where anti conceal
-- behavior will be ignored. Valid values are:
-- head_icon, head_background, head_border, code_language, code_background, code_border,
-- dash, bullet, check_icon, check_scope, quote, table_border, callout, link, sign
ignore = {
code_background = true,
sign = true,
},
above = 0,
below = 0,
},
render_modes = true,
bullets = { "", "", "" },
quote = "",
code = {
width = 'block',
min_width = 45,
left_pad = 2,
language_pad = 2,
},
sign = {
enabled = true,
highlight = 'RenderMarkdownSign',
},
}

10
lua/custom/filetype.lua Normal file
View File

@ -0,0 +1,10 @@
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.opt_local.textwidth = 60 -- soft wrap guide
vim.opt_local.wrap = true -- enable visual wrapping
vim.opt_local.linebreak = true -- wrap at word boundaries
vim.opt_local.spell = true -- optional: spell check
vim.opt_local.spelllang = "fr" -- optional: French spell check
end,
})

View File

@ -1,5 +1,17 @@
require "nvchad.options"
vim.opt.spelllang = {"fr"}
vim.opt.spell = true
vim.textwidth = 80
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.opt_local.textwidth = 80 -- set line wrap at 60 characters
vim.opt_local.wrap = true -- enable visual line wrapping
vim.opt_local.linebreak = true -- wrap at word boundaries
end,
})
-- add yours here!
-- local o = vim.o

View File

@ -31,7 +31,6 @@ return {
"tailwindcss-language-server",
"prettierd",
"eslint-lsp",
"phpactor",
}
}
},
@ -50,8 +49,9 @@ return {
"rust",
"python",
"tsx",
"php"
"markdown"
},
highlight = { enable = true },
},
},
@ -83,5 +83,40 @@ return {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
},
{
'MeanderingProgrammer/render-markdown.nvim',
ft = {"markdown"},
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
config = function()
local opts = require("configs.render-markdown")
require("render-markdown").setup(opts)
end,
},
{
"f3fora/cmp-spell",
dependencies = { "hrsh7th/nvim-cmp" },
event = "InsertEnter",
config = function()
local cmp = require("cmp")
cmp.setup({
sources = cmp.config.sources({
{ name = "spell" }, -- Add spell source
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lsp" },
-- ... your other sources
}),
-- Optional: enable spelling suggestions only in relevant filetypes
enabled = function()
local ft = vim.bo.filetype
return vim.o.spell and (ft == "markdown" or ft == "text" or ft == "tex")
end,
})
end,
},
{
"liuchengxu/vista.vim",
lazy = false,
},
}