-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tab substitution of math symbols to Unicode in REPL #6340
Comments
+1111111111111111 |
Best... feature... ever. All editors should work this way -- not just REPLs. |
Might be a useful source of inspiration: https://github.com/mvoidex/UnicodeMath |
Tab substitution is a much better name for what we want. |
The extension for Sublime is better than nothing yet feels reminiscent of the LaTeX does offer some inspiration here, but in the REPL (at least) I still want to be able to type Ideally, the REPL mapping would map localised mnemonics to characters read (at startup) from a user-customizable config. So the name for |
I'd vote to use latex symbol names, rather than invent a new set of names It also may be a good idea for these substitutions to start with the -s |
Agreed on both points – LaTeX symbol names and leading backslash. |
I would use the backslash but can see anything else being a bit annoying |
In Mathematica1 you can get 1. Not trying to start a bikeshed, this is just FYI… But |
👍 |
tab complitution? |
+1 for LaTeX style Would it make sense to support only the most common symbols and let the
|
(A slightly-OT trick I set up in my system to type greek symbols: I configured the keyboard layout to be greek while the right Ctrl key is pressed. So I just have to press Ctrl+b to type β or Ctrl+Shift+v to type Ω, everywhere.) |
@cdsousa – that's a nifty trick, what OS? |
Well, in my case I do the trick with KDE (System Settings/Input Devices/Keyboard/Advanced/Switching to another layout), but maybe it can be done in other DE and OS with more or less work... |
For a similar trick on OS X, see http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html. I use multi-stroke keybindings so that the sequence |
On OSX, if you add a Greek keyboard option, then Cmd-space switches between English and Greek. So you can type "Cmd-space a Cmd-space" to get α. You can do something similar in Windows, as I understand it. However, easy access to Greek letters is not enough, because you want to be able to easily type ∂x, ∞, ℓ, and so on. This is why LaTeX tab-substitution would come in handy. |
Like @stevengj said. As understand the discussion, tabsub (neologism?) with LaTeX style would be 100% compatible with system input tricks -- which are pretty cool but wildly inconsistent across OS and Desktop managers. |
It occurred to me that even for "ordinary" tab completion, we may need to replace some of the preceding string. The reason is that the REPL input is unnormalized, whereas tab-completion will need to NFC-normalize before checking for matches. (@loladiro, I'm guessing REPLCompletions is not doing this yet.) The replacement string will similarly be normalized, and hence might need to replace some of the preceding unnormalized string. So, we have to implement tab substitution, not just tab completion, even without nifty symbol substitution. |
Yup. That's a really good point. Even though they're planning on supporting this kind of thing, we should probably point this out to @fperez, et al. for the IPython protocol redesign. |
This is now implemented, and happily it turned out that both the REPL code and IPython already supported tab substitution (not just tab completion). Now, if only someone would implement this in |
Very cool!
|
I love that there is a |
As we discussed with @fperez for future IPython work, it would be nice if tab completion were more flexible, and were really "tab substitution". For example, it would be nice to be able to type
alpha<tab>
and getα
as a possible "completion", and more generally to build in Unicode substitution for many common LaTeX math symbols.The text was updated successfully, but these errors were encountered: