Re: [Builder] Emacs mode and keybindings



Thanks for doing this Alex!

I am curious if it is possible to do the same with VIM mode. It has a
lot of very strange interactions that are not exactly doable with
G_SIGNAL_ACTION. When I tried to do a few things, I simply couldn't get
it working. But that was months ago, and my mind slips as to why. I
might have just moved on to other things due to the level of importance.

Cheers,

-- Christian


On 02/18/2015 09:52 AM, Roberto Majadas Lopez wrote:
wow! looks really cool! :)

Roberto

2015-02-18 18:34 GMT+01:00 Alexander Larsson <alexl redhat com>:

I just pushed a new branch at:
https://git.gnome.org/browse/gnome-builder/log/?h=wip/alexl/emacs-css-keys

This removes the GbEmacsSource completely, and instead just loads some
custom css when emacs mode is enabled:


https://git.gnome.org/browse/gnome-builder/tree/src/resources/css/emacs.css?h=wip/alexl/emacs-css-keys

This has several cool features:

* Fixes the bug where emacs mode got confused if you entered a command
  prefix that didn't exist.

* This is very flexible and generic, as well as fits well into how gtk+
  works.

* some emacs keybindings (like cursor motion) work in entries and tree
  views as well as in the sourceview.

* You can easily trigger any kind of builder action from any keybinding,
  as well as the normal keybinding signals

* There is a mode thing that lets you do modal things like this:

    bind "<ctrl>x" { "set-mode" ("emacs-x", transient) };

  plus:

    @binding-set builder-emacs-source-view-x {
       bind "<ctrl>c" { "action" ("app", "quit", "") };
    }
    GbSourceViewMode.emacs-x {
      gtk-key-bindings: builder-emacs-source-view-x;
    }

  Lets you do the emacs style ctrl-x ctrl-c to exit.

  GbSourceViewMode even has a "modal" type mode which i believe could
  be used to implement the vim mode using regular CSS. (Although i don't
  really speak vim, so who knows).

* I added a bunch of things from the default.ini keybinding setting to
  the emacs mode that were not bound at all before.
  Some are still missing because i'm not sure what they are or how to
  best fit them in with emacs stuff.

* The current defaults.ini and vim.ini files could easily be converted
  to standard CSS keybindings too.


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc
       alexl redhat com            alexander larsson gmail com
He's a benighted amnesiac firefighter possessed of the uncanny powers of
an insect. She's a cynical communist schoolgirl with someone else's
memories. They fight crime!

_______________________________________________
Builder-list mailing list
Builder-list gnome org
https://mail.gnome.org/mailman/listinfo/builder-list






_______________________________________________
Builder-list mailing list
Builder-list gnome org
https://mail.gnome.org/mailman/listinfo/builder-list



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