Shorten code automatically in Xcode - 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.

Related

How to set keybinding to move (rearrange) tabs in Atom?

I'm trying to setup keybinding for physically moving my current tab, either right or left of other tabs (rather than click and drag to rearrange them).
I know user defined keybindings are added to ~/.atom/keymap.cson, I'm just having trouble determining the command as I don't see it present in the default keybindings.
I found that Atom has a native keybinding set for this under as:
ctrl + shift + ←: pane:move-item-left
ctrl + shift + →: pane:move-item-left
The native bindings weren't showing up in Settings > Keybindings. Here they are:
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-]': 'window:move-active-item-to-pane-on-right'
'ctrl-alt-[': 'window:move-active-item-to-pane-on-left'
You can take a look at Tab Move Key package. It is simple, you can use alt page up and alt + page down for moving tabs around.
command + [ = to move the block left by 1 tab
command + ] = to move the block right by 1 tab

How to make a multiline cursor without using a mouse in Sublime text 3?

The only way to make a multiline cursor in Sublime text 3 is Ctrl+Shift+RC+Drag. Is there any way to do this without using a mouse?
Yes, there is. Using Shift↓ or Shift↑, select the lines you want multiple cursors on. Next, hit CtrlShiftL (CommandShiftL on macOS) to split the selection into lines. Finally, hitting ← will put the cursors at the beginning of the lines, while → will put them at the end.
Edit
There is also another, quicker way (thanks to minitech) - CtrlAlt↑/↓ will create multiple cursors without having to do selections first, and you can place the cursors anywhere in the line you wish. However, on Windows these key combos may be mapped to changing the screen orientation. To change this, hit CtrlAltF12 to open the Intel control panel, click Options, and either remap the screen orientation hotkeys, or click Off on the left side to disable all of them.
You can use Middle mouse button for this as well.
Click & Hold Middle mouse button and drag up and down
Standard key bindings not work for me(Ubuntu 16.4 and Win 10), but after redefining works good! To redefine default key bindings use (Preferences->Key Bindings)
{ "keys": ["alt+shift+down"], "command": "select_lines", "args":{"forward": true} } will add cursor below, { "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} } will add cursor above.
MAC: ctrl ( ^ ) + Shift + up / down arrow
ctrlShiftup arrow
ctrlShiftdown arrow
What works for me on a window 10 Surface Pro is
Ctrl + Alt + up/down
Because Ctrl + Alt + up/down already works for me, there is no need to do another key binding. I have it set up the same way for VS Code as well: Ctrl + Alt + up/down.
Or you can also map it as Yaroslav says (which I voted up), which works as well.
In Ubuntu, the accepted answer works. Also, you can do:
Shift + Alt + Key up/down
It was much simpler for me than any other answers above: Just hold ctrl and click on your mouse placing it where you want to have the second or third cursor.

Shortcut for moving tabs in Mac Terminal application?

I am looking for a shortcut to move the current tab left and right through the tab list. Note that I don't want to switch to the left or right tab with the Cmd+{, Cmd+} shortcuts, but to move the tab.
try iterm2, http://iterm2.com/#/section/home
command + left or right arrow to switch tabs
command + shift + left or right to move tabs
According to Terminal -> Preference -> General,
Command + Ordinal can be used to switch tabs, (Ordinal between 1 to 9)
e.g.: Command + 1: switch to the first tab (left-most tab).
you can add a shortcut to have command+left/right arrow go to previous/next tab:
No, it is not possible to move tabs using keyboard on Terminal app.
I would need to drag them by cursor or try iTerm2 instead.
I don't think you can, and it doesn't appear on any shortcut list i have seen for any browser or application :/
however there seems to be a plugin of sorts for Chrome which does this:
plugin link that might work.

Visual Studio keyboard shortcut to scroll method overloads tooltips?

Does anyone know what the keyboard shortcut to scroll a method's overloads that appears in the tooltip is? I presently have to resort to using the mouse to click the ^ and v labels in the tooltip, which isn't particularly effective.
Thanks!
A little late but maybe somebody else needs it too:
Place the cursor after the first bracket
Press Ctrl + Shift + Space
What's the command to bring up the tooltip? I know the shortcut in Eclipse (Ctrl + Space) but that's Eclipse...
In VS the tooltip shows when you type the first bracket but if I would like to see the different method overloads for a method that's been implemented already, how would I do that?
Press Ctrl + Shift + Space to see the list of overloads and arguments.
See the Visual C# 2008 Keybinding Reference Poster for more keyboard shortcuts.
The arrow keys work for me...
Sometimes I have to hit escape to get rid of the intellisence popup before using the arrow keys to scroll through the overload list.
What's the command to bring up the tooltip? I know the shortcut in Eclipse (ctrl+space) but that's Eclipse...
In VS the tooltip shows when you type the first bracket but if I would like to see the different method overloads for a method that's been implemented aldready, how would I do that?
There's got to be an easier way than this:
place the cursor just after the first bracket
erase it
re-type it (tada!)
navigate the methods using up and down arrows
when you're done, press ctrl+z to undo changes.
1. To Show Overloading Suggestions
Place the cursor after the first bracket and press CTRL + SHIFT + SPACE to bring it back.
Also, Erasing the opening bracket and writing it back can do the trick too.
2. To Scroll through Overloading Suggestions/Options
if your IntelliSense options are showing then press ESC which will hide it. Now, it's time to use the Up/Down arrow keys to see the charm.
if your IntelliSense is disabled, the Up/Down arrow keys will work directly.
Ctrl + Shift + Space in the "()" method brackets brings up the method overload context menu. The UP and DOWN arrows are used to navigate through.
The Visual Studio Keybindings definition is : Displays the name, number, and
type of parameters required for the specified method.
P.S. Jasper's link to Visual C# 2008 Keybinding Reference Poster is useful, check it out.
Arrow keys are the short cut keys i suppose as they work for me.
You can type a comma after the last parameter of the function. That will bring up the intelisense menu

"Right Click" keyboard short cut for Visual Studio?

I'm trying to force myself to use as little mouse as possible and I can't find the answer to this simple short-cut anywhere! Here the the steps:
Open up Visual Studio. Open any C# file (or any code file I believe)
Point your mouse anywhere on the
window/file.
Right Click
Is there a shortcut key for this so I don't have to move my hand to the mouse?
Taken from lytebyte, you've got two options:
Shift + F10
That nutty key on the bottom-right of a modern Windows keyboard, the Menu key
Depends on where/why you're right-clicking.
The context-menu key is on the right of the keyboard nowadays, usually between the Windows key and the Control key on the right of your spacebar. That will open the context menu wherever the current focus is (usually in the text editor).
If you're using the right mouse button just to open the refactoring tools, you can use Ctrl + . (control period) to pop open the "smart tag" on any identifier. That'll get you the "generate method stub" menu item and the like.
To open a new file without keyboard you can use
CTRL + SHIFT + N (Using Resharper)
To show up the right click menu for any part of your code. Point to the part that you want and use
SHIFT + F10
Normally, I like using
CTRL + SHIFT + G (Resharper again)
for getting the Navigation menu (Usage, Base, Implementation, etc)
Even better if you want to go to any Method/class/intenal/or a field, use CTRL + SHIFT + ALT + N (Again using Resharper), this will bring you a list of all that match your criteria to choose from.
Does your keyboard have the extra 'Windows' keys, ie. the Windows logo (Start key) and the one on the right-hand side of the spacebar that looks like a menu? Cause that button on the right-hand side is the 'Context menu key'.
See the key between the right-hand side 'Windows' key and the Ctrl key?
Windows Keyboard layout
If your keyboard is less than 10 years old you should have these keys, unless you have an IBM laptop or a Mac.!
Assuming you just want a key you can press to right click, most\many keyboards have a key between alt and ctrl that right clicks.

Resources