VS Code search inside the editor without rollover - visual-studio-code

If I search inside the actual editor of VS Code without an match below the current line, VS Code rollover the search from the top of the page.
How can I disable this?

One thing you can do instead of disabling this (which I don't thing this is configurable) is to use ctrl+U. It's soft undo, moves the cursor back to it's previous location. This is particularly useful when you need to move down in a long file to copy a variable or function name and then go back to your original position. So when vscode goes to the top of the page, put the cursor there, and then press ctrl+U to go back to the previous line you where editing.

Related

Enter Key in Find dialog makes new line instead of jumping to the first result

After hitting CTRL+F (or CMD+F) my find-dialog opens in the top right corner with focus on the input.
Usually, after I enter the search term, I hit enter to jump to the first result. Unexpectedly, this creates a new line in the search input.
I tried looking in the settings, but no luck. I remember that it wasn't that way when I first installed VS Code.
How can I solve this, so that it jumps to the first found result?

How to execute snippet instantaneously - vscode

Is there the option to "execute snippets" right away in vscode, meaning without having to press tab? This is really the only thing holding me back from vscode because in vim I can simply configure it, so e.g. if I have a snippet which gets triggered if I type test it automatically replaces test by the snippet content without having to press any extra key like tab. Is this possible in vscode?

How to do forward / back navigation in VSCode but disregard manual cursor (eg: up/down) motion?

In VSCode, is there a way to disregard cursor motion in the code navigation history? That is, when I jump into a definition, I usually move the cursor a bit (eg: up/down) to inspect the surrounding code. When I issue the "navigate back" command, it incorporates the cursor movement into the navigation history stream. That is, navigating back will just move up/down one line. I almost always want to disregard manual cursor movement when navigating code. The JetBrains IntelliJ suite of tools behaves this way. Can VSCode be configured to do the same?
Turned out to be a conflict with VSCode/VIM causing this behavior. VSCode/VIM affects the code navigation history it looks like, injecting cursor movements into the command stream so that VSCode's native "Go Back" traverses the cursor movement stream, which is generally undesirable.
The VIM jump list behaves correctly though so I've switched to using ctrl+o and ctrl+i to navigate back/forward.

How to navigate to the last cursor position in Eclipse if it is in the same file and was not edited?

I had used Eclipse earlier, afterwards I switched to IntelliJ for a while and now back to Eclipse. There is one thing from IntelliJ which I can't find in Eclipse: Navigating to the real last cursor position - even in the same file and even if the cursor was moved between the lines using the arrow keys on the keyboard or the mouse. IntelliJ is able to do it and I found it really useful.
For example:
I move the cursor using the keyboard's down arrow key successively on lines 10, 20, 30.
Now I am on line 30 and when I press Alt+left I would like the cursor to go to the line 20.
After pressing Alt+left again I would like the cursor to go to line 10.
After pressing Alt+right afterwards I would like the cursor to go to the line 20 again.
The following shortcuts are available in Eclipse:
Alt+left - it navigates back to the last cursor position in a different file, not to the last cursor position in the current file even if I already moved my cursor in the same file
Alt+right - it navigates forward to the next cursor position in a different file, not to the next cursor position in the current file even if I already moved my cursor in the same file
Ctrl+Q - moves the cursor to the last edit location
The latest version of Eclipse in which I tested the above-mentioned shortcuts: Eclipse Luna 4.4.0.
I found the following discussion about the same problem (lacking such functionality in Eclipse) which is quite old, but it seems that this functionality has not been implemented in Eclipse since that discussion in eclipse forum.
Does anyone of you know if this functionality will be implemented in Eclipse? Is there a plugin for Eclipse which provides such functionality of navigating back to the last cursor position?
Please note, that due to the reasons described above, I'm not satisfied with the solutions provided as an answer to this SO question 'How to navigate to the last cursor position in Eclipse?' or to the other SO question 'How to go back in Eclipse?'.
Go to Preferences / General / Keys. You'll be able to see or edit the bindings for:
Backward History: default is Alt←
Forward History: default is Alt→
You may also use those shortcuts (and see the key bindings) in the toolbar:
answered Sep 7 '12 at 8:27
Denys Séguret
There is Alt+left arrow and Alt+right arrow to navigate to previous/next cursor positions, and CtrlQ to go to the last edited position
Use bookmarks for that because there is no another way of tracking the necessary code lines. Here is the link about how to use bookmarks http://www.luisdelarosa.com/2005/02/16/eclipse-tip-use-bookmarks-to-track-important-places-in-your-code/
Screenshot of the aforementioned article's content in the link:
I use the side buttons of my mouse and it works for me
The key combination Ctrl + Q brings you back to the last locations, where editing was done.
Use Ctrl + L for an overview of shortcuts. See also Eclipse shortcuts or this Eclipse cheat sheet.
Navigate > Back (Alt+Left_Arrow) already allows to navigate back to previous cursor positions even in the same file. E.g. after you Ctrl+Click on a reference to a local variable (to go to the declaration), then Alt+Left puts the caret back to the reference.
Exlpanation source

Is there a way to center the current line vertically in the Eclipse editor?

I am looking for a functionality similar to Ctrl-l in Emacs. What it does is, for example, if you are editing the second-last line in the visible editor window and you hit Ctrl-L, the current line will move to the center of the editor screen.
This works regardless of the file end.
Most of the time, if one is creating a new file, they would be at the last line, adding more content to the file. Continually staring at the bottom of the screen is hurting my neck.
Go to Window > Preferences > General > Keys
Filter the commands to find 'Recenter'
Add preferred binding (I have Ctrl+Shift+B)
Select 'Editing Text' in the When dropdown.
Edit: unfortunately, if the cursor is at the end of the file, and you try to "recenter", it won't work because there is nothing left to show below the cursor.