1
0
Fork 0

nvim: add autosplit workaround vor NeogitCommitMessage

it doesn't work with vim.g.autosplit_ft, probably because the filetype
is set later than expected
This commit is contained in:
tastytea 2022-08-28 23:49:13 +02:00
parent 5602a63e52
commit 374b4ed38d
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 10 additions and 3 deletions

View File

@ -43,7 +43,8 @@ neogit.setup {
kind = 'tab',
integrations = {
diffview = true
}
},
disable_insert_on_commit = false
}
map('n', '<Leader>gg', neogit.open, 'Open Neogit')
@ -51,10 +52,16 @@ map('n', '<Leader>gg', neogit.open, 'Open Neogit')
vim.api.nvim_create_augroup('config_coding', { clear = true })
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = 'config_coding',
pattern = { 'gitcommit', 'gitrebase', 'NeogitCommitMessage' },
pattern = { 'gitcommit', 'gitrebase' },
command = [[startinsert | 1]]
})
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = 'config_coding',
pattern = { 'NeogitCommitMessage' },
callback = require('autosplit')
})
vim.api.nvim_create_autocmd({ 'FileType' }, {
group = 'config_coding',
pattern = { 'Neogit*' },

View File

@ -40,7 +40,7 @@ vim.api.nvim_create_user_command('Ht', 'tab help <args>', {
-- split these vertically if there is enough space
vim.g.autosplit_bt = { 'help', 'terminal' }
vim.g.autosplit_ft = {
'man', 'fugitive', 'gitcommit', 'gitrebase', 'NeogitCommitMessage'
'man', 'fugitive', 'gitcommit', 'gitrebase'
}
-- theme