How can I put 0x08 ascii character using MacBook? - macos

I'm writing this question because one little invisible problem has taken from me hours and hours of dummy searchings, and the time just has been wasted (here is that question: CSS: Is there any difference between these two parts?)
Does anybody know how the character 0x08 ("backspace" in ASCII) can be written into a text using a MacBook and a simple IDE (I use the "Coda")?
There is no ability to press Alt + 08 on MacBook (there is no digital keys part on the MacBook's keyboard).
How it can happen?

Did you copy & paste it from anywhere? Because the only way I know - apart from what SCFrench suggested - is to enable this in Terminal by typing:
stty erase SPACE CTRL+V CTRL+H RETURN

Not sure if this is the easiest way, but:
In the Keyboard system preferences panel, check "Show Keyboard & Character Viewer in menu bar".
Find the Keyboard menu bar icon (on the right side of the menu bar), click it, and select "Show Character Viewer".
In the Characters window that appears, find the "View" pop up menu and select "Code Tables".
Select the Unicode coding tab.
In the middle section where all the characters are displayed, click on the entry for 0008 (it will be blank, but the Name: field will say "BACKSPACE").
Click the Insert button in the same window.
Since the character is non-printable, it doesn't actually show anything in the text editor, but (at least in TextEdit) you will see that you have to hit the left or right arrow key more than once to move past it. I also confirmed by dumping the file in hex that it contains a 08 byte.
You could also use this technique to set up a Text Substitution in the Text tab of the Language & Text system preference panel.

Shift + Up Arrow + Delete/Backspace. It's a bug.
http://www.openradar.me/5288750

Related

Visual Studio 2013 - Replace All Button gone (not just off screen)

I am unable to perform multi-file text search and replace (in Visual Studio).
In the past, when I opened the "Replace in Files" dialog, there were 4 buttons in the lower right. One of the bottom two buttons allowed me to "Replace All".
The two lower buttons (including "Replace All") are no longer present.
I believe this occurred after I changed some Windows settings so that I could use menus without the Magnifier.
It is not just a matter of the buttons being off-screen because the window is too large (although it is too large - they would be off-screen, if they were present).
I can drag the window and see the bottom, even though the top is then off-screen (I use AltWindowDrag, allowing me to hold the ALT key, and drag by any part of the window, not just the title bar).
The two lower buttons are not present. I'm unable to resize the window - when I try, nothing happens, or the window repositions so that I can see the title bar, but can no longer see the bottom.
The two buttons that are still present (Find Next and Replace) don't have keyboard shortcuts, so I presume that Replace All doesn't either. Nor can I select either of those two buttons using Tab, so probably can't select an "invisible" "Replace All" button that way.
Any help appreciated.
You can use Find and Replace by pressing Ctrl+H and to Replace All just use Alt+A.

Issue switching language input

On windows 7 new install I couldn't change language via right alt +
shift.
I could do by the left alt + shift.
I used to change by right alt shift and left alt shift all worked in the previous win7 installation.
Is there anyway to solve this?
Is the keyboard layout set correctly and is the right Alt in fact an Alt-Gr instead of a plain Alt key?
If you right-click your taskbar I think there may be an option to open your Keyboard and Language options. If I'm not remembering correctly then you can certainly get to it through your Control Panel. You can change the keyboard layout here.
Open a text editor and try typing in the alternate and lesser used keys such as #$/|~` and so on to test if the right keys produce the right characters.
The on screen keyboard can also give you a display of what layout the computer thinks you are using. You can find that in your Accessibility Options.

Textmate-like Keyboard Navigation for the Command Line?

How do I better navigate the command line? In TextMate, I can do:
CMD + ALT + ARROW to switch tabs
CMD + SHIFT + ARROW to highlight lines of text
ALT + SHIFT + ARROW to highlight words
ALT + ARROW to jump words, etc.
How do I do this kind of stuff in the terminal?
Here's a slightly more complete mapping from Mac text navigation to the default Readline keys:
I set this up in the Keys pane of my iTerm2 preferences, but you should be able to make the same mappings in Terminal.app (Edit: Everything except the first two. Terminal.app only lets you pick from a few different keys)
In MacOS' Terminal app, you can change your keyboard bindings; go to Terminal Preferences (shortcut Cmd + ,) and navigate to the 'Keyboard' tab:
Key => Action
control cursor left => \033b
control cursor right => \033f
etc. You can do the same thing with other emacs-style bindings. As far as switching tabs, that's a System Preferences > Keyboard > Keyboard Shortcuts setting; click 'Application Shortcuts' on the left side, and then click + on the right to add a new shortcut. Use your desired keyboard combo and pair it with the exact menu name, which in Terminal for moving forward/backward through tabs is 'Select Next Tab' and 'Select Previous Tab' (via the Window menu in Terminal), respectively.
Does that help?
This is a pointer for anyone landing here looking for the equivalent tips for iTerm (as opposed to the default terminal).
To do the same in iTerm, go to menu "Bookmarks", "Manage Profiles", "Keyboard profiles", "Global".
Then add all of the shortcuts you see in the other answers here, but instead of sending text "\033..." when creating a mapping, you simply select the action "send character sequence" and the character for the escape sequence!.
"\033b" becomes b
"\033f" becomes f
and so on.
Escape sequence example
Some things can be done by editing the readline bindings (see bind -p / man bash) but for some of the mac keyboard keys you can (or need to?) set extras up in Terminal.app's preferences.
For word navigation try this:
Terminal preferences -> settings -> keyboard
add the following:
option cursor left \033b (escape b) (backwards word)
option cursor right \033f (escape f) (forward word)
option forward delete \033d (escape d) (kill word)
Word boundaries behave a little differently, but it's better than single character or whole line navigation, and doesn't require trading your option key for a meta key and learning a bunch of new key combos.

How to insert the hash symbol in TextMate for Mac on a British Keyboard?

When using TextMate on a Mac for HTML (and indeed any other language) I can't enter the hash (#) symbol using the keyboard. British keyboards have a £ symbol on the 3 key which displaces the hash symbol.
In several other Mac application, you can press alt+3 to get the hash symbol, but in TextMate, that doesn't work.
Is there an alternative that more experienced Mac programmers than me know of?
For programming it's generally a good idea to switch to a US keyboard layout - this only really affects the use of Shift + 3 vs Option + 3 (£ and # get toggled - you can still get £ via Option + 3).
System Preferences -> Language & Text -> Input Sources -> U.S. (and check "Show Input menu in menu bar" for convenient toggling between US and UK keyboard layouts).
Doesn't Alt-3 work for you?
I just checked it on my MBP and it works fine. (I had to first enable/activate another keyboard by: system preference > Language & Text > Input Sources > (the check the boxes next the languages you want to enable. Close Sys Pref, then click on flag in upper right hand corner of your menubar. Then click on either "Show Keyboard Viewer" or "Show Character Viewer"--either will show you this key binding.
My bust--Paul's answer wasn't in when i first looked at this Q; only noticed it after i fired off my (obviously redundant) answer.

Textmate: remap Escape for word completion

In the Textmate code-editor I use the Escape-key, for word completion, alot.
Is there a way to bind another key-shortcut to its functionality ?
(ps: my CAPSLOCK is already CTRL)
A much better way to do this (and this applies to all Mac apps in general) is to
Open System Preferences > Keyboard & Mouse > Keyboard shortcuts
Click the + sign at the bottom
Choose TextMate from the application menu
Type the exact name of the menu command for next completion and previous completion
Now type the shortcut you want to use and click the Add button
To remap the esc key you have to copy
/Applications/TextMate.app/Contents/Resources/KeyBindings.dict
to
~/Library/Application Support/TextMate/KeyBindings.dict
and then edit it, preferably using TextMate :) as Property List Editor messes up the codes.
Look for nextCompletion and previousCompletion and replace their values with whatever suits your needs best. For example, you could replace \033 (code for esc) to \t (->|).

Resources