Recent

Author Topic: Visual Studio keymap (for debugger and compiller)  (Read 1763 times)

Tango600

  • New Member
  • *
  • Posts: 10
Visual Studio keymap (for debugger and compiller)
« on: June 13, 2022, 09:44:39 am »
If I create Visual Studio keymap, how I publish this&

MarkMLl

  • Hero Member
  • *****
  • Posts: 5146
Re: Visual Studio keymap (for debugger and compiller)
« Reply #1 on: June 13, 2022, 09:59:10 am »
Are you saying that you've produced a keymap for Lazarus? If so I'd suggest discussing it here with a particular focus on what OSes etc. you've tested it with. Then submit is as a bug report (see link in left-hand column).

If OTOH you're discussing a keymap for Visual Studio it's not relevant to this forum.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10288
  • FPC developer.
Re: Visual Studio keymap (for debugger and compiller)
« Reply #2 on: June 13, 2022, 10:06:02 am »
If OTOH you're discussing a keymap for Visual Studio it's not relevant to this forum.

If it is to put FPC under an other IDE like VS/VSCode, it is relevant, but should be moved to FPC subforums (not lazarus subforum).

The short answer is probably: put it on github/gitlab or any other form of free hosting.   

MarkMLl

  • Hero Member
  • *****
  • Posts: 5146
Re: Visual Studio keymap (for debugger and compiller)
« Reply #3 on: June 13, 2022, 12:28:15 pm »
If it is to put FPC under an other IDE like VS/VSCode, it is relevant, but should be moved to FPC subforums (not lazarus subforum).

Yes, true.

At this point however I'd note that the Lazarus IDE stands comparison with VSCode, and is superior (in my opinion) to Eclipse. It's a pity that it doesn't support more languages, possibly via something like the Language Server Protocol (noting e.g. the thread at https://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg52619.html).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8260
  • Debugger - SynEdit - and more
    • wiki
Re: Visual Studio keymap (for debugger and compiller)
« Reply #4 on: June 13, 2022, 01:35:32 pm »
If I create Visual Studio keymap, how I publish this&

You mean you went to menu: Tools > Options > Editor > Keymap?

Unfortunately the IDE does not have an Export or Import function for those settings.

You can find the changes you made in the "EditorOptions.xml" file, in your "primary config path".
The "primary config path" can be found in menu View > Ide Internals > About IDE.
It defaults to: C:\Users\<YOUR_USERNAME>\AppData\Local\lazarus or on Linux to ~/.lazarus

The XML in that file has a "<KeyMapping>" section.



So to make your changes available:
- you open that file, and copy that section. Then publish that XML.
- Users who want to use it can (while the IDE is closed) edit their "EditorOptions.xml".


However, your changes will be based on one of the default schemes. Either:
- Lazarus Default
- Classic
- MacOs Apple style
- MacOs Lazarus style

The Mac schemes will have different mappings for the modifier keys.
E.g. "Ctrl-c" will be "Command-C"  (IIRC).

Your changes are relative to your selected scheme. (only the diff is saved).
So it may (at least partly) work with other schemes. But likely will need some work for them.

Of course - if for example you are NOT a Mac user - then everyone importing your scheme, if they too are not Mac users, can use the same base-scheme.
But not all Mac-Users wont be happy using a non-Mac base scheme.
Still they can adapt it....



It would be nice, if someone could contribute Export/Import of keymaps....

Tango600

  • New Member
  • *
  • Posts: 10
Re: Visual Studio keymap (for debugger and compiller)
« Reply #5 on: June 13, 2022, 07:47:56 pm »
... should be moved to FPC subforums (not lazarus subforum).

Why, it is a Lazarus editor keymap.

Tango600

  • New Member
  • *
  • Posts: 10
Re: Visual Studio keymap (for debugger and compiller)
« Reply #6 on: June 13, 2022, 07:50:47 pm »
note: Keymaps is hardcoded in "C:\lazarus\ide\keymapping.pp"

Tango600

  • New Member
  • *
  • Posts: 10
Re: Visual Studio keymap (for debugger and compiller)
« Reply #7 on: June 13, 2022, 07:58:06 pm »
Note: Flashback note: I have installed many IDE on my PC. All IDEs have one keymap, except Lazarus.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2763
    • havefunsoft.com
Re: Visual Studio keymap (for debugger and compiller)
« Reply #8 on: June 13, 2022, 09:47:22 pm »
It would be nice, if someone could contribute Export/Import of keymaps....
maybe, I could do that!
it has been my long time struggle xD

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8260
  • Debugger - SynEdit - and more
    • wiki
