Fast text scrolling in VS Code - scroll

I am testing out Visual Studio Code on macOS, and was wondering if there is a key combination for faster scrolling?
I would need this, for example, to go quickly from an early part of the code to a part towards the end of the file.
e.g. in Emacs when I hold up/down-arrow and hit Ctrl, the scroll speed increases noticeably; VS Code actually stops scrolling with the same command. Cmd+arrow will get me to the start / end of the file, but I could not find a combination that merely speeds things up and nothing in the keyboard shortcuts looked helpful.
Version is 1.21.1.

Update: Since v1.31 you can now press Alt to enable fast scrolling. It works by activating editor.fastScrollSensitivity.

There is
"editor.mouseWheelScrollSensitivity": 1, // or any number
You can scroll by pages too:
PageDown or PageUp

Go to File > Preferences > Settings. Search for: mouseWheelScrollSensitivity, change it for 0.01

in Emacs when I hold up/down-arrow [...]
The OP mentioned key strokes as opposed to mouse scrolling.
My solution was at an OS level, i.e. lessen the Key Repeat and Delay Until Repeat settings so that holding the up / down arrows will scroll much quicker.
Important note: This setting will update all key presses regardless of the app.
If on OSX, this setting can be found in System Preferences under Keyboard, or overwritten directly in the terminal. The following will take effect after a system reboot.
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)

It is not available, but is an open issue. You can follow the progress here:
https://github.com/Microsoft/vscode/issues/24344

Related

How can I fix Xcode's open quickly?

I wonder if I'm doing something to make it not work, but simply put after tapping cmmd + shift + O or going to File >> Open quickly the option doesn't show up. It's like I did nothing.
Wondering if this is a known Xcode bug or if I'm doing something.
I'm using Xcode 10.1
You probably have more than one monitor connected.
This is something that confused me a lot of times as well; the quick search prompt will remember its position (you can drag it around) even on secondary monitors.
For what is worth, in my opinion, that field should always be presented on the current (in focus) editor.

TextMate 2 Escape key: how to disable next completion and previous completion

By default, pressing Esc in TextMate cycles through possible completions (in addition to closing dialog boxes), which can put unwanted characters in your document, especially if you are used to Esc being a safe key to hit in most text editors. (In fact, in a lot of IDEs, pressing Esc a lot is necessary to close auto-completion popups so the up and down arrow keys work.)
How do I disable this behavior, so in normal text editing, the Esc key does nothing, but closing dialogs still works as expected?
What works
Based on a comment from #matt I found that I can do what I need by overriding the default key binding, as mentioned here, https://manual.macromates.com/en/key_bindings.html :
In addition TextMate has a /path/‍to/‍TextMate.app/‍Contents/‍Resources/‍KeyBindings.dict file with some extra key bindings which are specific to TextMate (and thus not appropriate to put in the per user global key bindings file). You can copy this file to ~/Library/‍Application Support/‍TextMate and edit it, this will then take precedence over the bundled file.
I edited the file and took out the line with nextCompletion, assigned to shift+Esc ($\033) and assigned both Esc and shift+Esc to call noop
"\033" = "noop:";
"$\033" = "noop:";
I learned about the existence of the noop selector here:
https://github.com/textmate/textmate/search?utf8=%E2%9C%93&q=noop
After quitting and relaunching TextMate Esc now does nothing except close dialogs.
(Apparently to change this one setting, you need to know Objective-C to recognize selector strings, (and assembly which has 'nop') so you can guess that there should be a noop selector. And you need to know octal, so you recognize the Escape key as 033 = 27.)
Things I tried that failed
EDIT: for reference for people wondering how it can take 90 minutes to change one little setting.
I found this paragraph in the manual, at the end of section 4.2:
When you provide your own completion command (or list) you may want to
disable the default matches. This can be done by setting
disableDefaultCompletion to 1.
I tried setting disableDefaultCompletion to 1 in the Preferences > Variables pane and quitting and reopening the app. I found that Bundle menu > Select Bundle Item and clicking Settings shows a list of all the settings, including my disableDefaultCompletion = 1 at the bottom. Apparently this doesn't do anything? (Other settings overridden by different bundles show as crossed out, which my settings is not.)
I also searched the http://github.com/textmate/textmate repo for the string disableDefaultCompletion and it shows in the search results, so this is feature should exist there somewhere.
I tried quitting the app and then on the commandline:
defaults write com.macromates.TextMate disableDefaultCompletion true
Relaunching and trying again (hitting Esc to the right of a close } in JavaScript mode) and it is still not disabling completion.

Create a script in Windows 7 that controls volume

