vim: Apply gitcommit
options to NeogitCommitMessage
buffers
This commit is contained in:
parent
c39be0a592
commit
786b28fba5
3 changed files with 17 additions and 3 deletions
|
@ -1,4 +1,2 @@
|
||||||
vim.bo.textwidth = 72
|
require("fschauen.util.options").set_gitcommit_buffer_options()
|
||||||
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
|
|
||||||
vim.opt.spell = true -- turn on spell checking
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,15 @@ M.setup = function()
|
||||||
vim.opt.cursorlineopt = "both"
|
vim.opt.cursorlineopt = "both"
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
desc = "Replicate gitcommit filetype options for Neogit commit.",
|
||||||
|
group = group,
|
||||||
|
pattern = "NeogitCommitMessage",
|
||||||
|
callback = function(_)
|
||||||
|
require("fschauen.util.options").set_gitcommit_buffer_options()
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -25,4 +25,11 @@ M.toggle_spell = function()
|
||||||
vim.cmd([[set spell?]])
|
vim.cmd([[set spell?]])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.set_gitcommit_buffer_options = function()
|
||||||
|
print('here we are!')
|
||||||
|
vim.bo.textwidth = 72
|
||||||
|
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
|
||||||
|
vim.opt.spell = true -- turn on spell checking
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Reference in a new issue