Fix gitcommit starting in insert mode

This commit is contained in:
Daniel Flanagan 2021-07-07 12:03:48 -05:00
parent 0f00298156
commit 87ca18d78e
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 7 additions and 15 deletions

View file

@ -13,7 +13,6 @@ local keymap = {
['<leader>h'] = {':b#<cr>', m.s},
['<leader>k'] = {':bnext<cr>', m.s},
['<leader>j'] = {':bprevious<cr>', m.s},
['<leader>m'] = {':lua print()<cr>', m.s},
['<leader>/'] = {':let @/ = ""<cr>:<BACKSPACE>', m.s},
['<c-q>'] = ':qa<cr>',
['<c-p>'] = '<cmd>Telescope git_files<cr>',
@ -26,6 +25,7 @@ local keymap = {
['<c-l>'] = ':TmuxNavigateRight<cr>',
['<expr> n'] = "'Nn'[v:searchforward]",
['<expr> N'] = "'nN'[v:searchforward]",
['<c-m>'] = ':lua SynGroup()<cr>'
},
t = {},
[''] = {

View file

@ -67,21 +67,13 @@ end
vim.api.nvim_command'colorscheme donokai'
vim.api.nvim_command[[
function! SynGroup()
let l:s = synID(line('.'), col('.'), 1)
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
endfun
nnoremap <c-m> :call SynGroup()<cr>
]]
function SynGroup()
local s = vim.fn.synID(vim.fn.line('.'), vim.fn.col('.'), 1)
print(vim.fn.synIDattr(s, 'name') .. ' -> ' .. vim.fn.synIDattr(vim.fn.synIDtrans(s), 'name'))
end
vim.api.nvim_command[[
command! W write
command! X writequit
augroup gitcommit
au! VimEnter COMMIT_EDITMSG exec 'norm gg' | startinsert!
augroup END
augroup slime
au! FileType gitcommit exec 'norm gg' | startinsert!
au! BufNewFile,BufRead *.slimleex set syntax=slim
augroup END
command! W write
]]