Before using Emacs, I used Nano, and I would like to change the horizontal scrolling in Emacs to be slightly more intuitive. Just for clarification, by horizontal scrolling, I mean the forward-char and backward-char movement out of the window boundaries, and not the Ctrl+x > commands.
The main thing I would like to figure out is how to have it only scroll one letter at a time (I guess like horizontal "smooth-scrolling"), or maybe even one full pane width at a time.
I've tried changing some variables containing "hscroll" (like hscroll-margin), but none of them seem to get me closer to the behavior I am looking for.
What variables should I be looking at to get horizontal scrolling working how I want?
I think that you can get what you want with:
(setq hscroll-margin 0)
(setq hscroll-step 1)
If not, can you describe how you would like the behaviour to be.
Related
In the truncate mode, only partial lines are displayed in the window. I know C-x < and C-x > can scroll left and right, but I'd like a more convenient way to handle horizontal scrolling - the way alike what we scroll vertically with mouse wheel (possibly combined with pressing other modification keys). Is there any way to set it up in .emacs? Thanks.
mwheel-scroll internally calls
(funcall mwheel-scroll-down-function)
resp. for up
a toggle-command might replace this function with scroll-left resp. the other spot with ...-right.
Basically, the minibuffer is small and at the bottom of the screen.
With a large monitor especially, this means I often need to lean forward to read it. It is also very long - this makes it slower to read. (no line breaks)
The minibuffer is sort like a launcher/error area - so it seems logical that it act more like some combination of quicksilver/growl.
You can make the minibuffer taller by using the function enlarge-window or its keyboard shortcut C-x ^. See is it possible to move the emacs minibuffer to the top of the screen? for some thoughts on how to move the minibuffer itself.
Consider using a standalone minibuffer frame. That saves real estate: no need for a minibuffer in each frame. And it also lets you configure the look and feel separately for the minibuffer. I use a minibuffer frame that extends across my whole screen and is (by default) 2 lines high. The minibuffer can hold any number of lines, BTW.
This is what I use, in case it helps:
http://www.emacswiki.org/emacs/download/oneonone.el
http://www.emacswiki.org/emacs/Dedicated_Minibuffer_Frame
In Vim I can move a split around. For example, if my window was split in two horizontally, with the topmost split split vertically (3 splits in total) I could move the top-right split to the right to become a vertical split taking up the entire vertical space.
Is this kind of rearrangement possible?
Update: I know resizing is possible, I'm looking to move though. I get the feeling this is not supported by Emacs.
You may be interested by C-x + when you have more than 2 windows. It rearranges equally the windows on the frame. It's convenient for example when you do two C-x 2 in a row and want to have the windows to occupy the same space on the frame.
No, not by default. What you have to play with is basically C-x 0, C-x 1, etc. Look in the Emacs Wiki for extensions that may or may not do what you're looking for.
FWIW, if you are running within a GUI, then you can precisely re-arrange window sizes quickly and easily with the mouse. This isn't quite the same thing as you're asking for, but may be a handy alternative in some cases.
You can click on any non-'active' area of the mode line (such as the buffer name) and then drag it up or down.
Dragging side to side is more fiddly. You must click on the exact border between the two mode lines, and then you can drag left/right.
For your specific example, I don't believe that is supported. AFAIK you can only reorganise the window splits within their existing 'parent' window (the upper split in this example). To make the upper-right window fill the vertical space you would either remove the bottom window with C-x 0, or use C-x 1 to remove all other windows, and then re-split them in the desired manner.
(Tangentially, I've often thought a custom library to 'rotate' the window splits would be a nice thing to have.)
I believe that the window resize commands are built in to window.el, from emacswiki the functions you want documented are:
shrink-window-horizontally ; C-x {
enlarge-window-horizontally ; C-x }
enlarge-window ; C-x ^
shrink-window ; not bound on my system
The comments are what they are bound to on my system, but I don't know if I did that myself.
All of them take a prefix argument, the number of lines to enlarge/shrink. The last two default to vertical.
As far as I know you cannot create a new window that runs the length or width of the screenfrom a window already split in that direction. Buffers remain open if you close the windows though so you can remove windows and then split them in the configuration you want. Then change which buffer is displayed in the window you are standing in by pressing C-x left arrow or right arrow.
I should add that this answer is regarding "vanilla" emacs, there is probably a way of doing what the OP asks if you really want to. It's emacs after all.
How can I make vertical splitting the default instead of horizontal splitting in Emacs?
My use case: I want to compare a Python file with an older revision of itself from the svn-repository, I do this with the C-x v ~ command. Unfortunately this always opens a second buffer while splitting the window horizontally. Vertically would be much better (at least for PEP-8 compliant files ;)).
See the answers to the question Setting Emacs Split to Horizontal and do the opposite.
Taking offby1's answer and inverting it gives you:
(setq split-height-threshold 0)
(setq split-width-threshold nil)
Mine does open vertically when I try it. I don't have any experience with that particular command, but if it's like most emacs commands it decides which way to split the window based on the current window dimensions: if the window is tall it will split horizontally, but if it's wide it will split vertically. So just change the window dimensions to be wider and it should switch automatically
I have a few scripts that use the function pop-to-buffer a lot. It used to split the window horizontally, but now in Emacs 23 it splits the window vertically. I've dug through some of the elisp code but it's not jumping out at me - how can I change this behavior of Emacs 23 to split horizontally again?
It's listed in the NEWS for Emacs (C-h N):
*** display-buffer' tries to be smarter when splitting windows. The
new option
split-window-preferred-function' lets
you specify your own function to pop
up new windows. Its default value
split-window-sensibly' can split a
window either vertically or
horizontally, whichever seems more
suitable in the current configuration.
You can tune the behavior of
split-window-sensibly by customizing
split-height-threshold' and the new
option `split-width-threshold'. Both
options now take the value nil to
inhibit splitting in one direction.
Setting split-width-threshold to nil
inhibits horizontal splitting and gets
you the behavior of Emacs 22 in this
respect. In any case, display-buffer
may now split the largest window
vertically even when it is not as wide
as the containing frame.
I think what you want is:
(setq split-width-threshold nil)
(but I think you're using the vertical versus horizontal splitting the opposite of what Emacs terminology is (which is counterintuitive to me as well))