I'm working through a paper that uses the middle-dot character in Agda code. I'd like to be able to type it up without copy/paste. How can I enter it with agda-mode?
I've tried typical resources such as
http://agda.readthedocs.io/en/latest/tools/emacs-mode.html
http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput
\cdot gives you · and \. gives you ∙ (these are different symbols).
If you can copy/paste a character, then you can discover how to type it by choosing the "Agda/Information about the character at point" option in menu (or using M-x describe-char) and looking at the to input: section.
Related
The Julia extension for VSCode makes it nice and easy to use Unicode characters with latex-like syntax. For example if I want a variable named with the symbol for pi in a unicode-aware language, I can just type \pi<tab> and get the symbol for pi!
But I can't figure out how to search for these characters. The find boxes don't seem to do the same tab-completion on latex-like syntax.
Is there something obvious I'm missing?
This worked for me:
Write \pi<tab> in the editor which will convert it to the symbol
π (you can also do \pi<enter> or \pi<mouse-click first item in drop-down>).
Copy the symbol π from the editor and paste it into the find box
(Ctrl+F) and press enter.
I'm using Lean in VS Code under macOS Catalina with a U.S. keyboard. How do I enter symbols such as for the implication arrow, union, intersection, subset?
Is there some built-in or add-on palette to facilitate this? Or do I have to use Option key combinations and, if so, where do I find the appropriate codes?
From the Lean reference:
You can enter Unicode characters with a backslash. For example, \a inserts an α.
Here are some ways to get the symbol codes:
Guess. Many of the symbols have intuitive names, like \union or \cup for ⋃.
Use the tooltip. If you already have the symbol, then hovering over it will reveal the code.
If you don't have the symbol, right click > Go to definition on a related symbol will often land you close by.
If all else fails, check translations.json. You can usually get away with guessing, though.
⟶ System preferences
⟶ Keyboard
⟶ Input Sources Tab
⟶ + at bottom left
⟶ add and select Unicode Hex Input
from panel on right
⟶ enter unicode characters via alt+[code]
⟶ example, to enter the sign for union, hold down Alt and press 222a
To find additional codes, you can simply Google search Unicode Union for example, and it's almost always the first hit
https://www.google.com/search?q=unicode+Union&oq=unicode+Union&aqs=chrome..69i57.3027j0j7&sourceid=chrome-mobile&ie=UTF-8
If I copy and paste the four symbols from the character selection panel (I'm on macOS) they change to the following: ♠️ ♣️ ♥️ ♦️, whereas I'd like the heart and diamond to be red.
EDIT: Interestingly, i've noticed that if I type the sequence 👁🗨♥️, and then I hit backspace when the cursor is between those two characters, they both transform into 👁♥️! (the same happens with the other three)
Can someone explain what is happening?
I guess this is because your browser doesn't know about these special characters. But I think you can check this page https://www.w3schools.com/charsets/ref_utf_symbols.asp
and replace special characters with unicode codes from page
or from this page http://graphemica.com/%E2%9D%A4
I am using an IM which does not support viewing previous chat history nor can I change my IM. So I have to copy the chat into a text file everytime.
I am using Emacs.Is there some way by which I can highlight the lines which contain the participant names as below?
===> **[Vivek Kumar]**
Hi, how are you doing!
===> **[Mr X Y Z]**
fine
===> **[Vivek Kumar]**
sdfksd;fks;
EDIT 1:
Earlier when I'd access to gvim, I would use the highlight.vim plugin.
Emacs supports highlighting of lines or phrases. You can use one of highlight-lines-matching-regexp, highlight-phrase, or highlight-regexp. I'm sure there are several others too.
To try this, paste your text into the editor, press ESC-x (or Alt-x might work too) to enter the "mini-buffer" at the bottom of the editor window, and enter one of the above commands.
For example, I tried:
highlight-lines-matching-regexp and entered the regexp "\[.*\]" and made it match the names in your example. Here's a screenshot:
You can tweak this expression to fit your needs. Some links to regular expressions in emacs:
http://www.emacswiki.org/emacs/RegularExpression
This question on SO: Good tutorial + reference for Emacs search and replace?
Of course you could also use highlight-phrase and just highlight a simple string of text (instead of messing with regexes).
Here's one where I ran highlight-phrase and entered the two separate names and gave them different colors (hi-yellow and hi-red):
Finally you can then run unhighlight-regexp to clear out the highlighting.
I would like to deal with floral formulae by my DSL coded in groovy, so I need some special symbols such as female sign and Superscripts and Subscripts.
Thanks to the great answers that I found on stackoverflow questions like this now I'm able to
insert special unicode symbols in source code in VIM (MacVim) this way:
CTRL+V. U 2 6 4 0.
However, I would like to be able to do the same in Eclipse IDE (I'm trying to use Groovy/Grails Tool Suite Version: 3.1.0.RELEASE to develop a grails project)
Question: How can I insert in the Eclipse editor a 4 digit unicode symbol by knowing the encoding ( without cut & paste from another source) ?
There appear to be a few ways to get the unicode characters on a Mac. The first few don't appear to be what you want exactly, but included for completeness.
1) Make sure System Preferences->Keyboard "show keyboard & character viewers in menu bar" is selected. Then you can click on that (normally accessible via option+cmd+T, but not in eclipse) to get the Character Viewer. You can then double-click a special character you want and it should insert at cursor.
2) Under the default setup, you should be able to click Option + key to get an alternate character. Use the keyboard viewer from #1 to see what maps to what. Note you can switch to some more mappings using Shift at the same time. This will only get you a subset of unicode characters.
3) From here: Under System Preferences->Languages & Text, go to Input Sources tab. Select the Unicode Hex Input source. You may need to assign switching input sources (under System Prefs->Keyboard->Keyboard Shortcuts->Keyboard) to a hotkey combo (default probably conflicts with spotlight, so change to something else). After that, you should be able to use said hotkey combo to switch to the Unicode Input Source - in that mode, you can hold Option down and enter a hex 4-digit key code, which will result in the character being placed at cursor.