Escape Unicode Control Commands in AutoCAD Text Field - autocad

How do you escape the Unicode control commands in a text line? I have a string "%%P123" I want my text line to show but it keeps coming out as "±123" because %%P is treated as the plus/minus symbol

Use %%%%P123, but you'll have to edit the Contents property through the Properties Palette, as the standard TEXT command will automatically evaluate a double %%.

Related

How can I get %i Ruby arrays to be properly highlighted in Vim?

My Vim is not highlighting the relatively new %i syntax. Here's an example:
I included a %w example, which works properly, to show the desired effect.
How can I get Vim to highlight %i properly?
If you’d type :syn ⏎ in control mode while editing any ruby file, you’ll see all the syntax definitions (or open system-wide syntax theme for ruby /usr/share/vim/vim81/syntax/ruby.vim or where is it located.)
The one responsible for %i[] would be rubySymbol.
%i[] is by no mean “relatively new,” the issue is your color theme does not highlight symbols differently. Not only literals, all the symbols. Run:
:hi rubySymbol term=bold ctermfg=Red
and you’ll see it perfectly works. You might tune it according to your needs (see e. g. rubyString for the inspiration) and put this somewhere in your ~/.vim/syntax/ruby.vim.
By default, Vim highlights Ruby's string delimiters and symbol delimiters differently. The string delimiters are highlighted as type Delimiter, and the symbol delimiters are highlighted the same as symbols, which is, by default, of type Constant.
If you want to highlight the %i and brackets the same as the %w, you can run the following command:
:hi link rubySymbolDelimiter rubyStringDelimiter
If you like that setting, you can put it in a file called .vim/after/syntax/ruby.vim and it will be picked up automatically whenever the Ruby syntax is enabled.
Note that in newer versions of Vim, the above command will also cause the colon in front of a symbol to be highlighted the same way as the %i. That functionality isn't configurable, since they both use the rubySymbolDelimiter match group.

How to insert/copy+paste unicode whitespace into a text file using editors like Textmate?

I am trying to create a test csv file for a file cleaning script that is supposed to normalize all whitespace into "normal"/ "regular" whitespace character. The idea is I will insert a bunch of these oddball whitespace characters into this test file in some various locations.
Here are some sites that show these various and oddball whitespaces
https://en.wikipedia.org/wiki/Whitespace_character
http://jkorpela.fi/chars/spaces.html
I've tried to copy and paste from sources like that website but it seems like they always paste in as a normal space in Textmate. It could be that I am not copying what I think I am copying. In the past I've been able to copy and paste into Textmate special / unicode characters when I can clearly see what I am copying but with whitespace characters, I can't confirm since I can can't see it, so I am not sure if the problem is where I am copying from or that Textmate is converting it to the normal space when I paste it in.
If it is easier to use Textedit (the built in editor) or nano (command line editor) to do this I could use those. Or if there is another way other than copying and pasting that is better to get these into Textmate that would be an option.
I am on a MacbookPro running High Sierra MacOS.
If you have LibreOffice installed you can use the spreadsheet application to create these using their hexidecimal equivalent in 1 cell then doing a conversion using
=unichar(hex2dec(cell_ref_to_1rst_cell)).
Far less confusing and you can save the spreadsheet complete with comments as a handy reference. Then you should just be able to copy paste the cell with the unicode character when required.
If you’re using TextMate, various functions provided by the Unicode bundle could be helpful here (install via Preferences → Bundles → Unicode).
With this bundle installed you can use Insert Unicode Character ⌃⌥⌘I to insert a character by name. Search for “space” to get a list of all space characters, then simply click on the desired character (the full title of a character is shown on hover):
Of course once inserted all the space characters look almost identical. To identify them, use Show Unicode Name(s) ⌃⌥⌘U 6. This will display a tooltip showing the unicode of name of the character directly before the cursor (or the names of all selected characters, if a selection is active).
Also have a look at Show Character Inventory (press ⌃⌥⌘U and then select the command from the popup menu): This provides a convenient overview of all the characters in your document (or in the selected text, if a selection is active).

View special chars in Sublime Text

I am using both Notepad2 and Sublime Text 3 and I prefer ST3 over Notepad2 as it has a lot of great features. One thing I miss very much though is the possibility to view special characters in a logfile.
If I have a logfile with this one line in it (<null> is the HEX char 0x00):
ERROR: Received invalid data string [<null><null>e<null><null>test</null>]
If I open it in Notepad2 I get this view:
If I open it in ST3 I get this HEX view:
Is it possible to get the same view in ST3 as in Notepad2, so I can see the special characters?
I just found this option which can be set in the User Settings:
// Files containing null bytes are opened as hexadecimal by default
"enable_hexadecimal_encoding": false
This gives exactly what I wanted:
I've been using this:
https://sublime.wbond.net/packages/HexViewer
But that does not map \0 to NUL, this may cause alignment issue (unless you have a fixed-width NUL glyph in your font).

Input color control chars in Textmate

I can use VIM to input these color control chars by "Ctrl-V, Esc" then it will show me ^[ as a special leading char for color control chars sequence.
How could I do this in Textmate?
Thanks
You can select those from the character viewer (Menu Edit -> Special Characters, then search for 'escape'), but I think you'd be better off using an escaped form of that character, e.g. \033 in Bash or \x1b in PHP. That, of course, would depend on what kind of document you're editing.

Setting a string property to \n in the settings designer

In the visual studio settings designer, how can a setting with string type be set to the newline character? Entering \n results in the string being set to literally \n - the escape sequence doesn't seem to have meaning in the setting seditor. So how do I set a setting's value to a non-printable character?
The settings designer edits the App.config (xml) file and the Settings.settings file. I thought about editing the App.config file directly, but entering \n there again sets the string to literally \n.
Click the down arrow in the Default value edit box. To get this (note the gray text):
There will be a designer file that goes with your form — either formname.designer.cs or formname.designer.vb, depending on which language you use. You'll have to edit this file to include your newline.
This is one of the few cases where I ever recommend touching this file. Most of the time it should be left alone, and your alteration placed in your form's constructor, InitializeComponent() method, or an event line OnLoad or OnActivate.

Resources