On 30.06.04, Reuben Thomas wrote:
> Dominik Waßenhoven <[EMAIL PROTECTED]> writes:
> 
> > You could add a shortcut to your local .bind-file, e.g.
> >
> > \bind "M-o" "command-sequence ert-insert; self-insert \oe{};
> > inset-toggle"
> > \bind "M-S-O"       "command-sequence ert-insert; self-insert \OE{};
> > inset-toggle"
> 
> Thanks, this works fine...but for some reason, only if I have no
> preferences file in my ~/.lyx directory; otherwise, my ~/.lyx/lyxrc
> file is ignored.
> 
> I can get around this problem by adding the lines to the preferences
> file, but I presume they'll be lost if I change any of the
> preferences.
> 
> I'm using LyX 1.3.4. Is this a bug? Or am I doing something wrong?

In older versions of LyX, you could insert \bind commands directly into
lyxrc. Now, with the GUI-configuration, .lyx/lyxrc is discarded and the
preferences set with Edit>Preferences are saved to .lyx/preferences.

As \bind commands in the .lyx/preferences file might be overwritten with
the next save from Edit>Preferences, I recommend creating a custom *.bind
file and call it via Edit>Preferences. The \bind_file command is used to
call the standard bind files from there.


Günter



Example: I have a file ~/.lyx/bind/gm.bind

###########################################################
#
# gm.bind  private keybindings file
#
###########################################################

# Since LyX 1.1.6 the keybinding file is set in a GUI dialog. Where in
# previous versions it was possible to load several bind-files and to
# define additional bindings in the .lyxrc resource file, now only one
# bind-file is loaded from LyX. However, it is still possible to load a
# keybinding file from another bind-file.
#   Thus, to customize the bindings, you can write your own bind-file (or use
# this template) and load the default bindings from here.
# In the GUI, set the bindings to your privat bind-file. LyX will search for
# private keybinding files in ~/.lyx/bind/ .
#
# Before defining your own bindings, select one of the available default
# binding sets. These are resource files (like this one) that define a
# large set of (keyboard) bindings. These files live in the /bind directory of
# the LyX system directory and have the .bind suffix.
#
# Currently, you can choose from the following flavors:
#
# cua.bind      for Windows-, Mac- and Motif-like bindings
# emacs.bind    for Emacs-like bindings.
#
# The \bind_file command looks in the LyX bind directory for a file
# of the given name, so a full path should not be given.

\bind_file cua.bind
#\bind_file emacs.bind

# we also would like to incorporate some additional menu shortcuts
\bind_file de_menus.bind

# Based on the default, you can now change part or all of it with the
# \bind command.

# unfortunately, some bindings are broken in de_menus.bind
# Veraltete Tastenbelegung; für rückwärtige Kompatibilität beibehalten
\bind "M-a S-quotedbl"          "layout Section*"       # M-a S-2
\bind "M-a S-section"           "layout Subsection*"    # M-a S-3
\bind "M-a S-dollar"            "layout Subsubsection*" # M-a S-4

# missing in de_menus.bind
\bind "M-a S-equal"     "layout Part*"
\bind "M-a S-exclam"    "layout Chapter*"
\bind "M-a S-percent"   "layout Paragraph*"
\bind "M-a S-ampersand" "layout Subparagraph*"

...


-- 
G.Milde at web.de

Reply via email to