When I use left/right arrow keys, it goes to beginning or end of line - windows

I pressed some shortcut on the keyboard accidentally that now when I edit a text file, if I press left arrow key once, it goes to beginnnig of line, and when I press right arrow key it goes to the end of the line.
Do you know how to fix it?

Seems that your alt gr is stuck.
Try to use another keyboard or the on-screen keyboard to see if the problem occurs.

Related

How to replace Discard changes with Do you want to save changes

If Esc key is pressed in
MODIFY FILE test
window, Visual FoxPro shows
Discard changes
Yes No
prompt. How can I replace this with
Do you want to save changes to test.txt
Yes No Cancel
prompt ?
A Yes/No/Cancel prompt appears if I click on the close button in the upper right corner of the close window.
Is it possible to force it to appear when I press ESC also ?
Can ON KEY LABEL esc or some custom edit windows command be used or is there some other solution ?
Yes, you could solve it with ON KEY LABEL esc someFunctionCall(). The function has then to display the dialog you desire, and you also have to write the logic whether you pressed Yes, No or Cancel. Also keep in mind, that you have to issue ON KEY LABEL esc again, so the dialog won't show up everywhere.
Another solution would be hitting CTRL+S before you press Escape. With another dialog you have to move the mouse or press another button anyways, so there is no time to safe here.

Shorten code automatically in Xcode

I was wondering if it was possible to shorten code automatically in the last version of xcode. You know, when you press on the side of a void method for example and the (...) appear, and you have a shorter page. Is there a command to do it?
Click on the Editor>Code Folding menu and you'll see all your options for this, along with the keyboard shortcuts.
The shortcut is cmnd + shift + option + left arrow key. This will collapse all functions.
You can press command + alt + left cursor key on your keyboard to fold your codes or press command + alt + right cursor key to unfold. Make sure your pointer is inside of the curly brackets.

Basic arrow keys and page up/down usage in intellij on mac

What are the equivalent keys for page up/ page down in intellij on os x? Option arrow up/down is not doing anything AFAICT.
Go to Preferences | Keymap and assign any hotkey you like to Move Up/Down and Scroll:
Fn + Up/Down Arrow key do Page up and Page down respectively in IntelliJ running on OS X.
This is one of the standard ways of doing Page Up/Page Down in Mac apart from Option Up and Down arrow key that you mentioned.
It was annoying for me to find out which keys to get the cursor or caret up or down quickly or may be to the end or beginning of current line till I figured out the following shortcuts that might help:
Fn+Left arrow or Ctrl+A move the cursor to the end of current line.
Fn+Right arrow or Ctrl+E move the cursor to the beginning of current line.
Fn+Up arrow or Fn+Cmd+Left move the cursor to the beginning of the file.
Fn+Down arrow or Fn+Cmd+Right move the cursor to the end of the file.

How do you stop Visual Studio from waiting for the second part of a shortcut-combination?

If I press a shortcut combination (such as Ctrl+M) – VS waits for the second one. What if I want to cancel it? (e.g. if I mistakenly press the wrong letter and am not sure which one.)
It just waits, with the "(Ctrl+M) was pressed. Waiting for a second key of chord..." in the bottom of the screen.
How do I cancel it?
Press Escape. Usually it is not tied as a second keystroke.
I normally press Esc .
I don't know of any keyboard shortcut where Esc is the second key press.
There aren't many visual studio Chords that end with Esc so just hit Esc it'll say The key combination is not a command but it prevents you from performing a valid chord.
Another option is to record a no-op macro and assign it to Ctrl-M, Esc. It will say running macro at the bottom quickly and go away.
You are in Dvorak Keyboard mode in windows. Press Ctrl+Shift to get out of it...

Change how home and end keys work in XCode

When I press the End key I expect it to bring me to the end of the line. Likewise when I press the Home key I expect it to bring me to the beginning of the line. In Xcode though, these navigate to the top and bottom of the page. How can this be changed?
Xcode > Preferences > Key Bindings > Text Key Bindings
Then find these two:
Move to beginning of line
Move to end of line
Assign Home and End to these respectively.
If you're doing this, don't forget to update Move to Beginning/End of Line Extending Selection, too and assign ⇧ ShiftHome and ⇧ ShiftEnd, respectively. This will continue the desired behaviour when you have ⇧ Shift pressed.
You will also have to remove the conflicts that appear.
FYI: ⌘ Cmd+→ and ⌘ Cmd+← are the way things are normally done on a Mac. If you are coming from Windows I would try to adjust to this. If you want to jump between words, you can use Alt+→, Alt+←.
Go to Xcode -> Preferences... -> Key Bindings, tab Text Key Bindings, and change them to whatever you want.
If you're after 'smart home', where pressing the Home key takes you to the start of the text on that line, and a second-press takes you to the start of the line... then you'll be wanting this:
https://github.com/insanehunter/XCode4_beginning_of_line

Resources