![]() Throughout this guide, I will use the notation, for example, of C-a to mean "press Ctrl and a at the same time," and M-a to mean "press meta and a at the same time." This notation is pretty standard, and if you read guides to Emacs online you will most likely see the same notation. You can try fiddling with your connection client's settings to get Alt to go through correctly, or you can instead use Esc as the meta key. #EMACS FLAG TO OPEN IN TERMINAL WINDOWS#The meta key is Alt by default, but depending on your connection client Alt may do something else (for instance, on Windows you may find pressing Alt has the default Windows behavior of selecting the current window's menus). You can then type in (with tab-complete) the filename you want and press enter: Find file: ~/cs107/assign1/reassemble.cĪll keyboard shortcuts in Emacs are initiated by pressing either the Ctrl key or the "meta" key, along with some others. Note that here I've cd'd into my ~/cs107/assign1 directory before opening emacs, so the path defaults to this. You will see a prompt at the bottom of the window (this little section is called the mini-buffer) that says Find file: ~/cs107/assign1/ If you started without a filename, or you want to open a new file use the keyboard shortcut Ctrl-x Ctrl-f. emacs -nwĪlternately, if you already know what file you want to edit, you can cd to the appropriate directory and pass the filename as a parameter to emacs as follows: emacs reassemble.c& If you prefer to work in a console, then you will want to add the -nw flag ("no window"), e.g. If you want to be able to continue using your terminal while using emacs, add an ampersand: emacs& Note that this locks up your console as long as emacs is open (the console is "busy" running emacs). This will open the windowed version if it is available (again, it might be disabled depending on which client you are using for your connection). The easiest way to launch the program is to simply type "emacs" and hit enter, which will look like the following: emacs Once you've decided which version you want to run, log in to your favorite cluster using whatever client you like. Further, if you use a non-windowing client like PuTTY, you have no choice but to use the text-based version. The emacs GUI has several features that make using emacs as a first-time user much easier, but if you're on a slow connection, it can be agonizingly laggy. Soon, you might feel that Notepad is the unwieldy one! Opening EmacsĮmacs has two versions: the GUI version which runs in a separate window and has buttons and menus for common functions, and the text-based version which runs in your console window. However, taking a bit of time to learn Emacs's unique shortcuts will make you much more efficient. In fact, you could survive decently well by using it just like Notepad, navigating the document with arrow keys and clicking buttons to save and load. Using Emacs is in many ways like using any text editor you are used to (such as Notepad on Windows), but with many unusual keyboard shortcuts. All it's missing is a decent text editor." As an old joke goes, "Emacs is an excellent operating system. In this document, we will only be talking about the basic text-editing functions, but people have written extensions to Emacs to, for example, allow it to send and receive email. What is Emacs? Why should I use it?Įmacs is a text editing program with a very wide and powerful set of features. If you're interested in another editor, some internet research will likely turn up useful resources. You'll find our staff is generally most familiar with the mainstream emacs or vim, but you're welcome to use any editor that gets the job done for you. Emacs has been good to us but there are other good Unix text editors (vim, pico, gedit, and more). This guide covers the basics of using emacs to edit files. Written by Sarah Spikes, updated by David Philipson ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |