Feeling l33t today

I had lunch the other day with Peter Harkins, a fellow PHP and Python programmer. I showed him my ruby app and I mad the comment that on my new host Rails Playround the code in vi is syntax highlighted and it wasn't on my OLD host. I don't understand this terminal stuff. He said oh, just do ":syn on" and whoa, I was in color! Sweet. I don't know how all that works, but it did. I use putty for my ssh client. Then later in email, I don't remember how this came up, but I said I really get mad when I'm in vi and I (out of habbit) hit ctrl-s and my terminal seems to "lock up" and I have to shut down and go back in. It REALLY makes me mad when I do that!! He said this:

It's a relic from the "terminals are a printer or dumb hunk of glass" days. CTRL-s stops flow-control (so you can read stuff before it scrolls away), CTRL-q restarts it. If you never ever want this (most don't), do 'stty -ixon -xioff' to kill those keys (you can put this in your .bashrc).

Ahhhh... so I turned it off and then set about to figure out how to remap my ^S to :w .. here's what I did

map! ^S ^[:w^M

in your .exrc file:

here's how, type
press esc

you have to use map! so it will work when you are in insert mode.

It works.

I'm l33t today :)

BTW, Peter started a new blog on a wickedly cool domain name push.cx ... if the name is not familiar to you, read his first blog post!


Post a Comment

Links to this post:

Create a Link

<< Home