This is from an Android Development Tutorial. How can I select this portion of texts and change them at the same time?
Open up the context menu with the mouse/touchpad right button click and choose Column Selection Mode (Mac's screenshot):
Even more convenient, as #rajan ks mentioned, for Mac hold option and select.
In Windows to add and remove carets do Shift + Alt + Click
It is called Multi Cursor and full details can be found on the official doc here
in Mac its Shift + Command + 8
Related
I find myself with many files open in the editor (in separated tabs), and sometimes I want to find specific file in the project explorer.
Does there is any shortcut to reveal the file in the project window ?
EDIT to do the question more clear I add a picture:
There isn't a single key combo that can do this, as far as I know, but you can go with
On Windows
Alt + F1 followed by either 1 or enter
On Linux (using Gnome)
Alt + Shift + 1 followed by either 1 or enter
On Mac OS
Option + F1 followed by either 1 or enter
Android Studio is based on intelliJ, which has a function to open the current file or symbol in various views. The default key combo (in Windows) is ALT + F1.
This offers to open the current file or symbol in a bunch of different views, but the first option (with shortcut key 1) is the project view.
It's the same as choosing the Navigate > Select in... menu option, followed by option 1.
Note that you can customise the key mappings, or select other defaults instead of the default intelliJ configuration, so this might not be the case with your set up.
You can check the key mapping in settings > Key map and search for Select In... or, more simply, click the navigate menu and look at the Select In... option to see the shortcut key displayed in the drop down.
You can go to Navigate -> Select In, which has default shortcut Option+F1 on macOS.
For Xcode, the shortcut is Cmd+Shift+J. If you want the same, follow these steps
Go to Android Studio -> Preferences -> Keymap
Search for Select In in Navigate
Right click and select Add Keyboard Shortcut
Press Cmd+Shift+J
In my Visual studio 2012 editor I erroneously pressed some obscure key combination (Ctrl-Alt-something or so) and now spaces are displayed as little dots and tabs are displayed as arrows.
I'd like to get rid of this, but I haven't found the corresponding option in TOOLS-Options-Text editor.
Go to Edit -> Advanced -> View White Space to rectify this. Alternatively, you may use the key combination Ctrl + R, Ctrl + W.
A quick tip:
An efficient way to find Visual Studio options and commands is to use the "Quick Launch" feature (Ctrl+Q - or just type in the box at the top right of the Visual Studio IDE) - in this case typing "white space" or just "space" in that box shows the command you need and lets you take the action from there too.
What is the shortcut to close the opened tab in android studio?
I'm new to the android studio. I tried with CTRL+W. It's not working. I searched for a while. But I haven't get it. Any one please provide me the shortcut to close the opened tab.
You can try pressing CTRL+F4 in order to close opened tabs in Android Studio
As mentioned above, type CTRL + ALT + S to get into settings and in the keymap dialog search for Close, but the thing you want to reassign is
Close Active Editor
For Mac it is not set by default. Here is how I did it.
Android Studio 4.1 > Preferences > Keymap search for Close Active Editor right click > Add Keyboard Shortcut. Then assign anything you want. Alt+W is a good one.
If you right click on a tab header, the context menu shows you the current key binding next to the word Close (by default Ctrl+F4).
Follow the steps mentioned in other comments (type CTRL + ALT + S to get into settings and in the keymap dialog search for Close) and what you actually need to change is [editor tabs] / [close]
(android studio 3.6.1)
On a Mac, it's command + F4.
If you're like me, you may have to do command + fn + F4
Is there a way/shortcut/built-in feature that can align code for operands, like '=' signs?
For example, there is a XAlign for Xcode (https://github.com/qfish/XAlign), allowing the user to select code that needs to be aligned and use a shortcut to align it automatically.
There is a Fields Group feature in Android Studio which can "Align in columns", but it does not work for code that is already written.
Indent code in Android Studio:
Windows
Ctrl + Alt + L
Mac:
Option + Command + L
The alignment for variable declarations works for only those that are outside of functions. The alignment feature in menu Preference → Code Style → Wrapping and Braces → Fields Groups → "Align in Columns" does not work for those inside the brackets/braces.
Here is an issue ticket on the JetBrains website: https://youtrack.jetbrains.com/issue/IDEA-56947#
This feature is available, but not in the stable release yet. It is available from build: 140.1761
At the time of writing this answer my current build is "135.1653844, built on December 18, 2014" on Stable Release.
In Eclipse which comes with Android Studio Bundle, the shortcut key is as follows to initiate Auto Formatter:
Ctrl + alt + L
If you want to change this combination, go to menu Preferences → Keymap and set to custom.
Windows:
Ctrl+Alt+L
Linux:
Ctrl+Shift+Alt+L
macOS:
⌥ option+⌘ command+L
For Windows and Linux in Android Studio:
Ctrl + Alt + L
For Mac:
Option + Command + L
Ubuntu Linux: Ctrl-alt-L (suggested by other responses) is captured by the window manager and locks the screen. So you need to change it: file->settings->keymap->main menu->code->Reformat Code. I use a double tab since I don't want the tab to shift a selection right.
This formats the code as you've specified in your preferences. To handle your specific request (aligning equals statements) go to: (file->settings->editor->code style->(choose language)->Wrapping and braces->Group declarations->align variables in columns
These styles are language specific so this particular option might not exist in the language you chose, or may be named differently.
In Visual Studio 2012 the find and replace window has Docking alignment to the top right side, how to release it?
The "quick find" window isn't docked in the usual sense. Press Esc to dismiss it and also make the yellow-orange search result highlighting go away.
Alternatively, click the X in the top right of the mini window.
Edit.Find = docked Find window
Edit.Replace = docked Replace window
Edit.FindinFiles = undocked Find window
Edit.ReplaceinFiles = undocked Replace window
so for undocked windows you can press Ctrl + Shift + F or Ctrl + Shift + H
or alternatively change shortcuts in Options > Environment > Keyboard to reach desired windows easier.
This is not possible unfortunately, which really drives me nuts when trying to find something in a minified file (single line) since the find window commonly blocks the found result.
Last post I could find about it:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/3636907-let-me-undock-the-find-and-replace
The best solution I can find is copy and past file into notepad and find there (for my needs).
In Visual Studio 2012 all docked windows can be released as follows;
Docked Window's Header right click menu (or click Window Position Icon what located the far right of the header)> Float menu
If the usual things, as already suggested, won't work, here are two other ideas I have found to work with oddities in Visual Studio.
Disable all plugins and try again (had a weird case of VS crashing on Ctrl+S and it was a faulty plugin)
Try a repair on the install, could have some faulty files.