Saving my fingers by replacing xterm

jdavidb on 2006-07-11T20:30:47

Is there any good alternative to xterm that will let me save typing by defining some kind of shortcuts or macros for things I commonly type. (Yes, the shell could help a bit with this, but sometimes these are things I commonly type in vi or something else.)


bashrc

cyclist38 on 2006-07-11T21:04:05

in .bashrc use alias something='else'

alias recal="history | grep" instead of history | grep something all the time

you can also use bash-completion to enable tab completion on the command line for directories, filenames, apps and such

Re: Saving my fingers by replacing xterm

bluto on 2006-07-11T21:38:37

Do you already use a "kitchen sink" shell (e.g. bash, zsh, etc)? I use zsh and find that much of the stuff I need to type is available through tab completion (e.g. commands, pathname components, switch names, etc). If that doesn't work then chances are good I've already typed it at some point and can find and edit it by interactively searching through my massive history file with ctrl-r (with emacs bindings that is, not sure how to do that with vi bindings).

I'm pretty sure there are even ways of redefining keys to perform a command or insert text, though I've forgotten the details.

Re: Saving my fingers by replacing xterm

parv on 2006-07-12T03:24:39

In zsh 4.x, '/' is what i use for history search in vi mode. (It could be just 'Ctrl-R' w/ various options would have worked and i had changed my bindings.) In bash 3 here, vi mode again, both 'Ctrl-R' & '/' start reverse-i-search.

Re: Saving my fingers by replacing xterm

rats on 2006-07-12T03:54:08

Have you looked at MultiGnomeTerminal? It allows you to program your function keys with all sorts of useful strings.

Re: Saving my fingers by replacing xterm

jdavidb on 2006-07-12T19:20:11

Thank you! From your description that sounds like the solution I am looking for. Everybody else seems to be offering solutions that will help me only in the shell or only in my editor. (And I was to the point of weighing the cost of learning two or more systems for shortcuts versus the cost of learning the source code for xterm so I could hack in the features I wanted. Which is not a good comparison to be making... :) )

Use Vim

Dom2 on 2006-07-12T07:01:53

In vi (or vim), use abbr in the config file (~/.exrc or ~/.vimrc).
  abbr FOO Federation Of OrangUtans

Now, every time you type in "FOO ", it gets expanded automatically.

-Dom