Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Add indent and dedent in insert mode #334

Closed
pickfire opened this issue Jun 21, 2021 · 5 comments
Closed

Add indent and dedent in insert mode #334

pickfire opened this issue Jun 21, 2021 · 5 comments
Assignees
Labels
A-keymap Area: Keymap and keybindings C-enhancement Category: Improvements

Comments

@pickfire
Copy link
Contributor

pickfire commented Jun 21, 2021

Vim have this useful feature to allow indent and dedent, kakoune does not have this which I missed.

I think it will be useful at this stage when we don't have auto-indent or auto-dedent. Rather than <backspace><backspace><backspace><backspace> we can do ctrl-d once in insert mode to cancel out 4 spaces indented.

It will probably use similar mechanism to < and > but I don't know how it will affect . yet.

Planning to do it later when I have time, probably after infobox.

@pickfire pickfire added C-enhancement Category: Improvements A-keymap Area: Keymap and keybindings labels Jun 21, 2021
@pickfire pickfire self-assigned this Jun 21, 2021
@pickfire pickfire changed the title Add ctrl-t and ctrl-d in insert mode Add indent and dedent in insert mode Jun 21, 2021
@CptPotato
Copy link
Contributor

I've seen other editors use shift+tab for that purpose. Not sure if this is in line with modal editors though.

@sudormrfbin
Copy link
Member

ctrl-t and ctrl-d in vim indents and dedents even if the cursor is on the middle or end of the line. So if we go with shift-tab we wouldn't have a counterpart. How about ctrl-, and ctrl-. (same keys as < and >) ?

@pickfire
Copy link
Contributor Author

pickfire commented Jun 22, 2021

How about ctrl-, and ctrl-. (same keys as < and >) ?

That works but not discoverable. Who would have thought that it is the version of < and > without shift? And that is only assuming that the users use qwerty.

shift-tab is hard probably because it's in a terminal, so we shift-tab to both indent and dedent?

@sudormrfbin
Copy link
Member

sudormrfbin commented Jun 22, 2021

Ah the qwerty point is good enough to drop those suggestions. Maybe we should just go with vim's defaults (also right now we strip shift from all key events).

@TornaxO7
Copy link
Contributor

TornaxO7 commented Dec 2, 2023

Can this issue be closed or is the suggestion here to have a default keybinding for this?

@helix-editor helix-editor locked and limited conversation to collaborators Apr 13, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10387 Apr 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-keymap Area: Keymap and keybindings C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

4 participants