I am pretty new to Emacs. Could someone please help me to write a custom command which I can add to my init file? It would do the following:
- Split the screen vertically to get two windows.
- Check if a buffer named '* ansi-term *' (without spaces) exists. If so, it would open this buffer in the one of vertically split windows.
- If a buffer with such a name doesn't exist it would run command
ansi-term
(ignoring all prompting) to start a new terminal instance in one of the vertically windows.
buffer named '* ansi-term *' (without spaces)
. Please clarify. (Also, please say what you've tried so far and what kind of "help" you need.)*ansi-term*
- indeed, without spaces.C-h i
and look forEmacs Lisp Intro
. Otherwise, you can read it online. It's a super fun read! gnu.org/software/emacs/manual/html_node/eintr/index.html