vscode-emacs-mcx icon indicating copy to clipboard operation
vscode-emacs-mcx copied to clipboard

Feature request: Add Emacs "tab" handling

Open joeshaw opened this issue 3 years ago • 4 comments

Have you considered adding support for the "tab" key doing indentation in the Emacs style? By default pressing "tab" does the standard VSCode operation of increasing the indentation by one level.

VSCode provides a editor.action.ReindentSelectedLines operation but I've found it to be pretty buggy (for example, see https://github.com/microsoft/vscode/issues/121214).

joeshaw avatar Apr 17 '21 01:04 joeshaw

Thank you for the suggestion. I will investigate how to implement it.

whitphx avatar May 03 '21 03:05 whitphx

  • ReindentSelectedLines impl: https://github.com/microsoft/vscode/blob/94c9ea46838a9a619aeafb7e8afd1170c967bb55/src/vs/editor/contrib/indentation/indentation.ts#L326-L375
  • Indent operation generation: https://github.com/microsoft/vscode/blob/94c9ea46838a9a619aeafb7e8afd1170c967bb55/src/vs/editor/contrib/indentation/indentation.ts#L27-L137
    • This looks so complicated...

whitphx avatar May 03 '21 03:05 whitphx

This extension may help: https://marketplace.visualstudio.com/items?itemName=sakapoko.vscode-emacs-indent

whitphx avatar Oct 04 '21 02:10 whitphx

Thanks for the pointer, I'm using that extension already. It's fine, but also relies on the buggy ReindentSelectLines behavior.

joeshaw avatar Oct 15 '21 18:10 joeshaw

The emacs-mcx.emacsLikeTab setting is introduced since 0.51.0, and Tab and C-i work like Emacs' one when it's set as true: https://github.com/whitphx/vscode-emacs-mcx#emacs-mcxemacsliketab

Please open an issue if its behavior is not correct.

whitphx avatar Nov 05 '23 06:11 whitphx