Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mrjones2014/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Dec 5, 2024
2 parents 4f9260c + 223ae18 commit 877db43
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions nvim/ftplugin/markdown.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
vim.api.nvim_set_option_value('wrap', true, { buf = 0 })
vim.api.nvim_set_option_value('linebreak', true, { buf = 0 })
vim.api.nvim_set_option_value('wrap', true, { win = 0 })
vim.api.nvim_set_option_value('linebreak', true, { win = 0 })

-- set up autocmd to revert the above options when another filetype is focused
vim.api.nvim_create_autocmd('BufWinEnter', {
callback = function()
if vim.bo.ft == 'markdown' then
vim.api.nvim_set_option_value('wrap', true, { win = 0 })
vim.api.nvim_set_option_value('linebreak', true, { win = 0 })
else
vim.api.nvim_set_option_value('wrap', false, { win = 0 })
vim.api.nvim_set_option_value('linebreak', false, { win = 0 })
end
end,
})

0 comments on commit 877db43

Please sign in to comment.