Automatically switch to insert mode when focusing on terminal window in Vim8

twitter logo github logo ・1 min read

autocmd BufWinEnter,WinEnter * if &buftype == 'terminal' | silent! normal i | endif

According to :help Terminal-mode, startinsert doesn't work on terminal window.

In Terminal-Normal mode you can move the cursor around with the usual Vim commands, Visually mark text, yank text, etc. But you cannot change the contents of the buffer. The commands that would start insert mode, such as 'i' and 'a', return to Terminal-Job mode. The window will be updated to show the contents of the terminal. |:startinsert| is ineffective.

twitter logo DISCUSS
Classic DEV Post from Jun 1 '18

Under the Hood of the Most Powerful Video JavaScript API

In this article, our goal is to demonstrate how to leverage our JavaScript API effectively to deliver a better video experience on your website through code walkthroughs & demos. We'll then wrap up with some details under the hood of JW Player, explaining how we're the fastest player on the web.

Daisuke Mino profile image
I am "the" Vulnerability.