|
From: Tim H. <tho...@te...> - 2017-03-26 16:54:24
|
Am 26.03.2017 um 17:30 schrieb Denis Bitouzé:
> Le 23/03/17 à 23h27, Tim Hoffmann a écrit :
>
>> I'm quite strongly against excessive use menus for listing commands,
>> in particular symbols. Menus are not the right tool:
>>
>> - They can use no or only tiny images (depending on the OS)
>> - They do not provide tooltips
>> - They do not scale: not more than 30 entries (rather less on small
>> screens). We have more than 1500 symbols.
>
> Indeed but Greek letters are often used I guess.
>
>> - They are not searchable
>
> Are (completed) commands searchable?
No. And they don't need to. Because they address the first use case. If
you want need the second use case, a modified symbol panel would be the
way to go.
>> If \ is really a concern for you, do something about this either by
>> putting it on another key
>
> Is it possible at TXS's level? Could be very nice indeed!
Within TXS, this is only possible using macros. But writing something
though a macro is not the same as typing. E.g. the completer won't show
up. So a simple macro inserting \ will probably not fulfill your needs.
Maybe you can work around that specific issue using a script. However, I
don't guarantee that it will or can be made to work in exactly the same
way as typing.
There are other tools which can rebind keys on the OS level.
> For instance, Ctrl+R currently inserts `\\' hence I guess it would be
> possible to make the rarely used `²' key inserts `\'. Is it the case?
>
>> or by using some macro magic. That would also benfit other commands.
>
> Maybe I could do something like that, but certainly not average users.
>
>> --> Reasonly covered by the completer. Done for me.
>>
>> 2. If you are looking for a symbol, you also don't want to scroll
>> through endless list s or menus.
>
> If the symbols are not all in the same menu, but splitted in different
> and categorized menus, these menus won't be endless.
With 30 categories and 30 enties each, you would only cover 900 out of
the 1500 current icons. So, you would at least need three levels. Also,
maybe a category would naturally have more than 30 entries and no
substructure.
> Indeed, suppose for a quite long document I'm working on, I have to use
> `\vartheta' very frequently. With the completer or this searchable
> panel, I still need to type:
>
> - (part of) the command (in such a case, with the completer, at least
> "\vart + RET"),
> - /each time/ I need it.
>
> And, in fact, my request is more about accelerators than menus: what
> could be nice would be to be able to choose (and then change on the fly)
> the accelerators for often needed commands (or, more generally,
> actions). Suppose I can choose `Alt + !' as a `\vartheta' accelerator,
> I would save a lot of time and knots in my brain! :)
If it's just one or two, you can create plain macros an assign the
respective shortcuts.
If you have a buch of apreviations, you can easily create a sort of
accelerator language using macros. One example would be this:
Trigger: (\w+)!!
%SCRIPT
shortcuts = {
'a': '\\alpha',
'b': '\\beta',
't': '\\tau',
'vt': '\\vartheta',}
if (shortcuts[triggerMatches[1]] !== undefined) {
editor.write(val)
}
Just type "vt!!" and it gets expanded to \vartheta. I don't know if !!
is a good choice for your keyboard (or other locales), but the advantage
is that it's really simple to adapt. Also if love Alt+something, you can
remove the trigger and assign a shortcut to the macro. Of course, you'd
have to changes from triggerMatches to getting the word under the
cursor, but that's just two more lines of code.
|