nvim: Allow doing commits from within floating terminal

With this we can invoke git commit and not have a nested neovim
instance. This also makes 'C' option in lazygit to work properly
when lazygit is being used from the floating terminal with floaterm.
This commit is contained in:
Sanchayan Maity 2021-01-09 17:21:17 +05:30
parent a4296a5d7e
commit 757b29b026
4 changed files with 5 additions and 0 deletions

View file

@ -1,6 +1,7 @@
setlocal spell
setlocal textwidth=72
setlocal iskeyword+=-
setlocal bufhidden=delete
" Jump to sections of diff
nmap <buffer> [c ?^@@<CR>

View file

@ -0,0 +1 @@
setlocal bufhidden=delete

View file

@ -5,3 +5,5 @@ nnoremap <buffer> <silent> <Leader>e :Edit<CR>
nnoremap <buffer> <silent> <Leader>r :Reword<CR>
nnoremap <buffer> <silent> <Leader>f :Fixup<CR>
nnoremap <buffer> <silent> <Leader>c :Cycle<CR>
setlocal bufhidden=delete

View file

@ -6,6 +6,7 @@ vim.g.floaterm_width = 0.8
vim.g.floaterm_height = 0.8
vim.g.floaterm_winblend = 0
vim.g.floaterm_borderchars = {'', '', '', '', '', '', '', ''}
vim.g.floaterm_gitcommit = 'floaterm'
remap('n', '<C-z>', ':FloatermToggle<CR>', { noremap = true, silent = true })
remap('t', '<C-z>', '<C-\\><C-n>:FloatermToggle<CR>', { noremap = true, silent = true })