VIM: The Linux Text Editor | Frank A | Skillshare

VIM: The Linux Text Editor

Frank A

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
7 Lessons (10m)
    • 1. Install VIM

      1:11
    • 2. The Cursor

      4:02
    • 3. Create and Save File

      1:31
    • 4. Deleting

      0:57
    • 5. Undo and redo

      0:27
    • 6. Copy and paste

      0:42
    • 7. Vim search

      1:01

About This Class

Vim 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. Why not to learn Vim? In this course you'll learn the basics!

Transcripts

1. Install VIM: installing theme fame is a text editor originally only for UNIX machines. It's often called the programmer's editor, or a system editor says that main editing because it's his futures that are very useful for this type of jobs. So you can work with files over networks. You can work in the terminal and so on. So despite its popularity among programmers and system administrators, it can be used as a text editor as well, so you don't have to be like a computer wizard to use it. No team has a steep learning curve, especially if you're used to editing text 1000 programs like Milk Batter works. It just Everything works differently, however. Urbanity the complexity on the steep learning curve. It's a very powerful text editor now famous, inspired by the older text It's or V I. So if you learn from, you can also use the older at its RV I. So the history of this editor goes back several decades, so you can use his editor on pretty much any system you can encounter. And even 10 years 20 years from now, the skills you learn by my learning fame will still be useful so they don't really expire 2. The Cursor: sex, etc. The first thing we'll do is tow start fame until exit it. Now this is a question that's actually been looked up on the Internet for over a 1,000,000 times. So it's a problem a lot of people struck with when they first use him. And the miss is pretty much existent within all of the traditional index servers and systems. And so the chances are you are you end up in him at some point when reading a man paid shore when editing some fellow or other situations in which for him just starts by default because that's how it's configured. Okay, so we first start them by typing vim Space fell named txt, where fell name can be anything so you can pick any text file. Then we find ourselves in the vim editor. Now, if you seen graphical editors before exiting them can be very strange. However, it's works just fine, So to exit for him, execute the steps. First, switch to normal, most by pressing the escape key. Then type colon que exclamation mark and then press enter. If we start Freemen's open its expel, we want to to move the cursor and normally in most of the modern text elders. We could use the arrow keys for that which also working for him. But if you use the ID, it won't work. And so there's an alternative method as well. And that works in Boats V. I and Theme, which sister used to Kiki's, H J, K and L, which are sequentially from left to right on the keyboard. Now, at a time when the the idea heart attacks at the V I first came out, there were no cursor keys at all. So this was in the seventies. On to this date, it's backwards compatible, and so you can still use those keys if you want to. So the key each case H and L moved the cursor left and right, and the Keys K and J. Moved. Cures are up and down, so practice around a little bit with death until it becomes comfortable. And some say this is actually faster than the arrow keys. However, I think this matter off preference. Now we'll write a text file, so we call it a new foul and rights and save it. So open the FIM text editor by typing theme space superhero dot txt Then we'll Presti insert Key, which changes defame editor to insert melt so we can simply type the text you want to type in here and just as you would normally do and you can use the cursor keys toe, move around for the keys. Hjk l. And once you're done typing, we can switch back to normal modes by pressing the escape key and then press colon w followed by the return key. So that will safety foul and, if it already existed, will override changes. Now, finally, we press escape Colon que enter quits. Now, if you want to reach a foul contents again, just type fame space superhero dot txt So that would open the detects center again. Finally, will the Litex. So to do so, open to them. Editor by typing themes based superhero dot txt, Move the cursor to the character you want to the leads, and then press the s key the X key to the leads, the unwanted character. Now repeat this until all the correction centre on and then you can safety foul by person Escape key writing Colon W exclamation Mark Preston Enter which will safety fell and then you want to quit for him? So you would say I have the escape key, followed by a colon que and return key. 3. Create and Save File: creating and saving a fell to create a new found with him. Start from using the command space felt I'm not 60 so we could pick, for example, in the murder of 60 to this all up on the film editor. We want to decide text presti Insert Key, which switches to insert mint. Then we can type whichever text we once and we can use the arrow keys to move around to text fell on Alternative method to move around, says using the keys HJK and now, but has to has to be done in normal mode. So if you press the escape key and Presti Keys HJK and now that will move the cursor as well. So depends on what you prefer. You use the traditional wages press in certain Tuesday Rocchi's so them has most, which is the insert multi normal modes, and now we're in the insert mode again. So to pro saver felt, switch to normal by pressing escape, and then I have colon double you press enter on the bottom off the screen and status bar. See a message showing the foul has been written. If you want to override the felt, you can use Kahlan W exclamation mark, and if you want to write and quit breast w Press Colon w Q. 4. Deleting: deleting, and then we can delete whole words. So opened ofhim editor again and then move the cursor to do what you want to delete. Switch to normal mode by pressing the Escape key movie courses around, using the J, K and L Keys on the Arrow keys and inside DW without a column and that will delete the He works under the cursor, and there's more delish interaction him. So did live to the end of the fell switch to normal modes and type D will our sign If you just want to delete the whole line, switch to normal modes. Christie Escape key for Type D D 5. Undo and redo: underwent Redux. You make a mistake. You can undo the action similar to other text editors. So to undo Christie Escape key and then Christie Yuki, if you want to redo under press control, are 6. Copy and paste: on the leave him also support Scorpion based rights. We can copy and basic text by doing these steps. Move to conform to the line. You want to copy Presti Escape key. Start visual by typing the wiki. Moved the cursor to the end of the line. Christie, Waikiki. Move the cursor to the new location and Presti peaky. So this will copy D. Text tried to copy a few words from a sentence or a whole sentence. Practice around with sequences until it comes natural. 7. Vim search: searching him is a search option. So the first thing to do is to open a foul once we have to file opens in him, moved to the top off the foul move toe twist to normal mode by pressing escape key and then press the geeky twice Who this double G. So this whole search from top to bottom. Now if we breast he escaped again inside the foreword slash followed by the words and press enter it will search. And so if we die, would cite the Buddha. So we type slash my Buddha enter It will search for the word Mahmoud I in the text. How so? To search for the next appearance. Just repeat the step and if you want to move from the bottom