.dotfiles/.config/nvim/after/ftplugin/markdown.lua

23 lines
619 B
Lua
Raw Permalink Normal View History

2024-05-24 16:07:28 +03:00
-- get only the currently used buffer in the current window and set the options for it
local winid = vim.api.nvim_get_current_win()
local bufnr = vim.api.nvim_get_current_buf()
2024-05-24 16:07:28 +03:00
local wo = vim.wo[winid][0]
local bo = vim.bo[bufnr]
2024-05-24 16:07:28 +03:00
wo.spell = true
-- bo.textwidth = 120
2024-05-24 16:07:28 +03:00
vim.cmd.highlight({ "SpellBad", "gui=undercurl", "guifg=#DA6464" })
local conform = require("conform")
-- if a formatter is enabled for this filetype then ignore .editorconfig file
-- as we assume a formatter specific config
for _, f in ipairs(conform.list_formatters(bufnr)) do
if f.available then
vim.b.editorconfig = false
break
end
end