1 00:00:00,000 --> 00:00:01,870 Hello folks. 2 00:00:02,049 --> 00:00:06,078 We have learned vi editor and now it's time to 3 00:00:06,104 --> 00:00:09,090 look at the difference between vi and vim editor. 4 00:00:10,370 --> 00:00:12,838 As far as the functionality is concerned, 5 00:00:12,934 --> 00:00:15,910 both editors work in the same manner. 6 00:00:16,090 --> 00:00:17,802 Which editor you choose is a 7 00:00:17,816 --> 00:00:19,726 matter of your personal choice. 8 00:00:19,918 --> 00:00:21,898 Some people recommend learning the vim 9 00:00:21,934 --> 00:00:24,550 editor instead of the vi editor. 10 00:00:24,730 --> 00:00:27,738 Now of course, due to its added feature, the learning and 11 00:00:27,764 --> 00:00:32,009 using vim editor is much easier than the vi editor. 12 00:00:32,509 --> 00:00:36,034 Now, if it is easier then why we were using vi 13 00:00:36,082 --> 00:00:39,582 in the first place. The reason we were using vi in 14 00:00:39,596 --> 00:00:43,638 the first place is because vi was the first one that 15 00:00:43,664 --> 00:00:47,350 was introduced when the Linux or Unix was born. 16 00:00:47,470 --> 00:00:54,062 Now, a lot of times you're going to find, supporting 17 00:00:54,086 --> 00:00:57,674 an operating system, maybe like an older version of operating 18 00:00:57,722 --> 00:01:02,938 system, maybe Solaris or AIS or HPUX, older Unix type 19 00:01:02,964 --> 00:01:06,382 of operating system, they're probably not going to have vim 20 00:01:06,516 --> 00:01:08,290 then you have to use vi. 21 00:01:08,610 --> 00:01:12,382 Now the difference, do I have to learn 22 00:01:12,516 --> 00:01:16,934 vim as completely new command or new tool? 23 00:01:17,102 --> 00:01:18,540 Absolutely not. 24 00:01:18,870 --> 00:01:22,006 If you have learned vi, then you have 25 00:01:22,068 --> 00:01:24,334 learned vim as well, but you probably not 26 00:01:24,372 --> 00:01:26,414 have learned it's enhanced feature. 27 00:01:26,582 --> 00:01:29,710 That is why it says that if you have learned vim first, 28 00:01:29,760 --> 00:01:32,698 which has a lot of new features, and then you go to 29 00:01:32,724 --> 00:01:35,830 vi, that means you don't have to go back to vi. 30 00:01:36,510 --> 00:01:40,174 All right, next one is since vim is based on 31 00:01:40,212 --> 00:01:43,150 the vi, so when you learn how to use vim 32 00:01:43,200 --> 00:01:46,622 editor, you will automatically learn how to use vi editor. 33 00:01:46,646 --> 00:01:47,626 It's just that simple. 34 00:01:47,688 --> 00:01:50,218 As I explained it earlier, vim has all 35 00:01:50,244 --> 00:01:53,890 the features as vi with some excellent addition. 36 00:01:54,390 --> 00:01:59,182 And there's also a comprehensive help system and a 37 00:01:59,196 --> 00:02:03,710 lot of customization options available in the vim editor. 38 00:02:03,890 --> 00:02:05,566 Now, let's look at the difference 39 00:02:05,628 --> 00:02:08,401 between vi and vim editor, 40 00:02:08,485 --> 00:02:09,705 the main difference. 41 00:02:09,888 --> 00:02:12,033 Now I got this picture which 42 00:02:12,072 --> 00:02:14,530 is very informative picture from online. 43 00:02:14,700 --> 00:02:17,530 So let's look at a few things 44 00:02:17,580 --> 00:02:19,680 that vi has to offer today. 45 00:02:20,310 --> 00:02:23,494 It is installed on a lot of places, it has 46 00:02:23,532 --> 00:02:26,242 a shorter name, and it is simpler to use. 47 00:02:26,436 --> 00:02:28,910 And the combined feature for vi 48 00:02:28,970 --> 00:02:30,490 and vim, let's look at them. 49 00:02:30,600 --> 00:02:34,510 Both are small, both are ubiquitous, meaning that 50 00:02:34,560 --> 00:02:37,114 both are available pretty much on a lot 51 00:02:37,152 --> 00:02:40,622 of operating system, intuitive command language. 52 00:02:40,766 --> 00:02:45,130 It has a learning curve and a powerful once you learn it. 53 00:02:45,240 --> 00:02:48,214 So one way or the other, whether you learn vi or 54 00:02:48,252 --> 00:02:51,598 vim, you will have the power once you learn it. 55 00:02:51,744 --> 00:02:55,202 Now, if you wanted to learn of vim, you're 56 00:02:55,226 --> 00:02:57,298 going to find a lot of new features that 57 00:02:57,324 --> 00:02:59,134 are listed on the right hand side. 58 00:02:59,232 --> 00:03:02,398 And one of them is the completion, which is that 59 00:03:02,424 --> 00:03:07,990 you can autocomplete your command or your word or 60 00:03:08,160 --> 00:03:10,718 as if you were typing in bash, you hit tab, 61 00:03:10,754 --> 00:03:13,474 it autocompletes, pretty much the same way. 62 00:03:13,572 --> 00:03:15,418 Then you have spell check. Beautiful. 63 00:03:15,504 --> 00:03:18,598 So if you are typing a word and 64 00:03:18,624 --> 00:03:20,700 you want to put in spell check, 65 00:03:21,270 --> 00:03:23,018 it is available now, in vi 66 00:03:23,054 --> 00:03:26,470 it was not available. But it's good, 67 00:03:26,580 --> 00:03:29,760 the spell check is there but I do not find 68 00:03:29,772 --> 00:03:31,890 [Author mumbling] 69 00:03:31,890 --> 00:03:35,220 like a strong reason to do a spell check. 70 00:03:35,790 --> 00:03:37,882 The reason because we do a 71 00:03:37,896 --> 00:03:41,326 lot of configuration file changes. 72 00:03:41,448 --> 00:03:43,258 So in configuration file a lot 73 00:03:43,284 --> 00:03:45,226 of words don't even make sense. 74 00:03:45,348 --> 00:03:47,602 But anyway, it's good to have a spell check 75 00:03:47,602 --> 00:03:54,464 whenever we are editing, comparison, merging, unicode, vimdiff, 76 00:03:54,464 --> 00:03:58,786 regular expression, scripting language, supports many different ones 77 00:03:58,908 --> 00:04:03,590 plugins, it has a GUI, folding, and a syntax 78 00:04:03,650 --> 00:04:06,938 highlighting, a lot of these new features. 79 00:04:07,034 --> 00:04:09,866 Now if I go into each one of them it's 80 00:04:09,878 --> 00:04:11,674 going to take me a lot longer but I want 81 00:04:11,712 --> 00:04:13,980 you to go ahead and explore it yourself. 82 00:04:15,030 --> 00:04:17,553 But what I could do here is I could 83 00:04:17,591 --> 00:04:19,966 give you some of the information that will help 84 00:04:20,028 --> 00:04:26,589 you to understand and learn vim editor, and all 85 00:04:26,640 --> 00:04:29,100 its new features that it has to offer. 86 00:04:29,970 --> 00:04:32,602 Let me give you the vim interactive learning tool. 87 00:04:32,676 --> 00:04:35,398 But of course you could go online and 88 00:04:35,424 --> 00:04:36,962 you could find a lot of tools. 89 00:04:36,986 --> 00:04:41,662 You type vim editor tutorials, you're going to find 90 00:04:41,736 --> 00:04:44,398 tons of resources, even people have written books on 91 00:04:44,424 --> 00:04:47,698 vim, and you're going to find even a single 92 00:04:47,784 --> 00:04:51,862 entire course, maybe 10-20 hours just on vim. 93 00:04:51,996 --> 00:04:53,986 So the more you want it to learn, 94 00:04:54,048 --> 00:04:55,414 the more you want to dig in, 95 00:04:55,512 --> 00:04:56,758 it's pretty much the same. 96 00:04:56,844 --> 00:04:59,494 As I said, I would always recommend that you 97 00:04:59,532 --> 00:05:04,946 use a basic way of using vim or vi. 98 00:05:05,018 --> 00:05:07,690 So let's get into those tools. 99 00:05:08,010 --> 00:05:11,414 There are many websites that offer free vim interactive 100 00:05:11,462 --> 00:05:14,698 training, and these websites are of course they 101 00:05:14,724 --> 00:05:16,714 are free and people have done an amazing 102 00:05:16,812 --> 00:05:21,110 job when they actually have built those interactive 103 00:05:21,170 --> 00:05:24,780 tools for people to actually learn that. 104 00:05:25,170 --> 00:05:33,120 Now one of my favorite is the www.openvim.com. 105 00:05:33,710 --> 00:05:39,134 This website has an interactive tool which helps you learn vim 106 00:05:39,182 --> 00:05:43,318 or vi editor a lot faster, and I would definitely recommend you 107 00:05:43,344 --> 00:05:46,846 to please go ahead and try it out and you're going 108 00:05:46,848 --> 00:05:52,594 to find it a lot easier than actually going through a 109 00:05:52,632 --> 00:05:56,340 document or going through a tutorial or a video. 110 00:05:57,510 --> 00:06:01,918 Next one is a vimgenius.com, which also is a 111 00:06:01,944 --> 00:06:04,462 good interactive tool that you can learn from. 112 00:06:04,536 --> 00:06:09,094 And the last one is vim-adventures.com, which actually 113 00:06:09,192 --> 00:06:12,610 teaches you the vim editor through the game. 114 00:06:12,660 --> 00:06:14,998 So if you're into games, you could play games as 115 00:06:15,024 --> 00:06:17,580 well as you could learn vim editor as well. 116 00:06:17,910 --> 00:06:20,470 So let me go into the openvim first, 117 00:06:20,580 --> 00:06:22,666 so I could show you how it works. 118 00:06:22,848 --> 00:06:25,414 So go to the browser and right 119 00:06:25,452 --> 00:06:28,022 here I have openvim already entered. 120 00:06:28,046 --> 00:06:30,418 I'm just going to refresh it, and 121 00:06:30,444 --> 00:06:32,618 it's going to start the introduction. 122 00:06:32,714 --> 00:06:35,786 And you see on top this is the interactive 123 00:06:35,978 --> 00:06:38,774 screen for you and the bottom is the keyboard. 124 00:06:38,882 --> 00:06:43,690 It's going to prompt you to enter the highlighted keys and 125 00:06:43,740 --> 00:06:46,882 it's going to ask you to type it on the screen. 126 00:06:47,076 --> 00:06:49,402 So let me read it the first time you're going to log in. 127 00:06:49,416 --> 00:06:51,974 It's going to say, Hello. I am an interactive Vim tutorial. 128 00:06:52,022 --> 00:06:55,910 I'll teach you what Vim is about without hassle. 129 00:06:56,030 --> 00:06:57,926 Perfect. Nobody wants Hassle. 130 00:06:58,058 --> 00:07:01,462 If you are in a hurry, press any key to fast forward. 131 00:07:01,536 --> 00:07:03,190 What it means is if you want to go 132 00:07:03,240 --> 00:07:08,458 directly into these different lectures or interactive sessions, then 133 00:07:08,484 --> 00:07:14,386 you could just hit the spacebar, sorry any key to fast forward. 134 00:07:14,508 --> 00:07:16,954 But I would not recommend it, you go through it. 135 00:07:16,992 --> 00:07:20,422 Just spend some time and believe me, it's not 136 00:07:20,436 --> 00:07:22,774 going to take you longer to go through the 137 00:07:22,812 --> 00:07:27,362 first introduction section. To practice what you've learned, 138 00:07:27,386 --> 00:07:28,774 try out practice page. 139 00:07:28,872 --> 00:07:31,718 It has context sensitive reference for commands. 140 00:07:31,814 --> 00:07:34,630 Now, let me introduce you to the basic of Vim. 141 00:07:35,130 --> 00:07:39,274 Now see it's highlighting or blinking the enter key. 142 00:07:39,312 --> 00:07:42,480 So what it's asking you to do is hit enter. 143 00:07:42,990 --> 00:07:45,770 Once you hit enter, it says, Vim has two basic mode. 144 00:07:45,830 --> 00:07:48,622 One is insert mode, in which you write text 145 00:07:48,756 --> 00:07:53,362 as if in normal text editor, excuse me. 146 00:07:53,436 --> 00:07:55,738 And, Another is normal mode which provides you 147 00:07:55,764 --> 00:07:57,754 efficient way to navigate and manipulate text. 148 00:07:57,792 --> 00:08:01,714 So we already know that you type i to get 149 00:08:01,752 --> 00:08:04,366 into the interactive mode or where you type it in 150 00:08:04,428 --> 00:08:07,102 and you hit Escape to get out of that. 151 00:08:07,176 --> 00:08:09,274 So now the fifth line says, Let's try 152 00:08:09,312 --> 00:08:11,282 it out! First, change to insert mode. 153 00:08:11,306 --> 00:08:12,946 So it's asking me to hit i. 154 00:08:13,068 --> 00:08:16,270 Go ahead on i on your keyboard. Good, 155 00:08:16,380 --> 00:08:17,858 now your're in insert mode. 156 00:08:17,894 --> 00:08:20,462 Write something and change back to normal mode. 157 00:08:20,606 --> 00:08:22,620 Okay, hello. 158 00:08:23,130 --> 00:08:27,026 And I wrote that and then I'm going to hit Escape. 159 00:08:27,158 --> 00:08:29,518 Good. Let's move on to another section. Beautiful. 160 00:08:29,604 --> 00:08:30,720 Let's hit enter. 161 00:08:31,290 --> 00:08:37,150 In contrast to regular text editor, you use keys H, J, K, 162 00:08:37,590 --> 00:08:40,510 and L, instead of arrow keys to move cursor. 163 00:08:40,830 --> 00:08:44,254 As I explained that earlier as well, try not 164 00:08:44,292 --> 00:08:48,730 to use the left, up, down, and right keys. 165 00:08:49,230 --> 00:08:52,474 I would suggest and definitely strongly recommend that you 166 00:08:52,511 --> 00:08:56,350 use H, J, K, L keys to navigate left to right. 167 00:08:56,460 --> 00:08:59,926 So basically here it's actually teaching you 168 00:09:00,048 --> 00:09:03,002 how you could use these interactive keys. 169 00:09:03,146 --> 00:09:05,398 Again, as you could see, we are 170 00:09:05,424 --> 00:09:08,606 already on the third interactive session. 171 00:09:08,738 --> 00:09:11,558 All you have to do is go to up to 19. 172 00:09:11,654 --> 00:09:14,482 The last one is the 20th and try that out. 173 00:09:14,496 --> 00:09:16,562 It's not going to take you longer and you're 174 00:09:16,586 --> 00:09:18,958 going to find it so easy to learn a 175 00:09:18,984 --> 00:09:22,810 vim editor right here on this interactive tool. 176 00:09:22,920 --> 00:09:26,990 The second one I explained to you is the vimgenius. 177 00:09:27,110 --> 00:09:32,482 So if you go to vimgenius.com, and it's going 178 00:09:32,496 --> 00:09:34,450 to say become a Vim Genius, click Start 179 00:09:34,500 --> 00:09:36,314 Now, I'm a beginner. 180 00:09:36,362 --> 00:09:37,562 I'm experienced. 181 00:09:37,706 --> 00:09:40,570 If you are a beginner, pick the first one or 182 00:09:40,620 --> 00:09:43,306 the second one if you have some experience already. 183 00:09:43,488 --> 00:09:48,218 Now, before you start, this is what it's telling 184 00:09:48,254 --> 00:09:51,734 you about the main keys in the vi vim editors. 185 00:09:51,782 --> 00:09:53,700 So go ahead and Start Level 1. 186 00:09:54,390 --> 00:09:57,910 And now it says Move cursor to left, look at this 187 00:09:57,960 --> 00:10:00,694 top. Left is the H key. 188 00:10:00,732 --> 00:10:04,630 So when I do H, it says h is correct! 189 00:10:04,800 --> 00:10:08,580 Press Enter or click Next to continue. 190 00:10:09,570 --> 00:10:12,298 Insert at beginning of line. 191 00:10:12,444 --> 00:10:14,938 So insert at the beginning of line is 192 00:10:15,024 --> 00:10:19,320 i or is it i or o, 193 00:10:19,830 --> 00:10:25,661 so I think. Append the cursor so, 194 00:10:26,916 --> 00:10:28,102 so it's giving me the next line. 195 00:10:28,176 --> 00:10:29,746 Anyway, I was thinking i, hit enter, 196 00:10:29,808 --> 00:10:32,290 so Append at cursor is usually a. 197 00:10:32,400 --> 00:10:34,990 So hit a, and it says a is correct! 198 00:10:35,160 --> 00:10:39,730 Press Enter or click Next. Append at end of line. 199 00:10:39,780 --> 00:10:43,142 So it's going to keep asking you these questions and you're 200 00:10:43,166 --> 00:10:45,578 going to have to press the keys on your keyboard. 201 00:10:45,734 --> 00:10:48,454 And the third one, as I said, I've never used it. 202 00:10:48,492 --> 00:10:51,346 It's actually, Learning VIM while playing a game. 203 00:10:51,408 --> 00:10:53,794 So you could actually say press any key. 204 00:10:53,892 --> 00:10:56,878 So I'm going to hit enter and it's going to say 205 00:10:57,024 --> 00:11:02,722 h, k, l, j as my navigating keys up, left, right, and bottom. 206 00:11:02,796 --> 00:11:04,860 And you could go left, right, bottom. 207 00:11:05,190 --> 00:11:06,970 This is your cursor and you could 208 00:11:07,020 --> 00:11:09,382 learn as you go through it. 209 00:11:09,576 --> 00:11:10,714 So I never use it. 210 00:11:10,752 --> 00:11:12,262 Try it out and if you like it, let 211 00:11:12,276 --> 00:11:14,950 me know and provide your feedback on that. 212 00:11:15,120 --> 00:11:18,622 Anyway, this is all about 213 00:11:18,756 --> 00:11:20,940 the vim interactive learning tool. 214 00:11:20,940 --> 00:11:26,590 I hope you find this lecture valuable and you could 215 00:11:26,640 --> 00:11:30,110 use these open free tools online to learn vim. 216 00:11:30,170 --> 00:11:32,998 If you have any questions, I'm always here, ask me. 217 00:11:33,144 --> 00:11:34,114 Send me a message. 218 00:11:34,212 --> 00:11:37,258 Send me a message on Udemy, or send me an email. 219 00:11:37,344 --> 00:11:38,295 Thank you and good luck. 220 00:11:38,295 --> 00:11:39,541 [No audio]