4 ms·
If I wanna use something like a ™ I have to google how to enter it, or just google and copy the character. I don't want any extra glyphs in my code until it's j
by nightfly 5y ago
If I wanna use something like a ™ I have to google how to enter it, or just google and copy the character. I don't want any extra glyphs in my code until it's just as easy to enter (at close to full speed) as the glyphs I already have access to.
- Symbiote 5y agoCompose, T, M. https://en.wikipedia.org/wiki/Compose_key https://en.wikipedia.org/wiki/Compose_key
- arp242 5y agoI use the compose key a lot; when writing docs I tend to use → instead of ->, I use – instead of -, etc. I have an extensive XCompose set up for all this, and I find it very convenient. But it's still three keystrokes instead of one. I wouldn't really look forward to using × instead of *, ÷ instead of /, etc. all the time, even though I can type them here with relative ease the hassle increases the more you use it (I don't tend to bother with fancy “quotes” for example). I also don't think it really matters all that much. What's wrong with *? Sure, × looks nicer, but * is clearly the pragmatic choice.*
- aniou 5y agoBTW: there is another obstacle aside from typing issues: readability problems and similarities between operators and ordinary characters with computer fonts. In case of manually written math equations (or LaTeX-ones) operators are easy distinguishable from arguments. They have a different sizes too. For example, "result = axe" and "result = a×e" in many cases looks the same and, even in my browser, with font larger, than ones usually used by my colleagues, they are very hard to distinguish. Difference between "result a÷n" and "result a-b" can be spot easier, but it depends on two one-pixel dots. Ok that was only a mumbling of malcontent - in fact we all know that we all have a sharp, young eyes and we never will be tired or distracted, I'm pretty sure of that. ;)
- arp242 5y agoI would imagine that tooling such as syntax highlighting and decent errors should alleviate that sufficiently to not be a serious practical problem. But yeah, I read over the "axe" and "a×e" difference on my first read (and I browse HN at quite a large zoom by default, not because of vision issues, I just like larger text as a matter of personal preference). Either way, I don't really see the significant advantages in the first place. In spite of the article and some of the strong words of some in this thread ("horrendous", "embarrassing", etc.), I don't see the problem is with just sticking to ASCII. The only case I've seen is where it would have been nice is when «T» was briefly considered for Go generics instead of <T> (later changed to [T]) to avoid overloading the existing meanings of <> and []. I actually would have liked that. But / vs ÷? shrug.
- deleted 5y ago[deleted]
- ht_th 5y agoLast year, when I suddenly had to teach symbol-heavy stuff over the internet, I put together a tool for this because my handwriting is just too bad with a mouse or even a tablet. I wanted to be able to "live" calculate with symbols while I talked over it with my students. I called this tool √𝚎𝚍, the rich Unicode text editing suite (RUTED, pronounced ˈruːtɪd) and I use it in vim: https://gitlab.com/ruted/ruted-vim https://gitlab.com/ruted/ruted-vim. I first defined so called modes of ASCII sequences representing Unicode symbols, like "forall" for "∀", and "NN" for "ℕ", and ";o" for "∘". Then I created a very small vim plugin to enable modes and change modes. When in a mode, you can enter the ASCII sequences, and they are replaced by their Unicode equivalent. It is a bit of a simple hack, but it worked great over the past year. Entering symbols has become very easy for me now.
- scrollaway 5y agoI'm surprised you didn't go the xcompose route! Was this an explicit choice or just didn't know about it?
- ht_th 5y agoYes, I wanted to build something that my students using Windows or Mac OS also could easily use. And I wanted to build a web extension for Firefox and Chrome using the same format. And maybe integrate it in some other tools we're using here as well. Of course, that was too ambitious and the only thing I ended up with was an integration in vim. And that could have been done easier, as your sibling posters have pointed out. Anyway, it was fun to build and very useful the past year.
- idle_zealot 5y agoYou could accomplish this globally with a Composefile on Linux, AutoHotKey script on Windows, or custom abbreviations on Mac.
- ttt0 5y agovim has digraphs and it does the same thing.
- michaelmrose 5y agoIn emacs counsel-unicode-char brings up a menu where you type to narrow for example entering trademark gives you both the ® and ™ On my phone's keyboard typing the words registered or trademark bring up those options as completions. Word and libre office have the menu under insert I actually like the emacs version the best. One could even rig up a deal with emacs client to effectively use it outside of emacs by popping up a floating window then shoving the result into the clipboard.
- zelphirkalt 5y agoAh, cool function that I did not know about before, thank you! Any idea, why it does not list all unicode characters? For example, if I search for what charmap shows me as description of "你", "you, second person pronoun", then the results in Emacs are empty.
- jfk13 5y agoPresumably the lookup is based on Unicode character names. The name of "你" is CJK UNIFIED IDEOGRAPH-4F60. Charmap must be showing you information from some sort of dictionary entry or similar, but that's not part of the identity or name of the Unicode character, any more than the name of the Unicode character U+0049 "I" is "first person singular pronoun" (it's actually named LATIN CAPITAL LETTER I); that's just what it happens to mean in one particular language.
- zelphirkalt 5y agoThat makes sense. A character might mean one thing in one language and another in another language. Even when I enter "4F60" it does not show up. Seems some ranges are missing.
- michaelmrose 5y agoHere is something else neat https://github.com/jeremija/unipicker https://github.com/jeremija/unipicker Can be run with --command="rofi -dmenu" to filter via rofi and piped to xdotool type to insert immediately
- luxxuor 5y agoIf you are on Mac you can use CTRL+CMD+Space to open the symbol picker that also allows searching for symbols. There is something similar on Windows iirc.
- ectopod 5y agoThe shortcut on Windows is WIN+PERIOD. You can continue typing and it will search for matching emoji. For example, type WIN+PERIOD+smile+ENTER and it inserts a smiley face. It also supports mathematical symbols and greek letters using the mouse, but the search doesn't find them. A shame, because it's nearly useful.
- techrat 5y agoFor what it's worth, it seems to be a default option in Linux. xUbuntu, for me, went into Settings, Keyboard, Layout, unchecked Use System Defaults, selected a compose key (I picked Right Alt) Was able to do a TM by holding shift and right alt, typing TM and letting go of shift and right alt. ™ Punctuation and vowels result in accents: Û Ü Ä Ö Ô Þ Ŷ Ô ⸘ ⸘ Æ «» ¿¡ ¨ ¯--_ ⋄
- scrollaway 5y agoI haven't advertised this very much but years ago I wrote my own keyboard layout because things like this annoyed me. I came from an AZERTY background and wanted the m key moved in qwerty, as well as various other adjustments for common symbols and punctuation, especially for programming. Anyway, a year or so ago i contributed it back to xkeyboard. On Linux you can find it in English (US) variants, Drix. https://cgit.freedesktop.org/xkeyboard-config/tree/symbols/us#n2039 https://cgit.freedesktop.org/xkeyboard-config/tree/symbols/u... The ™ symbol is AltGR+T. × is AltGR+x.
- pyrale 5y agoThe thing is, not everyone has your keyboard, and not everyone speaks your language. Having languages support unicode doesn't mean your project must be written using non-ascii characters, it means other people's projects can be.
- cmcaine 5y agoJulia REPLs and editor plugins have adopted a nice feature where you can type the LaTeX name of the symbol you want to get it. e.g. `\subseteq` followed by tab yields `⊆` or `\trademark` for `™`. You can also do emoji with `\:eyes:` for `` I think this is very practical and if you read code in Julia you can see that it's led to quite a lot of unicode and emoji in source code.