As a preface I'm using ViEmu although I dont think this affects anything. I would simply like to scroll up in the Text Editor along with moving the cursor to the relative screen position.
As an example, if my text editor displays 100 lines of viewable code (1 - 100) and my cursor is on line 20, when I scroll down to the next viewable 100 lines (101 -200) I would like the cursor to be at 120.
Using the VS command Edit.ScrollDown scrolls the code down as expected but leaving the cursor at line 20 instead of moving it to 120. Is there another command to use or any way to alter this behavior?
As noted in the question you seem to be wanting to re-map Page Down to another key (due to limited keyboard).
To identify which command a key is mapped to open the keyboard customisation dialogue and type in the current key into the short key text box and then look at what it is currently mapped to.
Unfortunately this doesn't work for page down (control-page down does work, but that doesn't help here).
Entering "page" into the command filter does: Edit.PageDown is mapped to Page Down in the text editor. Map this command to another shortcut.
Related
In my web app I cannot move the cursor up or down when editing a multi-row text in a simple text area.
The cursor seems to be "locked" to either the first row or the last row. It can be moved left or right normally but not across line breaks.
It is impossible to place the cursor into one of the middle rows. Not by keyboard, and not by mouse either.
The same text area works like a charm in Chrome. I can place the cursor wherever I want and how I want - as expected.
Any idea why this is so and what I can do to fix this?
The text area's css property "user-select" was set to "none". Setting it to "auto" fixed the issue.
Alt+Left navigate backs to the last cursor position and if the last cursor position was in a different file then it navigates to that file.
But, I want to navigate to the last cursor position with respect to the currently focused file only. It is really useful when I have 2 split file editors and want to navigate back exclusive to each other.
Is it possible?
I hope you understand the question, let me know if further explanation is required.
Basic Functionality
You can use the cursor undo / cursor redo commands via the command palette.
Undo also comes with a keyboard shortcut by default (Mac: cmd+u, Windows/Linux: ctrl+u), and you can configure a keybinding for redo.
Advanced Functionality
Note, however, that the file's cursor history is only saved while it has focus in an editor group. So if you have split editors, multiple focused files can have their own cursor history saved. And if the same file is opened and focused in two different editor groups, it has two different cursor history states.
But as soon as you focus another file in an editor group, the previously focused file will lose its cursor history (in that editor group).
The VSCode team is currently working on a variety of open issues to improve local history across the board, but I don't believe that saving cursor history for blurred (or closed) files is in the plans yet. If you need that functionality, you may want to create a feature request.
Note, with VSCode 1.40 (Oct. 2019):
The Soft Undo command has been renamed to Cursor Undo
This action is useful, for example when using Ctrl+D to select the next match and going one time too far, as it undoes only the last cursor state change.
Additionally, we now have added Cursor Redo, which redoes the previously undone cursor state change.
I have a long line that I want to select a section in the middle. In Visual Studio, it would scroll all the way to the end of the line, passing where I want the selection to end, when I move pass the text area and move all the way back when I try to move back a little. Is there a way to slow down the Visual Studio scrolling adjustment?
If you are talking about selecting text using the mouse you can get fine grained control by combining the the mouse and keyboard. This should work in any application that allows text selection, not just Visual Studio.
First click the location where you want to begin selecting text.
Next scroll to the location where you want to end selecting text and hold down Shift on the keyboard while clicking with the mouse. The block of text between the first click and the shift+click will be selected without having to worry about the selection jumping around due to scrolling.
As for actually slowing down the scrolling; I know of no way to do that. Hopefully my tip should give you an alternate way to do what you actually want.
My question today is, when selecting multiple lines of code and not completely selecting the full line for all the lines selected, how can I (or is there any keyboard shortcut for) block select all the lines that I have already selected, so that I have not just some lines fully selected and some not fully selected, but all the lines are fully selected from the home of the top line selected, to the end of the last line selected?
Note: The bold text in the segment above is what I am mainly trying to ask.
Thanks to anybody that is able to provide me with any helpful information!
From your question it looks like you want to select a block and not the complete line.
Hold the alt key and use the mouse to select your block.
You can use Alt + Shift + Arrow keys..
Its called Box Selection and was introduced in VS2010.
learn more about it here
I'm a NotePad++ user, new to TextMate.
There are some features that I really like in NP++ but couldn't figure out if TextMate support them.
Double click on a variable and have all instances highlighted
View 2 text windows side by side
Drag a file onto another opened Window
For this one, I don't know how to generate a screenshot ;-p. Basically, you can drag a file from Windows Explorer and drop it into NP++ to have it opened.
A lot of long time TextMate users are leaving TextMate land, actually. So, I'm not sure it's the right time to move to TextMate.
Emacs and Vim both do what you want and more. If you can afford the learning curve it's definitely worth it.
As for your question:
View 2 text windows side by side
You can have two or more windows for the same document. Assuming you are in a "project" right-click your file in the drawer and choose Open "foo.ext" in New Window. The two "views" contents are more or less in sync but doing cool things like columnar editing tends to break the syncing.
Due to how Mac OS X manages windows, the new window will probably be too large/too small and/or placed in a less than useful place. I use ShiftIt system wide to manage my windows and in such a case have them the same size side by side.
Double click on a variable and have all instances highlighted
What do you use this for? Is this visual highlight or non-contiguous selection?
Type ctrlw to select the word, then ⌘e to make the word your search term, then ⇧⌘f or Edit > Find > Find in Project… It will show all instances of the search term in another window. You can then "jump" to any occurence and do whatever you want.
If you only want to jump from occurence to occurence, select the word then type ⌘e then ⌘g to jump to the next occurence.
Another way is to type ctrls, a little text field appears at the bottom of your window where you can type a word and see its first occurence selected in real time. Repeatly typing ctrls will cycle through the occurences.
Drag a file onto another opened Window
You can drag & drop a file on TextMate's icon in the Dock. You can also right-click the file and choose Open with TextMate *or Open with…*. If you are in a "project" you can right-click and choose Add Existing Files…. Opening multiple files in TextMate will automatically create a "project" for you.
View 2 text windows side by side
I just tried this and it doesn't seem to recognize this functionality. the only time any sort of "add" icon came up was when I dragged the file into an open document and then released, but that resulted in adding the contents of the file into the document.
I just did a quick google search for "textmate split view" and it still doesn't seem to be supported according to some of the answers i found (one from macromates wiki).
Double click on a variable and have all instances highlighted
This also doesn't seem to be supported. This post suggests using the command + f (find), put the word into find, then command + g to jump to the next instance of that word.
There are definitely some things that can be added to textmate to make it more robust. If you are looking for something similar and are on a windows machine, you should check out e text editor. I loved that editor when I was working on a windows machine - split view is supported, but not sure about the highlighting. One thing that e also beats out textmate is the real time regular expression highlighting.