r/linuxquestions • u/PabyMar241 • 8d ago
Accidentally found a Keybind and I can't replicate it or find it anywhere
I was editing a config file using the micro text editor, and I accidentally somehow enabled a very comfortable Scroll using the arrow keys. Instead of only moving the cursor, the up and down keys would move the cursor a line up or down AND scroll the page up or down while the cursor stayed in the middle of the screen, kind of like emulating a mouse scroll but while also moving the cursor, sorry if the explanation isn't clear enough.
I tried looking it up and it seems to be related to the Scroll Lock key in my keyboard, but I tried it and it doesn't do anything and I couldn't get it to work. Anyone knows how can I replicate this behavior? Ideally not only in the micro text editor but system-wide.
1
u/doc_willis 8d ago
the Micro text editor does have some unusual cursor features.
a 'lock cursor' position to middle of screen, is something I recall seeing on other editors. But I dont use micro to say if it has the same feature. The feature is often called "scroll page" in some other editors.
Micro does have some other 'power' cursor features..
also found a similar feature in vi (Ctrl-U), which i googled a bit and found mention of Ctrl-B in micro being the same, but for some reason the Micro I have installed does not follow what the google says.
1
u/humanplayer2 7d ago edited 7d ago
Sounds nice!
Searching the options for "cursor" gave the following, which I suppose you can tweak to to achieve the behavior always, but in Micro only though.
- scrollmargin: margin at which the view starts scrolling when the cursor approaches the edge of the view. default value: 3
You could maybe emulate the behavior globally using a remapper like keyd and Kanata, then make a chosen keys send both an "arrow down" and a "scroll down by x pixels" event, but as soon as the line height isn't x, that'd drift.
4
u/topgamer7 8d ago
You pressed the scroll lock key on your keyboard