A quick way to select a line in netBeans - netbeans

I am looking for a quick way to select a line in netBeans.
For example for copy and paste. (in vim editor yy yank current line)

Most GUIs, including Netbeans, allow you to select a word by
double-clicking on it and an entire line by triple-clicking on it.
OR
selection-end-line (Shift+End)
selection-down (SHift+Down) for as many lines as you want.

I've been using Netbeans for a few months.
Ctrl + c will copy the entire line without selecting it.
Ctrl + e will delete the line without selecting it.
Ctrl + Shift + down or up arrows will duplicate the line.

I am late comer to this post, but with a solution. In netbeans 8.x, go to Tools -> Options -> Keymap. In that, search for Select Line. You will get an entry there. Under the field Shortcut, you can give your convenient shortcut. There is no shortcut by default

Related

Is it possible to save the search results of Find in Files in Visual Studio Code? [duplicate]

Does Visual Studio Code have any way to copy the results of a search into a new window?
As a bonus, I'd really like to be able to drop the file name and just copy the lines containing the text of my search results to a new window.
For example, I'd like to to be able to copy the results of the search below to a new editor window. I don't mind if I need to install an extension to do it.
The following works for a single file:
CTRL + F
Type your search string
CTRL + SHIFT + L to select all occurrences found (max. 999)
ESC (or close search dialog with top-right X)
CTRL + I to select whole lines
CTRL + C
Open new file
CTRL + V
VSCode 1.23 added the ability to copy your search results, see release notes: copy search results.
The search results tree context menu includes three new options: Copy,
Copy Path, and Copy All. This was a highly 👍'd request which will
make it easier to share or export your search results.
The results are not very pretty or clickable when copied/pasted, so be forewarned. There is an issue tracking the "copy search results" format (see https://github.com/microsoft/vscode/issues/68877) and it is on the 2019 Roadmap (see https://github.com/Microsoft/vscode/wiki/Roadmap#workbench) so hopefully it will be improved.
Update as of v1.41 you can move your search results to a new editor and easily select all and copy there. After searching (which can work across multiple files); click the "Open in Editor" link, as shown in this demo:
Another advantage of the search editor is that you can get "context" around your search result. So you can get some number of lines before and after the whole line with your search term in it. And, of course, line numbers will be copied too.
And you can just save Ctrl+S the search results editor itself! And cut lines from there. Or add notes. With syntax highlighting. It will ask where you want to save it, defaulting to the folder where you initiated the search. It will be named like yourFolder\yourSearchTerm.code-search.
For more info on the new search editor, see https://code.visualstudio.com/updates/v1_43#_search-editors and
Select all occurrences of current selection
CTRL+SHIFT+L
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
As of 12/2020 CTRL + SHIFT + L doesn't work (for me)
After search results are rendered, right-click onto the text file and select "Change all occurrences"(or CTRL+F2). This will automatically select the the matched text items. Then you can simply copy it.
This will work for a single file, assuming each line you care about begins with the search text:
1. Highlight your search string
2. CTRL + SHIFT + L to select all occurrences found
3. SHIFT + ↓ to select all of those lines
4. CTRL + C
5. Open a new file
6. CTRL + V
There's now an "Open in editor" button under search inputs
Wrong. Per the document the correct format is to use Right Alt + Enter, the use Ctrl + C and then open a new tab and paste your results with Ctrl + V

Visual studio code - how to copy search results?

Does Visual Studio Code have any way to copy the results of a search into a new window?
As a bonus, I'd really like to be able to drop the file name and just copy the lines containing the text of my search results to a new window.
For example, I'd like to to be able to copy the results of the search below to a new editor window. I don't mind if I need to install an extension to do it.
The following works for a single file:
CTRL + F
Type your search string
CTRL + SHIFT + L to select all occurrences found (max. 999)
ESC (or close search dialog with top-right X)
CTRL + I to select whole lines
CTRL + C
Open new file
CTRL + V
VSCode 1.23 added the ability to copy your search results, see release notes: copy search results.
The search results tree context menu includes three new options: Copy,
Copy Path, and Copy All. This was a highly 👍'd request which will
make it easier to share or export your search results.
The results are not very pretty or clickable when copied/pasted, so be forewarned. There is an issue tracking the "copy search results" format (see https://github.com/microsoft/vscode/issues/68877) and it is on the 2019 Roadmap (see https://github.com/Microsoft/vscode/wiki/Roadmap#workbench) so hopefully it will be improved.
Update as of v1.41 you can move your search results to a new editor and easily select all and copy there. After searching (which can work across multiple files); click the "Open in Editor" link, as shown in this demo:
Another advantage of the search editor is that you can get "context" around your search result. So you can get some number of lines before and after the whole line with your search term in it. And, of course, line numbers will be copied too.
And you can just save Ctrl+S the search results editor itself! And cut lines from there. Or add notes. With syntax highlighting. It will ask where you want to save it, defaulting to the folder where you initiated the search. It will be named like yourFolder\yourSearchTerm.code-search.
For more info on the new search editor, see https://code.visualstudio.com/updates/v1_43#_search-editors and
Select all occurrences of current selection
CTRL+SHIFT+L
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
As of 12/2020 CTRL + SHIFT + L doesn't work (for me)
After search results are rendered, right-click onto the text file and select "Change all occurrences"(or CTRL+F2). This will automatically select the the matched text items. Then you can simply copy it.
This will work for a single file, assuming each line you care about begins with the search text:
1. Highlight your search string
2. CTRL + SHIFT + L to select all occurrences found
3. SHIFT + ↓ to select all of those lines
4. CTRL + C
5. Open a new file
6. CTRL + V
There's now an "Open in editor" button under search inputs
Wrong. Per the document the correct format is to use Right Alt + Enter, the use Ctrl + C and then open a new tab and paste your results with Ctrl + V

How to select current word in Visual Studio Code (VS Code)?

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.

Eclipse shortcut "go to line + column"

Does anyone know if there is the shortcut "go to line + column" in Eclipse?
Ctrl+L Jump to Line Number. To hide/show line numbers, press ctrl+F10 and select 'Show Line Numbers'
There is no way to go to a particular column according to my knowledge.
On OSX, the shortcut is ⌘ + L
It you want more short-cuts, refer http://www.shortcutworld.com/en/win/Eclipse.html
As you are aware CTRL+L goes to a particular Line, there is also CTRL+Q to go to the last edit location. The is no key combination in Eclipse to go to a particular Line and Column.
You can use a Keyboard Macro (available as hardware in some keyboards and included as software with some other keyboards). An explanation for Microsoft is here: http://support.microsoft.com/kb/237179 .
A Program like Autohotkey http://www.autohotkey.com/ can also be used.
You can use Ctrl + L to jump to specific line number
You can find a large list of eclipse shortcuts here: http://javatutorial.net/eclipse-shortcuts
You can use 'Command' + L to find line number in eclipse.
You can use CTRL + forward or backward key to jump to the next dot in the same line.
for example, in System.out.println("test"); you can switch between System, out and println by using CTRL + forward and backward key.

A quick way to delete a line in netBeans

I am looking for a quick way to delete a line in netBeans.
For example in vim you can just type dd for Deleting a line.
Does Ctrl-E not work for you? This is the default short-cut in NetBeans on a Windows machine.
If you click on Help you can get the keyboard shortcuts card, print it out, it's pretty handy and has saved me quite a bit of time hunting for easier ways to do things.
Press Ctrl + x, or Ctrl + e while your cursor on the line to be deleted.
The command will delete the line and place the cursor to the starting of next line.
For Mac command it is command+e.