Fork me on GitHub
#vim
<
2020-07-16
>
martinklepsch13:07:45

:term has these docs for switching into terminal mode automatically: autocmd TermOpen * startinsert — I’m wondering how I could package that up in a function or similar that would switch automatically for a specific command but not generally

Jorin13:07:33

not sure if that helps you but I have a shortcut setup that goes directly into insert mode like this:

nnoremap gtt :term<CR>i

noisesmith14:07:51

I find that some modes which build on term are broken, where for example starting a terminal opens it in a split, then leaves me in my original file but now I am in insert mode

noisesmith14:07:40

this might be interaction with placement prefix commands like :vert and :abo - it's intermittent

martinklepsch16:07:15

@U8ZN5EHGU I think that should work! I’ll add a command to execute but this seems like it should do the trick

Jorin16:07:56

nice 🙂

martinklepsch16:07:18

yup, works perfectly, thank you!