When you use quickopen, it will show you the file you are currently editing as the first entry. In for example IntelliJ it will show you the file you previously opened, which makes it possible to quickly swap between 2 files using quickopen + enter.
Is there any option to have this in vsc either? I dont really get, why you would have the current file as the first entry, its rather unlikely you are going to open the same file again or am I missing a reason for it?
Option 1
Mac: hold down ⌘ and press P twice.
Windows: hold down CTRL and press P twice.
Option 2
Hold down CTRL and press Tab.
Option 3
Go to Code > Preference > Keyboard Shortcuts
Type Open Next Recently Used Editor in Group into the search bar.
When that command shows up, click the edit icon and add your own custom shortcut.
Now see VS Code: How to configure Go to File command to auto-select the previous file (like Sublime)
A command was added to vscode: workbench.action.quickOpenPreviousEditor in October 2017 which can be used in a keybinding like so:
{
"key": "ctrl+p",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+p", // or cmd
"command": "workbench.action.quickOpenPreviousEditor"
}
Related
Example:
Author author = new Author("Jack", "Daniels");
In Exlipce when filled "Jack" and pressed "enter" - it automatically went to second parameter and let me fill second one. In Intellij I always have to click with mouse, or use arrow keys.
Is there a shortcut in Intellij to make it quicker? I can't find one myself.
Since IntelliJ 2018.2
You can now jump outside the closing bracket or quote with Tab.
(from: https://blog.jetbrains.com/idea/2018/07/intellij-idea-2018-2-macbook-touch-bar-java-11-breakpoint-intentions-spring-boot-version-control-and-more/)
Basically it means if you have:
Author author = new Author("Jack<cursor>");
And you press Tab, the cursor is placed like this:
Author author = new Author("Jack"<cursor>);
Note: it doesn't matter where the cursor is initially, as long as you are somewhere inside the quotes when you press Tab the cursor is moved outside and placed behind it. If you want to enter the next parameter you have to manually type the comma and String.
The option can be found under: Settings -> Editor -> General -> Smart Keys and is called Jump outside closing bracket/quote with Tab
There are some other useful options there as well like insert pair quote and insert pair brackets.
If you want to go more advanced you can have a look into Live Templates.
I often need to get quickly to the very beginning or very end of a file in the IntelliJ editor. Is there a shortcut key or button that allows me to do this quickly?
I am running on Windows, if that matters.
Beginning of File: Fn + ⌘ + ←
End of File: Fn + ⌘ + →
Note: This answer was posted prior to windows specificity. Leaving it here to include MacOS alternative.
On Windows, you can use Ctrl+Home and Ctrl+End to go to the beginning and end of a file respectively.
The action is called Move caret to Page Top/Bottom, default shortcuts would depend on the OS/Keymap and can be checked here:
On Windows these are Ctrl+Page Up and Ctrl+Page Down.
To find what keyboard strokes are already defined for this, go to Preferences->Keymap and search for text start for jumping to the beginning of the file and text end for jumping to the end of the file. You'll get something that looks like this:
The right column tells you what keystrokes have been mapped to these functions. Feel free to change them to something that you find more intuitive by double clicking on the right column and following the instructions on the pop-ups.
Under preferences -> Keymap, a shortcut for Scroll to Bottomand Scroll to Top can be set.
By default, they are not assigned.
By default in windows the shortcut is
ctrl+end
You can customize the shortcut. To use only end button as shortcut go to Settings -> Keymap -> Editor action -> move caret to text end
Right click on move caret to text end and update shortcut to end
On a Mac, these following keys:
to start of the file:
option + command + [
to end of the file:
option + command + ]
After spending minutes to search on the web, i don't find the answer for just using cmd + up or down. If you are the same, as a quick workaround, you can cmd + a to select all text and press up or down to move it.
Since the beginning of the week I have to work with Debian, and one of the pbm I find with Sublime Text is that the vertical selection I used to use with Ctrl+left click is catched by the OS (it selects the current window to move).
I tried to edit the key-binding file of Sublime Text, but I could not find the line corresponding to vertical selection.
Do you know where it is? How can I change the default shortcut for vertical selection?
I think this is exactly what you are searching for:
enter link description here
~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-mousemap
[
// Map column select to 4th mouse button.
{
"button": "button4",
"press_command": "drag_select",
"press_args": {"by": "columns"}
}
]
In FireFox, I'm constantly using the Ctrl + 1-9 shortcut to switch tabs. Basically Ctrl + 1 will take me to the first tab, Ctrl + 2 will take me to the second one and so on.
Is there an equivalent for this shortcut in IntelliJ IDEA?
UPDATE:
You can now assign keyboard shortcuts to navigate to the specific tab number:
Original obsolete response:
There is no such feature in IDEA, however you can use Alt + Arrows and Ctrl + E (Recent Files) to navigate between tabs.
Other handy actions from the Go To menu:
Back / Forward (Ctrl + Alt + ←/→)
Last Edit Location (Ctrl + Shift + Backspace)
Another option is to use the GoToTabs third-party plug-in:
The plugin adds menu actions allowing you to go to a specific tab. You
can of course assign keyboard shortcuts the individual actions and for
example achieve the behavior known from other editors/IDEs where you
can switch between tabs with alt+num.
The IDE itself still doesn't support it but I've created a plugin (GoToTabs) that will add "Go to tab #" actions you can assign keyboard shortcuts to (e.g. ctrl+1).
you also can use ctrl + tab to active switcher
after ctrl + tab and keep holding ctrl for other operations
ctrl + number is for bookmarks feature.
Since this is one of the first hits when Googling this, note that as of IntelliJ IDEA 2018.3 EAP this is now possible. From the feature request tracker:
In upcoming 2018.3 EAPs you're welcome to assign shortcuts you need for new actions in the group 'Other', see a screenshot. With these actions you can select tab1..tab9 and also the last tab.
To accomplish this:
Go to Keymap in Preferences
Search for "select tab"
Individually assign Command+<number> to each of the tab numbers mappings
You can use this short cut on mac
Shift + Command + { or }
Not sure what you asking is possible but Navigate as below in intellij idea (13) to switch tabs in one level,
File
└────Settings
└─────────Keymap
└────── Editor Tabs
Where yo can map for actions "Select Next Tab" and "Select Previous Tab", under "Editor tabs" in keymaps. Following is an example for emacs keymap.
cmd+shift+[ - go to previous tab
cmd+shift+] - go to next tab
Actually, there is an option, pressing Alt + Tab a switcher will pop up.
Like this:
[
If you are using IntelliJ's IdeaVim plugin, the vim style shortcut works as well:
gt, go to next tab
gT, go to the previous tab
1gt, go to the first tab
2gt, go to the second tab
3gt, ....
If a tab has a number with an underline like this example, you can use Alt + 9 to switch to it. But not all tabs have a underlined number.
MacOS:
Next tab: ⇧ + ⌘ + ]
Previous tab: ⇧ + ⌘ + [
if you use ideavim, you can use num+gt to go to the specific tab. for example, 2gt lead you to the second tab.
Keymap -> Other -> Tabs.
Then setup what you want
I always run into this situation: cursor is on line 5 and I want to select everything down to line 16. I have to resort to shift-arrow, arrow, arrow, or use the mouse.
NetBeans has "go to line" (Control-G) but you can't hold down shift while doing that, so no good for selecting. There's also "bookmarks," but same problem.
Anyone know of a cool trick that solves this problem?
I'm open to alternate tool suggestions for OS X.
You can use Shift-PgDn or Shift-PgUp to select the next "page" of information.
The only thing that comes to mind is to create an editor macro.
Eg:
Tools > Options > Editor > Macros
Click "New" Enter a name:
Enter a name for the macro: select-5-down
For the macro code enter:
selection-down
selection-down
selection-down
selection-down
selection-down
Click "Set Shortcut" and assign a key binding. I used Alt-M.
Now each click of Alt-M extends the selection by 5 more lines.