Netbeans has a nice set of keyboard shortcuts, but unfortunately, I can't seem to get all of them to work. Specifically, there's a keyboard shortcut for converting selected text to lowercase: Ctrl+U L. However, no matter how many times I try this (or variations on it), nothing happens I just get a 'ding' sound (it used to be that nothing happened). I check the Keymap option on Netbeans, and it shows that this is still the shortcut mapped to Ctrl+U L:
What am I doing wrong? How can I use this keyboard shortcut?
Note that Ctrl+; or Ctrl+Shift+; works just fine, among many other shortcuts.
To activate this shortcut you have to hit Ctrl+U then release Ctrl and then hit L.
It's like saying Ortomala Lokni
to uppercase a selection, press Ctrl + U then U without Ctrl
Let me add also:
to lowercase a selection, press Ctrl + U then L without Ctrl
to reverse case in the selection, press Ctrl + U then S wthout Ctrl
if you are using mac use command instead of control
Command + U + L to lowercase
Command + U + U to uppercase
Related
I had to reinstall VS Code recently, I rember using Ctrl+W to kind of smart select everything between quotes but now what that command does is move me to another file/tab instead? Is there a way to do this in VS Code, Ctrl+W was just so easy to me, really helped with deleting or copying strings of text.
As #Mark says in the comment, you can use the "Expand Selection" shortcut, this will first select everything between the quotes.
The shortcut on Windows by default:
Shift + Alt + →
And OS X:
Ctrl + Shift + ⌘ + →
Try using the Quick and Simple Text Selection extension.
On a Mac, the extension's default shortcut is ⌘ k, "
Press ⌘ and k
let go of of ⌘ and k
press "
This will select everything in double quotes.
If you want to select everything in single quotes use ⌘ k, "
It also works for brackets
⌘ k, [
⌘ k, {
⌘ k, (
On Windows, replace ⌘ with Ctrl
https://github.com/dbankier/vscode-quick-select
Shift + Alt + (Right Arrow) for the word next to cursor
Shift + Alt + (Right Arrow)x2 for entire sentence between quotes
After re-reading your question, I noticed that you want to press Ctrl + W to press multiple times to expand your selection
To see and set the shortcut, you can
Press Ctrl/Cmd + Shift + P
Go to Keyboard Shortcuts by typing Preferences: Open Keyboard Shortcuts
Search for the command: editor.action.smartSelect.expand
Double click the keybinding to set a new keybinding
Summary of answers
Most use cases: use #colinD's answer (Alt + Shift ← or →) which expands the selection word by word
Press Ctrl + Shift + → multiple times to expand the selection's scope
it might be different on Windows
If you want to select all of the text in quotes and there's a lot of spaces and your cursor is in the middle of the quotes
Use the Quick and Simple Text Selection extension
The best / simplest way to do it I've found on Mac is to click the text anywhere in the quote marks, then hold down Control + Shift and tap the right arrow twice.
How to select the current word, that is where the caret is at.
Note: I am looking for the shortcut for Visual Studio Code(VS Code), the text editor, and not Visual Studio IDE.
On Mac OS: Cmd+D
On Windows & Linux: Ctrl+D
Above solved the purpose for me.
But ⌘D is defined as "editor.action.addSelectionToNextFindMatch", so if you press it more than once, it will try to search and select same word in the file which then can be used to do "multi word editing".
You are looking for Shrink/Expand Selection.
Trigger it with Shift+ Alt+Left and Shift + Alt+Right
Update:
This is now called Smart select API.
This feature uses semantic knowledge to intelligently expand selections for expressions, types, statements, classes, and imports.
It is Ctrl + D that works for me in latest Visual Studio Code on Windows.
Go to File -> Preferences -> Keyboard shortcuts, you will find this:
If you want to ctrl+w to behave the same as in Idea just go keyboard settings
Search for Expand selection. Set new shortcut cmd+w or ctrl+w depending on your OS.
Also re-bind other commands that use ctrl+w to use another shortcut that you want, for example cmd+f4
You can edit keybindings.json to avoid using UI.
Shift + Alt+Right Arrow if the word is in camelCase then you will have to click Right Arrow again to select the whole camelCase. Every time you press Right Arrow again while still holding Shift + Alt down you will select a further part of the code.
so:
first the word.
then if it's part of a camelCase then the camelCase.
then if it is in a string the whole string.
... (many other posibilities)
the whole line.
everything inside the parentheses code block
the whole file
at any given time you can go back to the last selection by clicking Left Arrow instead of Right Arrow
I don't know about CTRL + w in the old Visual Studio Code but in the JetBrains IDE's this is the equivalent to CTRL + w by holding down CTRL and clicking w to select more and holding down CTRL + Shift and clicking w to unselect.
Another possibility which helps to avoid selecting only one word in camelCase is CTRL + d this will just select the whole camelCase. This will however have the side-effect of also changing the current "find" criteria.
thanks Chandan Nayak for this extra shortcut.
An unpopular opinion: you can now have Resharper keybindings, if you come from Jetbrain's camp.
The Ctrl+W expansion grow and shrinks is different from expansion selection.
On "File/Preferences/Keyboard Shortcuts" I deleted the shortcut "Ctrl + W" to close the current tab action, because for this "Ctrl+F4" works for me.
Update (14 days later): Yesterday I installed VSCode 1.34.0 - I think since then the functionality is "Ctrl + D". I was very suprised.
For any editor, you can use the below shortcuts. These shortcuts work for every text area also.
Ctrl + Shift + LeftArrow/RightArrow - this will select text word by word
Shift + UpArrow/DownArrow - this will select text line by line
Ctrl + BackSpace - this will delete text word by word
Additional
in intellijIdea
Ctrl + w - use for the select current word, after giving second Ctrl + W it will select the second word also. Like that you can select the whole line.
Ctrl + d - you can duplicate current line.
In Eclipse, I'd like to have a keyboard shortcut that allows me to navigate up or down by some number of lines (in Emacs I can jump by # lines by pressing Ctrl + Arrow). Does such a shortcut exist? Currently, I can only move by one line at a time using the arrow keys. The closest shortcut I'm aware of is Ctrl + Shift + Arrow which jumps to the next function definition (at least in PyDev).
with the shortcut Ctrl + L you can enter the line number you want to navigate
You can define your own shortcuts under window > preferences > general > keys.
In addition, you can switch to an Emacs scheme in that same window.
However, as far as I know you won't get what you are looking for just by switching to the Emacs schema. For the ability to jump lines like C-u 10 C-p you will need the Emacs+ plugin found here.
Also note you can jump to lines by using Ctrl + L.
In vim, pressing * in command mode performs an automatic search of the word under the cursor. How can I obtain the same in Eclipse?
A combination of two keystrokes:
First, hit Ctrl + Shift + Right Arrow to invoke "Select Enclosing Element". This will select the word under your cursor.
Use Ctrl + K (Cmd + K on OS X) to "find next".
It appears it was not possible in 2004, and it's still not possible, apparently. I'm speechless...
I also need this functionality and created a small plug-in which adds commands for doing this. You can download it and find more details here: http://eclipselabs.org/p/eclipse-tweaks/
Windows 10, tested on Eclipse 2020-03:
Two Steps:
1. Alt + Shift + Up Arrow, to select the word under the cursor
2. Ctrl + K to find the selected word forward
(Ctrl + Shift + K to find the selected word backward)
NOTE:
If you are inside an XML tag, Alt + Shift + Up Arrow will select from the beginning of the tag to the end tag, including all enclosing elements. Try it!
BONUS:
Ctrl + Shift + Down/Up arrows to navigate methods, as sometimes the selected word is a method you want to go to.
Better still,
Ctrl + O - Go to a specific method, by searching (Just enter the first few letters of the method, and Enter)
Cheers
Press Ctrl + k on a Windows machine. On a Mac, Cmd + k should work (seen here).
Not exactly the same, but maybe helpfull if you work with java. In a .java file you can press
CTRL + SHIFT + u
to find occurences in the same source file.
You can also use Shift + Ctrl + K to search next backwards.
Is there a list of the default Eclipse keyboard shortcuts? I'm generally looking for language agnostic things like starting the debugger or deleting an entire line in the source editor.
Rather than a full list of shortcut (JGlass mentions for Eclipse 4.6 this pdf), I prefer using only a few shortcuts:
CTRL+Shift+L: "Show Key Assist", List of shortcuts (depending on the context)
CTRL+3: Quick Access
Source: "Good features of Eclipse 3.6 (Eclipse Helios) JDT, 2011, from Sony Thomas"
Those two covers almost everything.
You can add two others:
CTRL+1: Quick Fix
ALT+Shift+F1: Plug-in Spy
Note that Eclipse 2019-09 now shows key bindings when command is invoked.
For presentations, screen casts and learning purposes, it is very helpful to show the corresponding key binding when a command is invoked.
When the command is invoked (via a key binding or menu interaction) the key binding, the command's name and description are shown on the screen.
Key binding of triggered command shown on screen
You can activate this in the Preferences dialog via the Show key binding when command is invoked check box on the General > Keys preference page.
To toggle this setting quickly the command 'Toggle Whether to Show Key Binding' can be used (e.g. via the quick access).
As VonC said you can get alist of short cuts with the following command.
Ctrl + Shift + L "Show Key Assist", List of shortcuts (depending on the context)
SHORTCUTS FOR DEVELOPMENT
But here are some which you will use often during your development.
Ctrl + Shift + P Switch between openning and closing braces.
Ctrl + Shift + R Open any file quickly without browsing for it in the Package Explorer. This shortcut opens a dialog box that accepts the name of the file you’re looking for.
Ctrl + Shift + T Open a type (e.g.: a class, an interface) without clicking through interminable list of packages. If what you want is a Java type, this shortcut will do the trick.
Ctrl + O Go directly to a member (method, variable) of a class file, especially when there are a lot of methods.
Ctrl + Shift + F Format code.
Ctrl + Shift + / Comment out XML or JSP code.
Ctrl + L Go to line number N in the source file.
Ctrl + E Show a list of open editors.
Ctrl + F6 Move between open editors.
Ctrl + 1 Quick Fix.
Ctrl + 3 Quick Access.
Ctrl + Q Go to the last edit location.
Ctrl + T Go to a supertype/subtype.
Ctrl + I Indent selected code block.
Ctrl + + Move to one problem (i.e.: error, warning) to the next (or previous) in a file.
F3 Go to a type declaration.Alternatively, you can hold Ctrl down and click (ie: Ctrl + Click) the hyperlinked variable.
SHORTCUTS FOR VARIABLE GENERATION
Ctrl + 2 + L Generate return value type and variable assignment
Alt + Shift + L Generate return value type and variable assignment. but here you can make selections.
SHORTCUTS FOR DEBUGGING
F8 Resume
CTRL + F8 Resume.
F5 Step Into
F6 Step Over
F7 Step Return
CTRL R Run to Line.
F11 R Debug
CTRL + SHIFT + B Toogle Break Point
You can find further shortcuts under :
Help → Help Contents → Java Development User Guide → Reference → Menus and Actions
Previous answer not quite correct as in Eclipse you can redefine keyword shortcuts (as I often do).
You can always access current list of defined shortcuts by pressing Ctrl + Shift + L in Eclipse (on Windows at least).
The full list of defaults in Eclipse 4.6 and earlier versions can be obtained from this GIT Hub page:
https://github.com/pellaton/eclipse-cheatsheet specifically https://github.com/pellaton/eclipse-cheatsheet/raw/master/eclipse4.6/eclipse-shortcuts-4.6.0.pdf