Code Monkey home page Code Monkey logo

Comments (5)

nicoespeon avatar nicoespeon commented on August 15, 2024

Oh my… I'm terrible at choosing correct default keybindings for Windows / Linux. So, checking at this official list of top keybindings I see that all simple combinations are taken.

I'll set it to Shift + Ctrl + Alt + ↑/↓. It's more complex, but it seems to be free. Unless you have a better suggestion 😄

I'll ship that with this week release, so it should come by the end of the week. In the meantime, you can override Abracadabra keybinding like all other VS Code keybinding, so hopefully it stops clashing. Sorry for that, I understand how annoying it is 😉

from abracadabra.

David-Else avatar David-Else commented on August 15, 2024

@nicoespeon Thanks for your quick reply... please don't change to Shift + Ctrl + Alt + ↑/↓ as that is used by Gnome desktop to change workspace! Gnome is used by all the main distributions including Ubuntu and Fedora. If you use that then Gnome overrides it, so it effectively makes the shortcut do nothing.

It's 9 am here in the UK, I see you made the change already, but I am afraid it does not work for Linux users :(

I had a look and think you can change key bindings per OS, but I have never tried this:

https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts

I don't know if that would be a good idea or not, probably not as it might confuse things.

I know it is hard to decide shortcuts when they are all taken! I don't know what to suggest for move statement. I had a look, and saw you are emulating the sublime text config? I don't think VS Code people move statements up and down :)

from abracadabra.

nicoespeon avatar nicoespeon commented on August 15, 2024

that is used by Gnome desktop to change workspace

Arf, damned 😆
That's fine, I didn't released it yet as I wanted to get your feedback.

So yes, it can be configured per OS. I've set a different one on MacOS (it's the one I use). I could set Shift + Ctrl + Alt + ↑/↓ for Windows, then find another one for Linux. But I'd still need to find a shortcut for Linux users…

And yeah, "move statements" has a top-level shortcut in IntelliJ and Sublime, but it was not implemented by VS Code. So people don't move statements up and down… but I think that would be cool if they could. Which is why this extension is doing—it's the "slide statements" refactoring.

But apparently, VS Code has taken all other relevant combinations for things like "duplicate the line" or "insert cursor when multicursor" 🤔

Is there any other special key on Linux that I could use? On Mac we have Cmd, but we can't use that on Window because it's reserved for OS stuff.

If we don't have a better idea, I'll fallback to something like Shift + Alt + U / D for Linux 🤷‍♂

Re-opening the issue until a solution is found.

from abracadabra.

David-Else avatar David-Else commented on August 15, 2024

It is a real shame that the VS Code moveLines actions don't just move the whole statement. I have no idea why anyone would want to move just a line, this would be a good pull request for the editor.

Not sure what shortcut would be good I am afraid, no special Linux key comes to mind, Shift + Alt + U / D would be as good as anything else I guess.

from abracadabra.

nicoespeon avatar nicoespeon commented on August 15, 2024

this would be a good pull request for the editor

I think so indeed. I want to improve the UX of "move statements" before suggesting the feature to the main repo. Also, I'm not sure that would be integrated soon considering some related issues are more than 1 year old: microsoft/vscode#54829

So I went for Alt + Shift + U / D as Alt & Shift are easier to press than Ctrl & Shift. Also, I think U / D is a good compromise for Up and Down.

cheers-tired

from abracadabra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.