Friday, January 13, 2012

How to create an emacs alias for shell mode

Most of the time, i launch emacs from the shell.I usually prefer to use it inside the shell, that is why using the command brings up emacs in windowed mode which is rather annoying.

~$ emacs

to use emacs in shell mode you have to give it the no window flag, this way.

~$ emacs -nw

so, this works fine but the problem is that you have to type this every time with the no window flag.To overcome this, you can create a shell alias.This is done by editing the .bashrc file which is usually present in your home directory.At the bottom add the following line, also from examples you can easily learn how to create aliases.

alias emacs='emacs -nw'

Save the changes and restart the shell, you can now try it out.

No comments:

Post a Comment