> Is there a way to only have those keys bound in Xiki buffers? I.e. is
> there a Xiki keymap which is active in *.notes buffers?
> Ideally, I'd bind C-c C-c to be the Xiki "magic key" inside *.notes
> buffers.
Yep, this will accomplish that:
~/.el4r/init.rb
| define_key(:notes_mode_map, kbd("C-c C-c")) {
Launcher.launch_or_hide(:blink=>true) }
> Actually, I can think of *one* reason it might be nice to have a global Xiki
> keybinding: if Xiki can respect comments in other modes. If I could expand
> Xiki menus inside of comment blocks (and have the expanded results also be
> commented out correctly) while coding in e.g. Ruby, that would be pretty
> awesome.
Hah, funny you say that. I've thought this would be cool for a while.
I have this partially implemented. When you Control-return (just
saying that for brevity) on code in a comment...
# Tree.leaf "hey/you"
def self.leaf path, options={}
...
...it inserts the results inline...
# Tree.leaf "hey/you"
you
def self.leaf path, options={}
...
You can also have mini unit-tests in comments that you can Control-return on:
# Tree.leaf "hey/you".should == "you"
true
If it fails, it inserts the "expected: foo, got: bar" message (it just
inserts the text from rspec).
I haven't done the "and have the expanded results also be commented
out correctly" thing yet, but have thought that might be cool. It
would be easy to do!
> Actually, I can think of *one* reason
Other shortcuts that are pretty useful from code... When in a unit
test, you can type a shortcut (as+todo, so Control-a, Control-t, since
xiki shortcuts are "type the acronym") to add a path (like
"xiki/tests/tree/#leaf/returns last item/") to the top left view.
Then you can Control-enter on it to run the test. When it fails it
inserts the message under the menu, so you can Control-enter to
navigate to where the error was. It's pretty nice to have the paths
of the handful of unit tests you're working with in one place, and be
able to go back and forth between running them (see screenshot).
Also when in any file, you can type another shortcut (as+nav), and it
will add the path to that line to the bottom-left view, so you can
navigate back to it later (also in screenshot). There are quite a few
other optional shortcuts as well.
--Craig