Skip to content
Duncan Holm edited this page Jan 18, 2023 · 11 revisions
  • Atom (the most polished and most likely to work without really needing to understand how things are wired together)
  • Visual Studio Code
  • Sublime 2 and 3 (works reasonably, but isn't integrated with the package manager)
  • TextMate 1
  • TextMate 2 (TM2 is actually looking really nice these days -- Josh Cheek, 18 Feb 2015)

Vim

These packages support SiB:

  • Personally, I had difficulty both of the below, I'm using this configuration currently. Note that I run vim from the command line, so it inherits my shell's environment variables. Also, the toggle command is bound to return, which is pretty aggressive, you might change that if it gets in your way. I've been told the function thing only works on vim 8. If you can't upgrade, you should be able to duplicate the cursor saving code and put the different functions inline within it.
  • vim-seeing-is-believing
  • vim-ruby-xmpfilter

Emacs Integration

The unofficial integration is maintained by John Cinnamond here. You can see him use it in this presentation at 10 minutes.

Alternatively, adding this function to your Emacs configuration will get you pretty far:

(defun seeing-is-believing ()
  "Replace the current region (or the whole buffer, if none) with the output
of seeing_is_believing."
  (interactive)
  (let ((beg (if (region-active-p) (region-beginning) (point-min)))
        (end (if (region-active-p) (region-end) (point-max)))
        (origin (point)))
    (shell-command-on-region beg end "seeing_is_believing" nil 'replace)
    (goto-char origin)))

It lets you call seeing-is-believing to replace the current region or current buffer contents with the output of running it through seeing_is_believing.

Nano

GNU nano 7.0 added a feature where a keybinding can now perform multiple actions sequentially. This makes it possible to run things like seeing_is_believing with a single keypress. For example, to use the F5 key to run the whole buffer through SiB, put the following in your .nanorc file:

bind F5 "{execute}| seeing_is_believing; [ $? -le 1 ]{enter}" main

If you use nano with the feature to allow multiple open buffers in same session enabled (set multibuffer) then use the following instead (otherwise the annotated code will be placed in a new buffer every time, rather than replacing the contents of the original buffer):

bind F5 "{execute}{flipnewbuffer}| seeing_is_believing; [ $? -le 1 ]{enter}" main

Additionally, here's what to put for a separate key F8 which removes all SiB annotations from the buffer:

bind F8 "{execute}| seeing_is_believing --clean{enter}" main

or (for the same reason as before):

bind F8 "{execute}{flipnewbuffer}| seeing_is_believing --clean{enter}" main

See the documentation for the .nanorc file for general reference.