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

Shift+S doesn't add indentation #626

Closed
mnsr opened this issue Aug 19, 2016 · 3 comments
Closed

Shift+S doesn't add indentation #626

mnsr opened this issue Aug 19, 2016 · 3 comments

Comments

@mnsr
Copy link

mnsr commented Aug 19, 2016

  • VSCode Version: 1.4.0
  • VsCodeVim Version: latest
  • OS: Win10

The implementation of Shift+S doesn't match standard VIM.

Shift+S is supposed to:

  1. Clear entire line under cursor
  2. Add indentation
  3. Switch to insert mode.

Currently, vscodevim doesn't do #2.

So if if i'm inside a function like this:

function Test() {
  var greeting = "hello";
// << Shift+S should put the correct indentation here (2 spaces) and switch to insert mode
}

@johnfn
Copy link
Member

johnfn commented Aug 19, 2016

Keep in mind that this has to respect the users settings, as the user can turn off indentation and then it won't indent. We were holding off on it before because we didn't have setting integration - now, thanks to @rebornix, we do!

@ascandella
Copy link
Contributor

FWIW I believe this should also happen for cc (it auto-indents in evil-mode in emacs as well as a bare vim with :set autoindent)

@ascandella
Copy link
Contributor

ascandella commented Aug 19, 2016

@johnfn can you clarify the user prefs part? Are you suggesting adding an additional user preference to enable/disable auto-indentaion, or that there already is a setting that we should respect?

EDIT: I see what you mean. Something like Configuration.getInstance().autoindent. Question for @rebornix -- I assume most people will want autoindent to be "on by default". What are the semantics around settings for those? Should we just check for noautoindent?

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

No branches or pull requests

3 participants