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
|
||||
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
|
||||
vim.opt.spell = true -- turn on spell checking
|
||||
require("fschauen.util.options").set_gitcommit_buffer_options()
|
||||
|
||||
|
|
|
@ -29,6 +29,15 @@ M.setup = function()
|
|||
vim.opt.cursorlineopt = "both"
|
||||
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
|
||||
|
||||
return M
|
||||
|
|
|
@ -25,4 +25,11 @@ M.toggle_spell = function()
|
|||
vim.cmd([[set spell?]])
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue