Skip to content

Instantly share code, notes, and snippets.

" A very nice sequence Raimondi gave me, which (when the cursor is on a brace
" or other matchable delimiter) deletes the braces (and the lines they're on)
" and decreases the indent of what they used to contain. Clobbers marks a and
" A.
" TODO: Make this work with things like Ruby and Objective-C block
" delimiters. Currently this only detects (, [, or {.
function! Unblockify()
let l:is_on_last_line = 0
let l:current_char = getline('.')[col('.')-1]
let l:is_beginning_block_delim = l:current_char =~ '[([{]'
#!/bin/bash
# Some bash utility functions (and associated aliases) that can be convenient to
# have. Tested with 3.2.48(1)-release on Mac OS X 10.6.
# Add pathname to start or end of a path; take out existing copies first.
# Unfortunately, this doesn't handle weird cases like pathnames with : in
# them. A little experimentation shows that bash doesn't recognize those
# anyway.
add_to_path() {
# Problematic .inputrc
# Problem occurs with GNU bash, version 3.2.48(1)-release (i386-apple-darwin10.0) (Mac OS X 10.6)
"\e\e[A": beginning-of-line
"\e\e[B": end-of-line
"\e\e[C": forward-word
"\e\e[D": backward-word
"\e(": kill-word
Tab: menu-complete
"\el": redraw-current-line
#!/usr/bin/env ruby1.9
# Extends Array#map to take symbols, without having to use & on them.
# I can't find any way to define this in Enumerable and then have it
# automatically get picked up by Array et al. Even when I defined this in a
# module (Enumerable or another) and then include it into Array, it doesn't
# seem to recognize the new method.
class Array
alias old_map map
def map(arg=nil)
set nocompatible
set hidden
" Create a key code for meta+supplied character, if in a terminal. (Not
" necessary in the GUI.)
function! MakeMetaCharacter(char)
if !has('gui_running')
if a:char == ">"
" Huge kludge! set can't deal directly with >, since it confuses it
" with the end delimiter (even if you use a backslash). This also
// #1. Original code (causes unrecognized selector exception):
[self setColor:DecodePixel24(coder)];
// #2. Dummy code that does work:
Pixel24 __tempPixel = {255, 255, 255};
[self setColor:__tempPixel];
// Code that should work, judging from the previous, but actually raises the
// same exception as in #1:
Pixel24 __tempPixel = {255, 255, 255};
Pixel24 DecodePixel24(NSCoder *coder)
{
Pixel24 p;
[coder decodeValueOfObjCType:@encode(int) at:&p.r];
[coder decodeValueOfObjCType:@encode(int) at:&p.g];
[coder decodeValueOfObjCType:@encode(int) at:&p.b];
return p;
}
scope = 'local'
lam = lambda do
puts scope
inner_lam = lambda do
puts scope
end
inner_lam[]
end
org.apache.bsf.BSFException: Exception
at org.jruby.javasupport.bsf.JRubyEngine.exec(JRubyEngine.java:101)
at org.apache.bsf.BSFManager$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.bsf.BSFManager.exec(Unknown Source)
at com.patelsoft.superscript.SuperScriptPlugin.executeScript(SuperScriptPlugin.java:149)
at com.patelsoft.superscript.SuperScriptMacroHandler.runMacro(SuperScriptMacroHandler.java:52)
at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:462)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:352)
at org.gjt.sp.jedit.jEdit$4.invokeAction(jEdit.java:3264)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptPlugin: unable to load language: ruby
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: org.apache.bsf.BSFException: unable to load language: ruby
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at org.apache.bsf.BSFManager.loadScriptingEngine(Unknown Source)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at org.apache.bsf.BSFManager.exec(Unknown Source)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at com.patelsoft.superscript.SuperScriptPlugin.executeScript(SuperScriptPlugin.java:149)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at com.patelsoft.superscript.SuperScriptMacroHandler.runMacro(SuperScriptMacroHandler.java:52)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:462)
8:41:19 PM [AWT-EventQueue-0] [error] SuperScriptMacroHandler: at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:352)
8: