"====================================================================== " " termlite.vim - " " Created by skywind on 2023/08/03 " Last Modified: 2023/08/03 06:33:11 " "====================================================================== if &bt != 'terminal' finish endif "---------------------------------------------------------------------- " basic "---------------------------------------------------------------------- tmap tmap tnoremap tnoremap h h tnoremap j j tnoremap k k tnoremap l l if !has('nvim') tnoremap " tnoremap : : else tnoremap " tnoremap : : endif "---------------------------------------------------------------------- " "---------------------------------------------------------------------- for i in range(10) let n = printf('%d', i == 0? 10 : i) exec printf('tnoremap \%d %dgt', i, n) exec printf('tnoremap %dgt', i, n) endfor for c in ['g', 'w', 's', 'z'] exec printf('tnoremap ', c, c) endfor for c in ['h', 'j', 'k', 'l', 'H', 'J', 'K', 'L', 'o', 'w', 'v', 's'] exec printf('tnoremap ', c, c) endfor for c in ['p', '=', ',', '.', '+', '-'] exec printf('tnoremap ', c, c) endfor "---------------------------------------------------------------------- " auto insert "---------------------------------------------------------------------- function! s:buffer_enter() " unsilent echom "haha1" if &bt == 'terminal' if &ft == 'termlite' if mode() != 't' call feedkeys('i') endif endif endif endfunc "---------------------------------------------------------------------- " "---------------------------------------------------------------------- augroup TermLiteGroup au! au WinEnter * call s:buffer_enter() augroup END