Compare commits

..

5 Commits

Author SHA1 Message Date
andrzej d67374d51c add prose mode 2024-05-05 23:35:49 +02:00
andrzej 24fafba36c write proper prose mode function (WIP) 2024-05-05 23:35:16 +02:00
andrzej af1536b5c7 add no linebreaks to defaults 2024-05-05 23:34:59 +02:00
andrzej abb82d74d9 comment out 'save all' keymap as it was screwing up with typing >s 2024-05-05 23:34:25 +02:00
andrzej e4005ea220 remove separate markdown tools install
the autocommands were screwing up the documentation popups. (it's stil installed as a treesiter plugin though!)
2024-05-05 23:33:43 +02:00
6 changed files with 21 additions and 12 deletions

View File

@ -1,2 +0,0 @@
require("options/prose")
vim.cmd("PencilSoft")

View File

@ -4,7 +4,7 @@ vim.g.have_nerd_font = true
require("options.default")
require("lazy_bootstrap")
require("lazy").setup({ { import = "plugins" } })
require("prose_mode")
--BG HACKS
vim.api.nvim_create_autocmd({ "BufEnter", "BufCreate", "BufAdd" }, {
callback = function()

View File

@ -38,8 +38,8 @@ vim.keymap.set("n", "<leader>dab", '<cmd>:%bdelete|edit #|normal`"<CR>', { desc
--SAVE
vim.keymap.set({ "n", "i" }, "<C-s>", "<cmd>w<CR>", { desc = "save" })
vim.keymap.set({ "n", "i" }, "<C-sa>", "<cmd>wa<CR>", { desc = "save" })
--vim.keymap.set({ "n", "i" }, "<C-sa>", "<cmd>wa<CR>", { desc = "save" })
--
--DIAGNOSTIC POPUP
vim.keymap.set("n", "<leader>dp", function()
vim.diagnostic.open_float()

View File

@ -50,3 +50,4 @@ vim.g.markdown_folding = 1
vim.opt.spelllang = "en_us"
vim.opt.spell = true
vim.opt.textwidth = 0 --prevent vim from isnerting linebreaks

View File

@ -1,7 +0,0 @@
return {
"tadmccorkle/markdown.nvim",
ft = "markdown", -- or 'event = "VeryLazy"'
opts = {
-- configuration here or empty for defaults
},
}

View File

@ -0,0 +1,17 @@
local function setProseModeVars(on)
vim.opt.wrap = on
vim.opt.linebreak = on
vim.opt.number = not on
vim.opt.signcolumn = on and "no" or "auto"
end
vim.api.nvim_create_autocmd({ "Bufenter" }, {
callback = function()
if vim.bo.buftype ~= "nofile" then
vim.cmd("PencilSoft")
setProseModeVars(true)
else
vim.cmd("PencilOff")
setProseModeVars(false)
end
end,
})