Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting to open editors in insert mode by default #613

Closed
pokey opened this issue Apr 22, 2021 · 9 comments · Fixed by #1050
Closed

Setting to open editors in insert mode by default #613

pokey opened this issue Apr 22, 2021 · 9 comments · Fixed by #1050

Comments

@pokey
Copy link

pokey commented Apr 22, 2021

Would you be interested in a PR that would add a setting for opening editors in insert mode by default, instead of normal mode? I would think I could just add a check to this if statement.

@asvetliakov
Copy link
Member

autocmd WinEnter startinsert or something like it. Try to search, there were similar questions/requests

@pokey
Copy link
Author

pokey commented Apr 22, 2021

I'm guessing you're referring to #579. Unfortunately, that doesn't work for me, because the call to commands.executeCommand("vscode-neovim.escape") causes VSCode to lose the current cursor position, which the autocmd doesn't restore. Is there a solution that allows me to preserve the cursor position?

@asvetliakov asvetliakov reopened this Apr 22, 2021
@asvetliakov
Copy link
Member

Right. Then an option to disable mode changing on editor change would be appreaciated

@pokey
Copy link
Author

pokey commented Apr 22, 2021

Great; I'll take a swing!

@pokey
Copy link
Author

pokey commented Apr 22, 2021

And to confirm, am I on the right track with

I would think I could just add a check to this if statement.

Would it be alright if I added a command to toggle the behaviour on and off? I switch between keyboard and voice coding, and when I'm coding by voice I am mostly in insert mode, and by keyboard mostly normal mode

@QAston
Copy link
Contributor

QAston commented May 18, 2021

I'm using something linke this in init.vim:

if exists('g:vscode')
 " start in insert mode
   au BufEnter * start
endif

@theol0403 theol0403 self-assigned this Jun 20, 2021
@trkoch
Copy link
Collaborator

trkoch commented Jul 8, 2021

I think there are a number of features which could be useful related to this issue. Happy to create new issues, but first wanted to discuss it here.

  1. I noticed the editor stays in insert mode while switching to another application (e.g. <Cmd+Tab>). However, the editor enters normal mode when changing tabs or splits. This seems inconsistent to me. Not sure, but I think I'd prefer it if the editor stayed in insert mode in both scenarios.

  2. Sometimes I'd like to disable the bindings completely (including <Esc>), for instance when pairing with a non Vim user, or when in an editing scenario where using the mouse extensively makes sense. VsCodeVim has a setting disableExtension and a command for this. I used to bind the command to a toolbar item I could toggle quickly. Currently I need to disable the extension via the Extensions section, which is pretty cumbersome.

@trkoch
Copy link
Collaborator

trkoch commented Jul 8, 2021

I'm using something linke this in init.vim:

if exists('g:vscode')
 " start in insert mode
   au BufEnter * start
endif

Thanks. This forces the editor to start in insert mode. However, there is a delay when switching tabs and cursor position is off by one character (if it was on the last column before leaving the tab).

@QAston
Copy link
Contributor

QAston commented Jul 30, 2021

Turns out my config workaround causes #642, this needs a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants