senny / cabbage

get the maximum out of emacs
http://senny.github.com/cabbage/
156 stars 21 forks source link

function to toggle between symbol and strings #154

Closed senny closed 11 years ago

senny commented 12 years ago

I've implemented a small function to toggle between a symbol and a single-quoted string. I couldn't come up with a good binding though.

Also the implementation is pretty rough if anyone has suggestions, feel free to jump in.

senny commented 12 years ago

@tonini, @stmichael, @bjoernbur what do you think?

tonini commented 12 years ago
  a = 'string' # not working
  b = "wooot" # not working
  c = :woot # works, but only if selected from left to right
  d = :'woot-im-biatch' # not working

btw, I just selected the strings or symbols, not the whole line. ;)

senny commented 12 years ago

@tonini you don't need to select anything, just place the cursor ON the symbol or string.

tonini commented 12 years ago

@senny yes! that's nice. ;)

just this one is not working, but this is a special one.

d = :'hey-dude' # not working
senny commented 12 years ago

@tonini I know, I havent checked for these. Also interpolated strings won't be turned into interpolated symbols.

senny commented 12 years ago

@tonini got a good Idea for a convenient binding?

tonini commented 12 years ago

@senny ruby-mode mostly have bindings like "M-C ....". But in the wild it's behavior is a bit weird. I mean, mostly of the time I got the "C-M ..." by emac if I try to press the keystrokes. What I prefere is "C-r s", "C-r" is not used so far.

senny commented 12 years ago

or we stick to the Emacs default and use something like C-c .... which is supposed to be used for mode specific bindings.

tonini commented 12 years ago

what do you think about C-c s?

senny commented 11 years ago

A reader on my blog just mentioned a elisp package he wrote: https://github.com/rejeep/ruby-tools I think this could be an interesting addition to cabbage. It solves this issue and has some more features, which look very handy.

@tonini @stmichael @bjoernbur what do you think?

tonini commented 11 years ago

@senny these ruby-tools looks indeed very promising. What's you're next step, do you'll add it into the ruby bundle in a separated branch so we could test it out for a while?

senny commented 11 years ago

this was replaced by #168