I'm relatively new to programming and I want to make a script that controls the volume of my pc, linkt to hotkeys. What I want it to do specifically is whenever I press a key on my keyboard (i.e. ctrl + Alt + arrow up), it turns the volume to 75% and when I press another key (i.e. ctrl + Alt + arrow down), it turns it to 15%.
What type of script would I need to make, where shoult it be saved and how do I setup a hotkey to trigger it? (Also, I want this to work as soon as my pc boots up, or right thereafter). You don't need to prewrite a script for me, just point me in the right direction and I'll find my way.
This is what I've got so far:
; Volume control (turn master volume to 75% or 15%)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^!F12::Soundset, 75
^!F11::Soundset, 15
This works fine, but I use it on a laptop, which also has a function (fn) key to in-/decrease volume and mute it. Now, whenever I mute using the function key, I cannot set de volume to 75% with the hotkey. So I was wondering if I could override the function key (or whenever I press ctrl + fn + volume up/down it sets it to 75%, or 15%, respectivily). Also the script doesn't give any visual feedback, apart from the volume icon showing more or less volume bars (or however it's called). How would I go about doing this?
ALso, do I need those first few lines (e.g. #NoEnv, #Warn,...) or are they just for failsafe?
Any help would be much appreciated.
Look at the link in 2501's comment first. Try some things for yourself.
Then look here: https://autohotkey.com/docs/commands/SoundSet.htm which will tell you about SoundSet. Then try some more things yourself.
SoundSet
Changes various settings of a sound device (master mute, master volume, etc.)
SoundSet, NewSetting [, ComponentType, ControlType, DeviceNumber]
NewSetting: Percentage number between -100 and 100 inclusive (it can be a floating point number or expression). If the number begins with a plus or minus sign, the current setting will be adjusted up or down by the indicated amount. Otherwise, the setting will be set explicitly to the level indicated by NewSetting.

How to scroll horizontally in emacs?

I can't get emacs to scroll horizontally!
To replicate the problem:
Open the *scratch* buffer.
Write a long line.
Make the long line exceed the window width with M-xtoggle-truncate-lines. The left hand text (column 0) will now be off the left of the window.
Try M-xscroll-left or its shortcut C-x < to scroll left.
Type y to enable the disabled commands.
NOTHING HAPPENS!
I also tried C-a to go to the beginning of the line.
I also tried M-xtoggle-horizontal-scroll-bar but got the error message "Horizontal scroll bars aren't implemented yet".
There seems to be no way to scroll horizontally!
I need this because I have many wide CSV files to read.
I'm using the latest prelude on emacs 24.5 on Windows 10.
I filed an issue on the prelude project in case it is a genuine bug and could be fixed there.
You seem not to understand how horizontal scrolling works. It's not intuitive, that's why the command is disabled by default.
When I press C-x< at the end of the long line, the line disappears to the left. When I press C-x> there, nothing happens.
Pressing C-x< at the beginning of the long line, though, shows the second part of the long line.
Consider using visual-line-mode or even the csv-mode instead.
There is new a feature in Emacs 26. You can customize mwheel-tilt-scroll-p and use mouse to scroll.
M-x customize group RET mouse
Then set mwheel-tilt-scroll-p to t
No need to handroll it yourself. This is provided out of the box in emacs 27, and it probably was available for longer:
This feature is off by default; the variable mouse-wheel-tilt-scroll turns it on, if you customize it to a non-nil value.
(setq mouse-wheel-tilt-scroll t)
Sounds like xemacs have horizontal scroll in a 'natural' way.
As far as I can see it there is a [Options] button in the menubar, when clicking on it there is a [Frame Appearance] sub menu and there, there are 2 button []scrollbars, [] Truncate Lines
When these 2 buttons are checked in, long line are truncated and scrolling is smooth.
May be xemacs is non standard though.
I use it, I find it easy to cut/paste even rectangular areas, selection is faster and more precise to me that what I could achieve with keyboard meta-ctrl-shift stroke alone.
Cheers
Phi
I

How to increase the time tooltips remain visible in Visual Studio

By default, Visual Studio tooltips remain visible for 10 seconds and then they disappear. I find this time too short to read some of the longer tooltips. Is there a way to increase the time they remain visible?
Whenever I encounter such a problem, I just press print screen and read the text in my favorite paint program.
I never understood why the tooltip timeout is not based on the length of the content.
My understanding is that ToolTips preferences are controlled at the system display level (i.e., as part of Windows settings). As far as I know, there is still no way to lengthen the time that a tip is displayed.
I recommend Shay Erlichmen's trick of using print screen to capture the tip. Paste into a paint program and you can read the whole thing. Then close the paint program without saving.

Resources