voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.47k stars 78 forks source link

Startinsert only specific patterns #295

Open yutkat opened 3 years ago

yutkat commented 3 years ago

Before reporting

I want to do startinsert only for the following patterns. Because I'm using Floaterm to run tests, etc.

let g:floaterm_autoinsert = v:false
autocmd TermOpen,TermEnter term://*/zsh startinsert

But I can't do that because the following line will force the mode back to normal. https://github.com/voldikss/vim-floaterm/blob/b7747704c4df716efd21f331b4d94336c490a5ad/autoload/floaterm/util.vim#L60

I would like you to remove that line or add an option to skip it.

Describe your question, feature request, or bug.

Steps to reproduce

Using the minimal vimrc

set nocompatible
set hidden
set termguicolors
set runtimepath^=/path/to/vim-floaterm
filetype plugin indent on
syntax on
let g:floaterm_autoinsert = v:false
autocmd TermOpen,TermEnter term://*/zsh startinsert
" autocmd FloatermOpen term://*/zsh startinsert " -> overwritten

Steps to reproduce:

  1. :FloatermNew
  2. Check the mode

Actual behaviour

Return to normal mode when opening zsh on floaterm

Expected behaviour

I want to do startinsert only when the execution is zsh.

adigitoleo commented 2 years ago

I propose that this option should be removed completely. Startinsert can be controlled by the users with autocommands, there is no need for us to have this.

voldikss commented 2 years ago

I propose that this option should be removed completely. Startinsert can be controlled by the users with autocommands, there is no need for us to have this.

RIGHT!!! I feel that the plugin has exposed so much interfaces/options which users can implement via easy vimscript. These redunant options increases the complexity of the plugin and I'm considering to remove them.