The primary duty of an exception handler is to get the error out of the lap of the programmer and into the surprised face of the user. Provided you keep this cardinal rule in mind, you can't go far wrong.
one thing that is awkward about vi is having to reach for the esc to switch modes key, which nowadays is usually located in a corner of the keyboard
there's another way to switch. ctrl-[
this might be on the other side of your keyboard so it gives you a way to switch modes from the opposite side
also, hitting v to jump into your editor seems like a "annoyance" until you begin creating user-defined functions in your interactive shell. or maybe you like saving short scripts.
e.g. you are typing up a good one-liner and then you decide to make it a function and save it for later use. you add give it a name() and brackets { ;} and then hit v. :w name :q and you're done. this is the essence of quick and dirty.
you can load these functions on the fly in other one-liners too, using sed. like this:
commands | sed '1i\
. nameoffunction
' | sh
i don't use bash. i use a very basic bourne-like shell that's stripped of "features" but close to being POSIX compliant. but with vi mode, tabcomplete and functions it's more than enough. vi mode is a good thing. and there are alternatives to readline if you look around.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
one thing that is awkward about vi is having to reach for the esc to switch modes key, which nowadays is usually located in a corner of the keyboard
there's another way to switch. ctrl-[
this might be on the other side of your keyboard so it gives you a way to switch modes from the opposite side
also, hitting v to jump into your editor seems like a "annoyance" until you begin creating user-defined functions in your interactive shell. or maybe you like saving short scripts.
e.g. you are typing up a good one-liner and then you decide to make it a function and save it for later use. you add give it a name() and brackets { ;} and then hit v. :w name :q and you're done. this is the essence of quick and dirty.
you can load these functions on the fly in other one-liners too, using sed. like this:
commands | sed '1i\
. nameoffunction
' | sh
i don't use bash. i use a very basic bourne-like shell that's stripped of "features" but close to being POSIX compliant. but with vi mode, tabcomplete and functions it's more than enough. vi mode is a good thing. and there are alternatives to readline if you look around.
Reply To This Comment