I am trying to become familiar with Textmate shortcut keys.
However when I open my "Demo Help" for the Ruby on Rails Bundle it shows keymappings with characters like "& # x21E5"
When I paste them in here they often display correctly as they appear to be HTML escape codes but in the Textmate window they are unreadable. I cant keep referring to a list of HTML escape codes!
How am I supposed to translate those key mappings. Have I got something set up wrongly that they show like this rather than with the normal symbols?
Cheers
George
⇥ appears to be a "normal" key symbol, meaning tab (forward tab, specifically). A quick googling led me to this page, which seems to have a number of such mappings. For reference, the phrase I googled was "key symbols mac".
Using symbols not on the key to represent a key is fairly common when describing mac shortcuts, you have probably not done anything wrong.
For some reason the help file is showing you the unicode hex symbol instead of the actual glyph in the font. If you have Unicode text enabled, inside TextMate you can hold down the Option key and type the four digit code to get a quick translation. Kind of a pain while you're reading a help file but they probably only use a few.
From the Ruby on Rails Bundle Help the ones I see (my version is also showing the codes not the glyphs) are:
2303 is the Control Key
2318 is the Command Key
2325 the option key
21e5 is the Tab key
232b is Delete
2193 Down arrow
21e7 up arrow
21a9 return
BTW, You enter unicode here in SO by entereing &# followed by the decimal code and then a semi-colon, So x21e5 is 8677 decimal so ⇥ yields ⇥
Related
I'm not a big fan of the command line readline keyboard shortcuts so I'm hoping to remap C-Right/C-Left to navigate one word back/forward and C-BS and C-Del to delete one word back/forward. However, after reading the documentation and forumns, I'm not able to figure out how to do this.
Currently, when C-left/C-right are typed in the command line, the cursor doesn't move and instead keycodes are inserted (C-left = [1;5D, C-right = [1;5C). I've tried many remappings but the mappings that I would think would work best for this are:
cmap <C-right> <A-f>
cmap <C-left> <A-b>
I was able to figure out how to delete one word back using the following mappings (on further review there is documentation in the VIFM manual regarding mapping BS):
cnoremap <BS> <C-w>
cnoremap <C-h> <C-w>
However, I'm still uncertain on how to map delete one word forward using C-Del. When I use the following remapping for C-Del, the result is that one character to the left of the cursor is deleted. Note, when I use other C-* combinations for delete word forward the remappings actually works making me think that it may not be possible to remap C-Del:
cmap <C-Del> <A-d>
I'm using VIFM version 0.12 on Arch Linux. Any suggestions?
List of keys that are supported by angle-bracket notation is available in the documentation. And combinations of Ctrl with arrow keys are not there.
See this GitHub issue for a discussion of why and an example of how to work around it:
" ctrl-right
cnoremap <esc>[1;5C <a-f>
" ctrl-left
cnoremap <esc>[1;5D <a-b>
" ctrl-del
cnoremap <esc>[3;5~ <a-d>
At this point I'm still not sure that these sequences are common enough among different terminal types to be hard-coded and not cause trouble.
I am trying to read a text in a given rectangle using readText() function.
The function works correctly except when it has to read some text which has special characters like ' _ & etc.
I tried using validCharacters with readText() function. But it didn't help.
Code -
put ReadText((287,125,810,164),validCharacters:"_-'.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890") into Login
I tried working with character collections. But that doesn't seem to be right because the text trying to pick is a dynamic text combination of numbers alphabets and a special character. So one cannot create a library of character collection of every alphabet (a-z, A-Z), numbers(0-9) and special characters.
Example of text trying to read:
Login_Userid1_1, Login'Userid1_1
So how do I read such text correctly
Debugging OCR is a bit of an imprecise science. EggPlant has a lot of OCR Parameters to tweak. When designing test cases it's best to try use other mechanisms to gather information whenever possible. ReadText() should be considered a last resort when more reliable methods are unavailable. When I've used it I've often needed to do a lot of trial and error to find the right set of settings, and SearchRectangle to get consistent results. Without seeing exactly what images you are trying to read text from it's difficult to impossible to troubleshoot where the issue might be.
One thing that does stand out to me is that you're trying to read strings that may contain underscores. ReadText() has an optional property IgnoreUnderscores which treats underscores as spaces. By default this property is set to ON. It defaults to ON because some OCR engines have problems identifying underscore characters consistently.
If you want to have ReadText() handle underscores you'll want to explicitly set this property to OFF.
ReadText(rect, validCharacters:chars, ignoreUnderscores:OFF)
I have a file in Spanish, when seen on my teacher's PC a bit of text would display as
regresión cuantílica más
but now that I've opened on mine I see this:
regresión cuantÃÂlica más
I have tried "Save with Encoding" to ISO-8859-1 and UTF-8 but it doesn't seem to change anything. Will I need to run some regex replacements on my file or is there a simpler way to fix this?
If you have already saved it and you've lost the original version of the file, it will be a pain to recover.
What you should have done when you noticed the bad characters was "Reopen with encoding", and chosen the "UTF-8" encoding. If you can still get the original file, do this now.
If you can't, then you're stuck with lots of manual fixing. Accented characters (and Euro signs, and a few other things) will show up as multi-character sequences. When you recognize one, use search and replace to replace that sequence with the correct character.
I'm playing around with ANSI escape sequences, e.g.
echo -e "\e[91mHello\e[m"
on a Linux console to display colored text.
Now I try to use superscript and subscript output like a=b².
I read here and here about: Partial Line Down (subscript) and Partial Line Up (superscript) but I'm not sure about the exact syntax and even which terminal client might supports this.
Any suggestions about this?
Possibly some commercial product supports it, but it's not supported by any terminal emulator you'll encounter (unless someone modifies one just to prove a point).
The standard describes possible escape sequences, but there is no requirement that any given sequence is supported by any terminal. There are commonly supported (and assumed) sequences such as clearing the screen, but even for that, not all terminals have supported the feature.
The reason is that terminal emulators are generally used with applications (such as text editors) which assume a regular set of rows/columns, and that the text is shown compactly (no extra space such as would be needed to allow for partial line movement. Back in the day when people used typewriters, it was common to have 1.5 or 2.0 line-spacing, and get no more than 33 lines on a page. That changed, long ago.
The need for subscripts/superscripts didn't go away — Unicode provides a usable set of characters with that representation (see Superscripts and Subscripts
Range: 2070–209F)
Further reading:
Your New Royal Portable (1953).
Line Spacing - Butterick's Practical Typography
console_codes - Linux console escape and control sequences
I am facing a weird problem.
I have extracted data from an Excel file. It should contain an IBAN account number.
Then I tried to analyze the set of account numbers (which the source guarantees to be good) with a Java library.
To keep the scope of the question narrow, I can't explain the following. The below strings are different
03069
03069
The first is a copy & paste from the Excel file, the second is handwritten. Google returns different results for abi [above number] and in fact in the second case I can find that it is the bank code for Intesa Sanpaolo bank (exact page displaying the ABI code, localized, here).
So, to keep the scope narrow: how is that possible? Is it something to do with the encoding?
Try it yourself: do CTRL+F and try type "030", it will select both lines. Now type 6, it will match only the 2nd line.
Same happened in Notepad++
There's an U+200B ZERO WIDTH SPACE in between 030 and 69 in the first text.
Paste the text in https://www.branah.com/unicode-converter for example, or edit in a hexadecimal capable editor.
The solution for cleaning such strings could be for example to whitelist characters, so replace everything that isn't A-Z0-9 will be scrubbed.