Skip to content

CMD + Backspace while at Col 1 should remove line #16460

Closed

Description

  • VSCode Version: 1.7.2
  • OS Version: macOS 10.12.1

CMD + Backspace at the end of a line properly removes the characters line, leaving the cursor at Col 1. But using the same combo a second time does nothing. You have to release CMD for Backspace to remove the line. You should be able to keep CMD pressed and either remove all the characters in a line, or remove the line itself if the line is empty.

Steps to Reproduce:

  1. Starting at the right of a line of characters, use CMD + Backspace to remove the characters.
  2. Hit the same combo again, and the line isn't removed.

Activity

  1. chrmarti commented on Dec 5, 2016

    @chrmarti
    Collaborator

    You can use Shift+Cmd+K to delete the current line.

  2. WhatsThatItsPat commented on Dec 5, 2016

    @WhatsThatItsPat
    Author

    Sure, but I think what I'm explaining is standard for other editors and text areas (like the one I'm typing in now).

  3. chrmarti commented on Dec 5, 2016

    @chrmarti
    Collaborator

    Indeed, reopening to track as a feature request.

  4. atipugin commented on May 4, 2017

    @atipugin

    +1

  5. changkun commented on Jun 4, 2017

    @changkun

    I have the same issue and I am on mac. The vscode version is 1.12.2.

    The cmd+backspace works fine when edit text focused. So, I added a key binding for clear all left action when terminal focus:

    [
    { "key": "cmd+backspace",         "command": "deleteAllLeft",
                                         "when": "terminalFocus" }
    ]

    However, the cmd+backspace doesn't work. What did I do wrong? Moreover, the cmd+k also doesn't work when the terminal focused.

  6. chrmarti commented on Jun 5, 2017

    @chrmarti
    Collaborator

    Changkun Ou (@changkun) This issue is about the behavior in the text editor when the cursor is at the begin of the line. Please open a separate issue for your request (which might depend on the shell you are using).

  7. lukeed commented on Oct 29, 2017

    @lukeed

    Any update on this? Or any short-term fix? TBH it's really the only lingering habit I have that trips me up in Code.

  8. chrmarti commented on Oct 30, 2017

    @chrmarti
    Collaborator

    I just found that Cmd + Delete (delete right of cursor) works. (But no update.)

  9. poohitan commented on Mar 18, 2018

    @poohitan

    I see that a corresponding pull request is already merged. Can anyone tell me is this already included in release build? I still encounter this issue on the latest editor version.

  10. chrmarti commented on Mar 19, 2018

    @chrmarti
    Collaborator

    poohitan (@poohitan) Not sure which pull request you refer to, but the above one seems still pending.

  11. poohitan commented on Mar 19, 2018

    @poohitan

    Christof Marti (@chrmarti) yes, I referred to the one above, I wonder how did I saw it as merged, I guess it was the lack of sleep :). Sorry.

  12. zArubaru commented on Apr 30, 2018

    @zArubaru

    Just switched over from Sublime, wishing this would be fixed :/

  13. alastairjwright commented on Jun 12, 2018

    @alastairjwright

    Cmd + backspace is the fastest way to delete lines of code in an upward direction.
    Really hoping this gets fixed!

  14. jandor64 commented on Jun 30, 2018

    @jandor64

    Similarly stymied by this after moving from Sublime, I have the following short-term fix. This is a 'close enough' fix to what I am used to, but with one caveat: It doesn't stop at the linebreak like Sublime, but always removes the line break you're up against.

    deleteline

    1. Install Macros extension
    2. Create new macro in your settings:
    "macros": {
        "deleteLineReturn": [
            "deleteAllLeft",
            "deleteLeft"
        ]
    }
    
    1. Assign key binding:
    {
        "key": "cmd+backspace",
        "command": "macros.deleteLineReturn",
        "when": "editorTextFocus && !editorReadonly"
    }
    

    I went with deleteAllLeft rather than deleteLine, since you may wish to preserve what's to the right of your cursor.

  15. rebornix commented on Oct 24, 2019

    @rebornix
    Contributor

    This is fixed already.

  16. locked and limited conversation to collaborators on Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitymacosIssues with VS Code on MAC/OS X

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions