platformio / platformio-atom-ide-terminal

A terminal package for Atom, complete with themes, API and more for PlatformIO IDE
https://atom.io/packages/platformio-ide-terminal
MIT License
614 stars 163 forks source link

possible to change copy paste key-mappings to standard linux terminal style? #588

Open softwarecreations opened 5 years ago

softwarecreations commented 5 years ago

Hey guys, I love platformio-atom-ide-terminal :) Thank you!

I find the copy/paste (alt-c alt-v) key mappings very akward for me personally, is it possible to change it to be in the same style as a normal linux terminal?

The following bindings in my keymap.cson don't work for me (all my other custom bindings for other plugins work, though)

'.platform-linux .platformio-ide-terminal .terminal, .platform-win32 .platformio-ide-terminal .terminal':
  'shift-insert': 'platformio-ide-terminal:paste'
  'ctrl-insert': 'platformio-ide-terminal:copy'

Is there a way to get it working?

the-j0k3r commented 5 years ago

Hello @softwarecreations

Im unsure what it is you refer to as a normal Linux terminal, it depends on your distro, they are dime a dozen not all use same terminals by default, :smile: I imagine your request is for local changes that match your unique preferences as it also affects other OS's.

You should be able to.

Find .atom\packages\platformio-ide-terminal\keymaps inside you'll find a file named platformio-ide-terminal.cson and modify that.

Should work.

softwarecreations commented 5 years ago

Hello @the-j0k3r thanks for your reply bud :)

To clarify what I mean by "normal linux terminal keybindinds" i really just want ctrl insert to copy (which isn't even necessary because of platformio-ide-terminal's mouse select auto-copy (which is great), and shift insert to paste. So

Basically all I want to achieve is: Shift-Insert to paste

and I'll be a very happy camper.

Your suggestion is much appreciated, but didn't work and changing platformio-ide-terminal.cson is actually completely unnecessary

I found ~/.atom/packages/platformio-ide-terminal/keymaps/platformio-ide-terminal.cson and changed the end of it from

'.platform-darwin .platformio-ide-terminal .terminal':
  'cmd-c': 'platformio-ide-terminal:copy'
  'cmd-v': 'platformio-ide-terminal:paste'

'.platform-linux .platformio-ide-terminal .terminal, .platform-win32 .platformio-ide-terminal .terminal':
  'alt-v': 'platformio-ide-terminal:paste'
  'alt-c': 'platformio-ide-terminal:copy'

To

  'cmd-c': 'platformio-ide-terminal:copy'
  'shift-insert': 'platformio-ide-terminal:paste'

'.platform-linux .platformio-ide-terminal .terminal, .platform-win32 .platformio-ide-terminal .terminal':
  'shift-insert': 'platformio-ide-terminal:paste'
  'alt-c': 'platformio-ide-terminal:copy'

But Shift Insert doesn't result in pasting (and alt-v doesn't paste anymore either (as expected))

The failed experiment in this post is not particularly surprising to me, because my atom keybindings (in my OP, which I commented out for this test) should have overridden the keys in the OP test.

I can confirm that anything I set in ~/.atom/packages/platformio-ide-terminal/keymaps/platformio-ide-terminal.cson will be overridden by ~/.atom/keymap.cson I've confirmed this now by breaking my key-bindings (by trying to use bindings as above that don't work) in the platformio-ide-terminal.cson and then using stuff that does work (like alt-v to paste, for example) in my ~/.atom/keymap.cson and that makes it work again (with alt-v)

Other exotic key-combinations that don't work

ctrl-shift-insert ctrl-alt-shift-insert alt-shift-insert alt-insert

the-j0k3r commented 5 years ago

Thanks for your detailed reply. Its actually helpful.

But Shift Insert doesn't result in pasting (and alt-v doesn't paste anymore either (as expected))

Its weird, because the Linux entry wasnt modified, removing the .platform-darwin .platformio-ide-terminal .terminal': thats really macOS only.

I can confirm that anything I set in ~/.atom/packages/platformio-ide-terminal/keymaps/platformio-ide-terminal.cson will be overridden by ~/.atom/keymap.cson

That's what I initially suspected, though I didn't try it, maybe originally in an older Atom worked as intended and is now superseded. :/ So to clarify, this issue is really in the atom domain and anything platformio-ide-terminal has defined means squat because its overridden by atom.

As long as you have a way to set your keybindings that suit your individual setup/preferences no matter where this is done, then its OK.

In another time I would put this information in a wiki, but this project is not under active development anymore, -so it maybe of some use to anyone in future wondering about it and stumble onto this, or are gently persuaded to visit this topic.

;)

softwarecreations commented 5 years ago

Thanks bud

Do you know in which part of atom I should file a bug for the lack of ability to bind shift-insert?

the-j0k3r commented 5 years ago

Hi.

I see this https://github.com/atom/atom/blob/master/keymaps/linux.cson located within main atom, so https://github.com/atom/atom/issues seems the right place.

:)

the-j0k3r commented 5 years ago

Please retest again with 2.9.0 =)

SergeiGorbikov commented 4 years ago

Hello. I confirm that in platformio-ide-terminal 2.10.0 it is not possible to attach shift+insert to paste. The code below doesn't work:

'.platform-linux .platformio-ide-terminal .terminal':
  'shift-insert': 'platformio-ide-terminal:paste'

It is superseded by core:paste

the-j0k3r commented 4 years ago

@SergeiGorbikov what does the follwing do?

'.platform-linux .platformio-ide-terminal .terminal':
  'shift-insert': 'core:paste'

See https://github.com/atom/atom/search?q=shift-insert&unscoped_q=shift-insert Same would apply to copy.

Meanwhile ctrl+c and ctrl+shift+v also work just fine At least in Windows

softwarecreations commented 4 years ago

This is what I have, which works. The ctrl-insert is superflous and might not work because it copies automatically when I select. On KDE Plasma (Linux)

'.platform-linux .platformio-ide-terminal .terminal, .platform-win32 .platformio-ide-terminal .terminal':
  'alt-v': 'platformio-ide-terminal:paste'
  'ctrl-shift-v': 'platformio-ide-terminal:paste'
  'ctrl-insert': 'platformio-ide-terminal:copy'

None of the following work

  'shift-insert': 'core:paste'
  'insert': 'platformio-ide-terminal:paste'
  'alt-insert': 'platformio-ide-terminal:paste'
  'shift-insert': 'platformio-ide-terminal:paste'
  'ctrl-alt-insert': 'platformio-ide-terminal:paste'
  'ctrl-alt-shift-insert': 'platformio-ide-terminal:paste'
the-j0k3r commented 4 years ago

Yes its all being overridden by Atom core and IDK if theres any way around that.

SergeiGorbikov commented 4 years ago

what does the follwing do?

'.platform-linux .platformio-ide-terminal .terminal':
  'shift-insert': 'core:paste'

@the-j0k3r it produced the following error:

Failed to load /home/sergei/.atom/keymap.cson

[stdin]:7:19: error: unexpected :
    'shift-insert': 'core:paste'

And it doesn't work.

the-j0k3r commented 4 years ago

Thats an odd error, and of course it didnt work it didnt load the file due to error. perhaps try without copying and pasting incase pasting the colon errors out.