Re: Visual Studio keymap (for debugger and compiller)
« Reply #9 on: June 13, 2022, 10:12:52 pm »
It would be nice, if someone could contribute Export/Import of keymaps....
maybe, I could do that!
it has been my long time struggle xD

I'd be happy to assist if you have questions...

There is a similar feature for Colors and Advanced-Mouse-Config already.

The big question is, if an exported keymap should be
- a diff to one of the predefined sets. (That could over time cause issues, if the predefined set changes)
- a full export
- either of those - user can choose during export.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8260
  • Debugger - SynEdit - and more
    • wiki
Re: Visual Studio keymap (for debugger and compiller)
« Reply #10 on: June 13, 2022, 10:13:45 pm »
note: Keymaps is hardcoded in "C:\lazarus\ide\keymapping.pp"

So you edited your copy of keymapping.pp ?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2763
    • havefunsoft.com
Re: Visual Studio keymap (for debugger and compiller)
« Reply #11 on: June 14, 2022, 07:36:02 pm »
Here you go: https://github.com/skalogryz/Lazarus/commit/48eb5a1066438e93268d68486ec66bb9648b4eec

I don't really like the produced export file (which is based on the configuration).
It's not really human editable, but from IDE to IDE it should work just fine and it's future changes friendly already!

So maybe, the human-readable and editable format could be added alter.

todo: check if there're any "standards" in the keymapping world (similar to .editorconfig)

The big question is, if an exported keymap should be
- a diff to one of the predefined sets. (That could over time cause issues, if the predefined set changes)
- a full export
- either of those - user can choose during export.
What is "diff"? i think it's something that only IDE itself could use of, since it's aware of what is considered "default".
When brining the set of keys from one configuration to another, the "default" for source and destination systems can be different.
Thus the concept of "diff" makes no sense.

Just like any other application - the full export for the actual IDE version. (It's understood that commands could be added and removed between Lazarus versions).

upd
There is a similar feature for Colors and Advanced-Mouse-Config already.
For Colors I can only see "Export"... should there be an import too?

Looking through the Options frames, it appears to me that IDE needs some sort of guildelines on how to design those.

upd2
With the Import/Export in place, it should now be easier to get rid of hard-coded schemas and keep them external.
« Last Edit: June 14, 2022, 07:43:02 pm by skalogryz »

MarkMLl

  • Hero Member
  • *****
  • Posts: 5146
Re: Visual Studio keymap (for debugger and compiller)
« Reply #12 on: June 14, 2022, 11:49:57 pm »
todo: check if there're any "standards" in the keymapping world (similar to .editorconfig)

Not to the best of my knowledge. However if you've got access to a Linux system I'd point you at evtest and related info (which broadly speaking gives you a list of input devices- keyboard and other- and what they emit), and also at the mxk utility hence tangentially https://wiki.freepascal.org/Lazarus_IDE_with_Nostromo_Keypad_on_Linux for an example of what it can be used for.

Quote
What is "diff"? i think it's something that only IDE itself could use of, since it's aware of what is considered "default".
When brining the set of keys from one configuration to another, the "default" for source and destination systems can be different.
Thus the concept of "diff" makes no sense.

It makes a lot of sense, and is what Termcap etc. uses. Start off with some fairly standard mapping, and then have a brief list of how the current settings depart from it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2763
    • havefunsoft.com
Re: Visual Studio keymap (for debugger and compiller)
« Reply #13 on: June 15, 2022, 05:38:43 am »
Start off with some fairly standard mapping, and then have a brief list of how the current settings depart from it.
and which mapping is standard for Larazus IDE?
is it standard for all operating systems Lazarus runs on?

MarkMLl

  • Hero Member
  • *****
  • Posts: 5146
Re: Visual Studio keymap (for debugger and compiller)
« Reply #14 on: June 15, 2022, 08:52:07 am »
Start off with some fairly standard mapping, and then have a brief list of how the current settings depart from it.
and which mapping is standard for Larazus IDE?
is it standard for all operating systems Lazarus runs on?

Not really relevant to the point that I think Martin's making. Start off with /something/ and give it a name, then publish modifications indicating what the named base is. The base could actually be a null mapping (i.e. the diff is actually a complete map), or a diff might be appropriate for multiple bases.

That would accommodate the case where e.g. I find I have to change just one mapping to avoid a clash with a KDE hotkey.

As I said, that's the way that termcap etc. have always worked on unix for output terminal control sequences, so there's precedent.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018