Emacs Course - Linux | Frank A | Skillshare

Emacs Course - Linux

Frank A

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
11 Lessons (30m)
    • 1. What is Emacs?

      0:51
    • 2. Install

      0:45
    • 3. Cursor tricks

      3:43
    • 4. Themes

      3:58
    • 5. Emacs windows

      3:43
    • 6. Resize windows

      2:58
    • 7. Files

      2:09
    • 8. Search

      2:59
    • 9. Macro

      4:11
    • 10. Advanced Navigation

      3:10
    • 11. Multiple Cursors

      1:59

About This Class

Emacs will help you become a more effective programmer or sysadmin. 

It's a very powerful tool that works in both the graphical and terminal environment, meaning you can login to any computer in the world over ssh and use it.

With over 1300 extensions, working on any platform, anywhere in the world, why not to learn Emacs?

Once you learn it, it will change your life forever.

In this course you'll learn the basics and get pro tips!

Transcripts

1. What is Emacs?: Texas, famously known as being a text editor. But it's much more than that. Sometimes he mixes, compared to which hitters like fame, sublime text and other attacks senators. But that's neglecting the complete ecosystem that's included with Pemex. So he mixes an entire ecosystem with silver packages. It has a terminal, a project planner, mail reader, news reader, calendar, a Web browser, file manager and countless of other software. So sometimes he makes this joke on me referred to as a full desktop environments with a text editor. So unlike and most ex editors that you might be used to mix can be fully controlled with keyboards. So once you learn Imex, you don't have to use the mouse, and you can fully concentrate on typing. However, if you want to use the mouse, you can, of course. 2. Install: so to install a mix of Windows or Mac just visits geno dot orc slash software slash mx and you can download t execute herbal from there now to install it on the debian or mental system. Just open a terminal and rights pseudo space ape T dash gets spit space installed remix and that will install he makes for you. So if you use another Lennix environment you can use for example, if used by Gero, you can use Jowers minus as MX and so on. So that just depends on your system. So I don't get the execute herbal from the website or get it using your package manager if you're on Olynyk system. 3. Cursor tricks: in this lecture will go into moving Dickerson. So whenever you want to edit text, you have toe move the cursor some point, and so starts Cemex by typing Imex. Space story dot txt An empress return or enter key. One started press. The key combination comes from one. So that's the consecration. The one key. This will put text window into full screen. Now you can simply start typing text. Now I know that this is not enough. It's one but the one above the quarter. He's so he makes supports two methods to move the cursor, and the first and most obvious method is to use the arrow keys. And so, just as no pet or another type of editor, you can use the Iraqis to move around. Decks film. Now we can use the arrow keys to move character. My character. But we can also move word by words, and we do that by holding the control key and then using the arrow keys. So if you hold a concert keys and press on the Iraqis, you'll see it moves word by words instead off character. My character. Now there's an alternative method to move the cursor keys without using the arrow keys. And this is by using the combinations. Control P control and control F and control be where they are short for previous next forwards backwards. So if you hold the control key and press B and F or B, it will also move to Carson. So Control P will move to the previous line control and were moved to the next line and likewise control efforts. Forwards control be moves backwards. Now if you prefer using the arrow keys, you can just do that. It works just fine and otherwise you can use these combination of keys. Now we can also jump the cursor to the next wards but by using key combinations. And so if you hold the bulky and press f toe, a move to the next words. And if you want to move to the previous key, you healthy all key impressed it Beaky. So notice that this is FNB against so forward backwards. Just as we would use the control offense control be keys. Now to move the cursor to the beginning off the line, we can type the control key and the A key, so this will jump to the beginning off the line immediately and likewise we can jump to the end of the line my holding the control key and pressing the e key to try all of these commands and breakfast around. Now, if you just want to enter text, you can use type. So all of the characters are certain justice. You type them when you want to. Safety fell breast. He control key, followed by X and then Presti Control key, followed by us. So that's well, safety fell. So that's Ah, double combination control. Ex cons Voice. It will save your fell if you want to. The leads you can move. Um, and the character you you can move to the character you want to the leads and impressing only del key to quit Imex type the key combination control X, followed by control. See 4. Themes: he makes tips. In this lecture, you learn how to customise Cemex how to change the look and feel my defaults. The graphical version of a mix has white colors, a tow bar, a menu bar and the welcome screen that takes about half of the screen. So the first thing we'll do is to get rid of this welcome screen. Well open fl called Dot Pemex, which is inside your home directory, so it's a hidden fell. You can find it. So it's my typing dot mx. So if you ever on the linens computer, that senor slash home slash user name slash he makes his don't mix and on the making a Windows computer there in a D for difference directory. But the fellas don't mix so open that fell, and that's a bottom off the foul at this line. Then safety fell and restart Pemex. So now it'll start without the pop up window. We can also hide toolbar in the graphical remix, so that's the bottom with all these little buttons. She opened the door. He makes fell again and at line Tobar moat minus one. Now safety foul and restart E mix. You'll see a Mac starts without the toolbar, and we'd have to pop up, made out the welcome screen as well, so we can also hides the menu of our If you want to do this, opened a theme. Expel inside your home directory and at a life line menu bar moats minus one. Now restart. Mix again and you'll see we just starting next. It's just a text window. Now. You might want to keep the menu bar because it has all kind of options. So when you're just starting out, it's quite useful. And if you want Soto and do change this, you just open the dotty makes fell again and remove any of the those lines. So if you remove, for example, the line we just added to the menu bar will appear again now to set the default team opened the dotty makes fell and ETA line Low Team and then your team name. So, like this, then restart. He makes. Now there are quite a bunch off default teams and depending on what you like, however, there are also teams dead's. You can extort install from external sources, so if you want, for example, a team that looks like sublime or another editor so you can get it by opening the terminal and typing. Uh, these lines then opened dot mx fell and enter line had to list custom team low parts, and then your parts of their teams should just download it. Now restart the mix. You'll see nothing has changed so far. Presti off Key and the X Key and type low team. So now we type the name off any of the teams from this website or any of the teams we just downloaded. So I'll type Sportske and it tore loads. I do this a different team, so press yes, a few times now. Once we restart, he makes the team is not there. So to set it permanently open your dot mx fell and at the line a low team space and in your team name. So in this case, low team Sapolsky Space T and some then real XRT Max and You'll CD team has changed 5. Emacs windows: he makes windows. He makes supports. Windows. A window is simply a view that can show text. Now the best example is just to show you. So let's start a mix and split Cemex into two results of windows so we can do that by pressing the control key. And the X key, followed by the three key now in making mix will be split into two. Now it's not the number taquitos de tree on the top off your keyboard. So that's Kancil Ex, followed by the Triki. Now you'll see the, uh to the windows, and we can switch between these windows by pressing the keys. Control X, followed by the okey. So that's the key Combination Control X, followed by the okey Awesome. If you just want one window. Presti control key with the X key, followed by the one key. So now you'll just see one window to split. We can also split Imax into vertical windows so we can do that by pressing the control key and the X key together, followed by the two key. And again we can switch between windows. You're seeing the key combination Control X, followed by the okey to switch back to one window. Presti control Key Press Control Key with the one key. Now we can also combine these so say we split the screen into horsing soul and vertical. So type control X, followed by the two key. And we switched to the other window by oppressing the control key with the X key, followed by the okey then Presti Control X combination, followed by the tricky. Now we press again the control X, followed by the okey, and we can repeat this process until we have to buy two windows or even more. So you can really use a lot of windows in just one screen. Wow, If you want to splits, I can proceed. Control X key. Follow body three. Key on If you just want to close all these windows wrested Control X key, followed by the one key Now he makes can do much more than traditional text editors. So sometimes he makes his jokingly refer to as a desktop because you can even play Tetris in its anyway. Let's go on if you have to Windows, we can use one or two windows for the purpose off text editing and the other say a terminal , so I start mixing Presti Control X keys, followed by the tricky then press control X and the okey. And now type Christie bulky with the X key together inside term and press enter twice. So now you'll have a terminal on the right side and on the left side you'll see text file. If you want to split between these windows, you can do so by pressing the cultural X key with the okey. If you're in the text fell and from the terminal press the Cultural Seiki, followed by the okey wow! 6. Resize windows: re sizing windows. In this lecture, you learn about re sizing windows. First, we'll show you to stand out way to resize windows and then look, if you're trick, that will make re sizing windows much easier. So we already know how to create windows from the previous lecture used to keys Combination Cultural X and which Tookie or control X with three key. And we have not yet seen how to resize windows. So start E max. If you haven't and open a fell by using the key combination Cultural X, followed by Khan's wife, and then just type your fell name or select your family. We can split the window using the control X key with the Triki, and now we can shrink a window using the combination control X, followed by a left breast. So if you repeat this, you'll see the selectors window shrink. So in order to resize, we just have to repeat the key combination again and again. If you want to make a window larger, used to key combination control X, followed by the right embrace key, and you can alter between these windows using the key combination Control X, pretty okey and If you want to make them the same height again, press to control X key combination, followed by the plus key. And finally, if you want to close the window, you know press control X with zero key. Great. So then we split window into using the control X key with two key hands. We can also make it larger or smaller. So Presti control X key with tea up key to enlarge the window and to make to balance the windows again. Presti control XQ 20 plus key. Now, to repeat this key combination over and over, it can get very tiring. We just want to hold a key and press the arrow keys so we'll show you just how to do that. Open the dot mx fell my typing Kancil ex control f and then browse to your Dottie makes fell and at these lines, Then restart Cemex and split window again. You're seeing control X with two or the tricky and now you can just resize the window by holding the control key and using one off the aero piece. Wow, it's much easier now. Say you used the control key with the key who make the window. Smaller contra acuity down, key making bigger. And likewise we have the left and right keys combined with the control key to make it to resized him. 7. Files: navigation and fouls too. Great. A new fell startup. Pemex and Presti control X key combination followed by contra f Then on the bottom of the screen, so called Mini buffer. I would ask you to accept the foul name so you'll see Foul, Colon and so on Appears in the media buffer. So at the bottom of the screen. And so pure fell name, huh? So whatever fell you want to create, let's say he makes it optics t and press the enter key or to return key. You see the new fouls creative, and we can start adding new texts so we can write our documents and safety fell using the key combination control. X control s now any mix we can open many thous and many fells could be open. So to see the open fells pressed a key combination control X followed by control. Be so we'll see a window with all the open files. Yeah, you can just switch between these fouls. So if we open another fell, you sing control X control f great. A new fell and then open the list using control X control be We'll see. We can just switch between these until house so press contracts and the okey to switch window and the arrow keys or move the cursor to the value ones open and just press enter. We can browse a directory. So inside Team Express, off key with the X key and then at the bottom of the screen in the meaning buffer type dear . It's and press answer Now you can just brushed the fell. You want to open and press enter to open it. So you have a foul manager insight he makes wow! 8. Search: search church ing. Any max is pretty basics. So open attacks fell or a coat foul with Pemex by using the control X cultural f key combination. Then search for text using the key combination. Control s so in the mini buffer at the bottom of the screen, you can stop your search, Mort. So type whatever you want to search for and you'll see the search. Words is instantly highlighted. You can repeat this combination control as contrast to jump to the next words or to jump in reverse Order used the key combination Control are so control s is forwards and control arms backwards. Amazing search and replace. We can replace the word by a new words. So insides the text fell, Presti All key combined with the percent of shine. So at the bottom, off the screen in the meaning buffer you'll see the message query Replace type the word she want to replace and breast cancer. Then it will show you the message Query. Replace with stop your new name and then lt Jim toe every appearance of the worst and ask you if you want to replace it. So if you want to replace Presti y key. Otherwise, proceed. No key to skip it. And finally, you want to save your foul. So process culture ex cons Voice. Now you can do even more off fund search so you can search in multiple CFL's at once. This is especially useful when you're coding on something and you want to look for where certain objects or specific words appears, so to do so to search in multiple 1000. Once Presti Off Key and the X Key, and then press our crop grip and press enter, you see that sex search for this in the mini buffer type the word you want to search for and then type type of fouls you want to search in. So this could be startled. Txt. Or, if you work with gold, you have start out CPP. You startled by your startup beach, be or whatever. In our case, just type startle, txt and press enter. Then it asks you directory to search in, so specify where you want to search for this and then press enter. You'll see he makes it split into two windows, and the results are at the bottom. We can go to the results screen my typing the keys control X followed by the okey in and move the cursor down to see all the house, the viewer foul. Just move the cursor on top off it and press answer. 9. Macro: he makes support. Keep what macros. The sequence of keystrokes is named the macro, so the sequence of ski strove can be replayed. Wow. So imagine this is like you press a button and the computer starts typing something for you . So to define a keyboard macro Presti f tricky to start recording. From then on, all your keystrokes will be recorded. So let's start with a list of products after the defining the products press TF tricky. And this will start recording and then move to changed, uh, the lie and moved to the end off the line by pressing the control key with Tiki and Presti , right key and impressed. He have four key to stop recording. Now we can press the A four key several times, and for every line, these macro will be applied. So this works for CO two. If you haven't make a weapon, which in se html keyboard macros will help you. Let's say we create a list which is always written in the coat you well currently or ally. So we start like with a few lines of text, and then we Presti have tricky and we surround the in line with the tax ally. Then we moved to the end off the line with the call Turkey and Easy Christie right sparrow and then pressed E F four key to anti recording. Now keep pressing the A four key and you'll see all of them. Oh, are updated with the keystrokes. That's it. Now these macros also support counters. That means the number will increase in the macro. Suppress TF Tricky. It's a mix. And then President keys, cultural X control. Okay, contro I press enter then press TF working and you'll see the lines will appear again and again with an increased number. Now, these macros only exists in the current session. So if you re starting next, these macros are gone. However, macros can be saved, so start recording. Utf tricky type your keys and once finished Presti at four key Inside the key combinations Control X control. OK, and the Yankee outside the name off your macro and press enter so you'll see the macro. And you can reload this macro by using the combination. Old ex, write your name and press enter. So again, it's used several micros at once, but still it only works during the session, so we gave it names, but he makes Doesn't remember. So let's make a mix. Remember Presti Old xq followed by Insert cabled a micro and press answer. Type your name. Then you'll see a lot of coats appear on the screen List codes. So copied this coat and put it in your dot mx fell so you can do that by pressing control. X tree open new window Kancil Ex contra go to switch The window comes from ex Contra F to open different index fell and then for X control. Oh, press control space to select the text and press out W to copy Breast Contour X concert hall to switch duty on the window and then press control. Why finally press control? Ex con tries to safe So now we put its macro inside he makes restart a mix. And now, once you re started to express all Texan type of micro name and press enter, you'll see all of the keystrokes appeared 10. Advanced Navigation: advanced navigation. So we already know a quick way to roast directory is using the directs commands. So if you press all ex side pirates and press enter, who can browse your foul system so either press enter to open a foul rescued to counsel? We can, however, do more advanced things like tree view, using its review or jumping towards. So IMAX supports that review using a plug in called Neil Tree so open a termino means like this. Then open your dot mx fell. And at these lines, now be sure to change your low parts to the part where you don't know that neo tree, then restart Imex. And if you press, he have eight key that will open it. Review so you can just prowess your foul system with just review. So this plug in Works boat in the graphical Imex and the terminal version, and we can also jump to works. So this is, like, pretty cool. Were you going to jumped toe awards just by typing the first letter? So install a plug in called ace Jump Moz, open a terminal and type this line. Then open your doors Imex fell and at these lines and, of course, change the load parts to part where you downloaded this plug in restart Imex and the open FL can open any text file. You seem contracts, control F and select your foul and presenter. No, we can jump directly to awards so press control see followed by space and you'll see a few letters on the screen in rats, and the rest is great so tightly. First character off the words you want to navigate to, and then you'll see all these letters off the screen. So by pressing a letter, you know instantly jumped to that word. So you're skinny quickly moved a cursor around the screen. So there's a console see, followed by space inside the first letter of the world you'll see in your options and then Presti character to jump to death words. Now another very cool plug in these cults. I don't vote, and this one makes opening 1000 very easy. It's installed by default, but not enabled by default. So if you just want to try it out, Chris felt X inside Eido dash moats in. Press enter. Now, if you're Presti, the keys control ex contra F to open a fell. You can just browse the fellow with the arrow keys. Now it'll directly show the fowls, and you can use your arrow keys to to load it. And so, if you want to enable this by default, open your doctor, Pemex fouls. And at these lines 11. Multiple Cursors: multiple coursers. He makes imports multiple curses using a plug in called multiple questions. Now, to install this, open a terminal inside this line, we also need a coat fell to to work with just for this lecture. So also at this line or any goat fell, then open your dot mx fell and at these lines and off course replaced the part with the proud to your Blufgan. And we'll also add some keyboard shortcuts because they're not added by default. So at this, then restart Pemex. Open the foul by using the keys, control X control F and move the cursor on the um when the foul you want to open and then move your cursor on. Where do you want to change so any words in the coat and then press control space and move your cursor right to select the works. Press control Right arrow to start selecting multiple. So now you can add it multiple at once. Press control G to de select. Now there's another thing we can do. So let's say we scroll down to where it says menu bar and go to the world press control space and the right key to select it, then press control C and then council smaller control smaller than symbol. So that's control. C control smaller than. And this will select all off the appearances off this variable. And we can just type the new name Press control G tow, anti editing. So that's how we use multiple curse stores in the mix.