lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: editor tips in Usage manual?


From: Steven Arntson
Subject: Re: editor tips in Usage manual?
Date: Tue, 29 Apr 2014 11:21:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

 David Kastrup <address@hidden> writes:

> Federico Bruni <address@hidden> writes:
>
>> I've recently updated the translation of Frescobaldi and I found out a
>> wonderful feature that I had ignored for a lot of time (I don't know
>> when
>> it was introduced..).
>> I'm talking about Window>Split horizontally, which allows to divide the
>> input view in two scrollable panes. This is _very_ handy when writing a
>> polyphonic music where each voice is saved in a variable; after a
>> few bars
>> the distance between the two voices forces you to scroll up and down
>> between the first and the second voice, while inserting new bars. If you
>> split the input view, you can easily jump from first to second voice
>> without scrolling.
>>
>> How many of you is aware of this feature? Any other text editor
>> provides it?
>
> Emacs has a few:
>
> C-x 3 runs the command split-window-right, which is an interactive
> compiled Lisp function in `window.el'.
>
> It is bound to C-x 3, <menu-bar> <file> <new-window-on-right>.
>
> (split-window-right &optional SIZE)
>
> Split the selected window into two side-by-side windows.
> The selected window is on the left.  The newly split-off window
> is on the right, and displays the same buffer.  Return the new
> window.
>
> If optional argument SIZE is omitted or nil, both windows get the
> same width, or close to it.  If SIZE is positive, the left-hand
> (selected) window gets SIZE columns.  If SIZE is negative, the
> right-hand (new) window gets -SIZE columns.  Here, SIZE includes
> the width of the window's scroll bar; if there are no scroll
> bars, it includes the width of the divider column to the window's
> right, if any.
>
> [back]
>
> C-x 2 runs the command split-window-below, which is an interactive
> compiled Lisp function in `window.el'.
>
> It is bound to C-x 2, <menu-bar> <file> <new-window-below>.
>
> (split-window-below &optional SIZE)
>
> Split the selected window into two windows, one above the other.
> The selected window is above.  The newly split-off window is
> below, and displays the same buffer.  Return the new window.
>
> If optional argument SIZE is omitted or nil, both windows get the
> same height, or close to it.  If SIZE is positive, the upper
> (selected) window gets SIZE lines.  If SIZE is negative, the
> lower (new) window gets -SIZE lines.
>
> If the variable `split-window-keep-point' is non-nil, both
> windows get the same value of point as the selected window.
> Otherwise, the window starts are chosen so as to minimize the
> amount of redisplay; this is convenient on slow terminals.
>
> [back]
>
> 2c minor mode (indicator 2C):
> Minor mode for independently editing two columns.
> This is set up for two associated buffers by the three commands bound
> to  C-x 6 2 ,  C-x 6 b  and  C-x 6 s.
> Turning on two-column mode calls the value of the variable `2C-mode-hook',
> if that value is non-nil.
>
> These buffers can be edited separately, for example with `fill-paragraph'.
> If you want to disable parallel scrolling temporarily, use M-x
> 2C-toggle-autoscroll .
>
> If you include long lines that span both columns (e.g., source
> code), they should be in what will be the first column, with the
> associated buffer having empty lines next to them.
>
> Potential uses are writing bilingual texts, or editing the comments of a
> source code.  See the file lisp/two-column.el for detailed examples.
>
> You have the following commands at your disposal:
>
> C-x 6 2   Rearrange screen with current buffer first
> C-x 6 b   Reassociate buffer after changing major mode
> C-x {, C-x }   Shrink, enlarge current column
> M-x 2C-associated-buffer   Switch to associated buffer at same point
> M-x 2C-newline Insert newline(s) in both buffers at same point
> M-x 2C-merge   Merge both buffers
> M-x 2C-dissociate   Dissociate the two buffers
>
> These keybindings can be customized in your init file by
> `2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to
> some prefix.
>
> The appearance of the screen can be customized by the variables
> `2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and
> `truncate-partial-width-windows'.

Following up on emacs, which I'm experimenting with right now. My own
use case:

The ability to split the screen vertically as David explains (C-x 3) is
proving very useful to me for piano scores. I put one measure per line
in my lilypond files, so the lines are (generally) short. I arrange the
lefthand window to show the left hand of the piano, and the righthand to
show the right.

Another nice Emacs feature is that you can scroll the inactive
window. So I could be editing the material for left hand, but scrolling
through the righthand window to keep pace (C-M v).

Steven Arntson




reply via email to

[Prev in Thread] Current Thread [Next in Thread]