1
00:00:00,000 --> 00:00:01,350
A text editor is an application

2
00:00:01,350 --> 00:00:04,110
that enables you to view, create, or modify

3
00:00:04,110 --> 00:00:06,390
the contents of text files.

4
00:00:06,390 --> 00:00:08,790
Text editors were originally created to write programs

5
00:00:08,790 --> 00:00:11,730
in source code, but are now used to edit a wide variety

6
00:00:11,730 --> 00:00:13,392
of text based files.

7
00:00:13,392 --> 00:00:16,500
Previously, in examples we used Vim mostly,

8
00:00:16,500 --> 00:00:19,500
sometimes Nano, G edit is another option

9
00:00:19,500 --> 00:00:21,300
but we're going to go into depth

10
00:00:21,300 --> 00:00:23,331
about all the different commands that you can use

11
00:00:23,331 --> 00:00:25,593
while performing tasks with these editors.

12
00:00:26,820 --> 00:00:29,250
So the first one I'm going to check out is the Vim.

13
00:00:29,250 --> 00:00:33,480
Now, if you don't have a file named this already

14
00:00:33,480 --> 00:00:35,543
it's going to automatically create it for you.

15
00:00:37,860 --> 00:00:40,410
Now, when you first enter into the Vim

16
00:00:40,410 --> 00:00:42,540
you're going to be in command mode.

17
00:00:42,540 --> 00:00:47,540
Now there's two modes, execute mode and insert mode.

18
00:00:47,880 --> 00:00:50,673
To get to insert mode, you simply press the I key.

19
00:00:52,260 --> 00:00:54,180
Press escape to get out of there.

20
00:00:54,180 --> 00:00:56,040
And to get into the execute mode,

21
00:00:56,040 --> 00:00:58,170
you're going to hit the colon.

22
00:00:58,170 --> 00:00:59,910
And this allows you to do multiple commands,

23
00:00:59,910 --> 00:01:03,213
like right, quit and different save functions.

24
00:01:04,860 --> 00:01:07,830
So, first thing we need to do is insert.

25
00:01:07,830 --> 00:01:10,773
We want to create a software listing for this example.

26
00:01:11,790 --> 00:01:15,000
We're going to simply use this as any other editor.

27
00:01:15,000 --> 00:01:18,987
Your going to put in a few names of some softwares.

28
00:01:33,928 --> 00:01:34,950
Okay.

29
00:01:34,950 --> 00:01:37,380
Now, to escape out of the insert mode where

30
00:01:37,380 --> 00:01:39,483
you're going to simply use the escape key.

31
00:01:40,781 --> 00:01:43,320
And again, we're going to go to the execute mode,

32
00:01:43,320 --> 00:01:45,120
so there's going to be a colon.

33
00:01:45,120 --> 00:01:46,210
We're going to do, right

34
00:01:47,100 --> 00:01:49,750
which saves the file and quit out of the application.

35
00:01:51,450 --> 00:01:52,283
Okay.

36
00:01:52,283 --> 00:01:54,420
Now, if we want to view this, we can simply go to cat

37
00:01:54,420 --> 00:01:56,820
and we're going to make sure we use this tab command

38
00:01:56,820 --> 00:02:00,150
make sure were using that as much as possible to save time.

39
00:02:00,150 --> 00:02:02,340
All right, and we can see that we have the

40
00:02:02,340 --> 00:02:04,710
text successfully saved there.

41
00:02:04,710 --> 00:02:08,310
Next we're going to do is work on editing and actual text.

42
00:02:08,310 --> 00:02:10,410
So I created a software listing earlier,

43
00:02:10,410 --> 00:02:11,860
and so we're going to copy this.

44
00:02:13,200 --> 00:02:17,010
So the dash A just means recursively, make sure we

45
00:02:17,010 --> 00:02:20,193
using our tab as much as possible.

46
00:02:21,180 --> 00:02:22,260
So we're going to copy it.

47
00:02:22,260 --> 00:02:23,093
That's the source.

48
00:02:23,093 --> 00:02:25,293
The designation is going to be our home directory.

49
00:02:26,520 --> 00:02:27,353
All right.

50
00:02:27,353 --> 00:02:28,186
So we're going to list it out.

51
00:02:28,186 --> 00:02:30,670
We're going to see that there, we're going to see the new

52
00:02:33,497 --> 00:02:35,610
information that was input there.

53
00:02:35,610 --> 00:02:38,130
Now, if you look at this text, we see there's a few errors

54
00:02:38,130 --> 00:02:40,170
here with the spelling.

55
00:02:40,170 --> 00:02:42,630
This is going to be a good time to use the keys

56
00:02:42,630 --> 00:02:45,720
and the shortcuts in the Vim editor to just to

57
00:02:45,720 --> 00:02:46,770
see how they operate.

58
00:02:47,760 --> 00:02:49,143
So we're going to open it up.

59
00:02:51,379 --> 00:02:53,610
Just going to simply use the X key.

60
00:02:53,610 --> 00:02:56,460
So I'm going to remove this I from here,

61
00:02:56,460 --> 00:02:59,370
and I'm going to put it after the F.

62
00:02:59,370 --> 00:03:01,323
And we're use the P, which is paste.

63
00:03:05,520 --> 00:03:06,670
Need to say that again.

64
00:03:07,566 --> 00:03:08,853
Put it back here.

65
00:03:13,410 --> 00:03:14,243
So cut,

66
00:03:15,780 --> 00:03:16,613
paste,

67
00:03:18,000 --> 00:03:19,530
cut,

68
00:03:19,530 --> 00:03:20,363
paste.

69
00:03:20,363 --> 00:03:21,196
So it's always going to put it

70
00:03:21,196 --> 00:03:23,640
after the letter that's selected with the cursor.

71
00:03:23,640 --> 00:03:25,950
Next thing we're going to do is actually use example to search

72
00:03:25,950 --> 00:03:26,880
for other texts.

73
00:03:26,880 --> 00:03:31,650
So we're going to look for that mistake again and here.

74
00:03:31,650 --> 00:03:33,750
We'll see it highlights it for us.

75
00:03:33,750 --> 00:03:35,400
Also to use this search function,

76
00:03:35,400 --> 00:03:38,430
we're just going to use the forward slash for this.

77
00:03:38,430 --> 00:03:41,410
And now we're going to use the K key to go up

78
00:03:42,780 --> 00:03:44,463
and the J go down.

79
00:03:45,600 --> 00:03:47,340
Just other keys that we can use.

80
00:03:47,340 --> 00:03:49,080
Just testing those out.

81
00:03:49,080 --> 00:03:50,580
We're going to do the same thing.

82
00:03:51,600 --> 00:03:52,563
I'm going to cut this.

83
00:03:54,180 --> 00:03:55,890
I'm going to paste it here

84
00:03:55,890 --> 00:03:57,240
to make a quick correction.

85
00:03:58,590 --> 00:03:59,690
And since you have the

86
00:04:02,670 --> 00:04:06,270
versions already in the separate column, we can delete this.

87
00:04:06,270 --> 00:04:07,120
Let's delete key.

88
00:04:09,270 --> 00:04:11,100
So you don't have to be in insert mode again

89
00:04:11,100 --> 00:04:15,750
to actually delete and cut and paste different things.

90
00:04:15,750 --> 00:04:17,973
So that's a good function of this.

91
00:04:18,923 --> 00:04:20,190
So we can go through here

92
00:04:20,190 --> 00:04:23,763
do a few more edits, delete the red hat.

93
00:04:24,990 --> 00:04:27,090
Now, if you want to go to the beginning of a line

94
00:04:27,090 --> 00:04:30,600
you could use the shift six, the carrot symbol

95
00:04:30,600 --> 00:04:32,310
and to quickly delete a line

96
00:04:32,310 --> 00:04:34,320
we can easily just do the double D.

97
00:04:34,320 --> 00:04:36,330
So just say, we already have the window server

98
00:04:36,330 --> 00:04:38,310
somewhere else or no longer need it.

99
00:04:38,310 --> 00:04:40,920
Double D and see that's gone.

100
00:04:40,920 --> 00:04:42,070
So let's get out of here

101
00:04:43,830 --> 00:04:45,273
again, right quit.

102
00:04:47,730 --> 00:04:50,463
Make sure those changes saved.

103
00:04:52,290 --> 00:04:53,580
Simple as that.

104
00:04:53,580 --> 00:04:56,070
Next thing we're going to do is edit the file.

105
00:04:56,070 --> 00:04:57,833
But this time we're going to use the Nano.

106
00:05:01,050 --> 00:05:04,890
Now, if you can see here, most of the commands are used

107
00:05:04,890 --> 00:05:07,830
with the control key, just to know it shows 'em

108
00:05:07,830 --> 00:05:10,320
all capitalized, but you're going to use the lower case version

109
00:05:10,320 --> 00:05:11,370
of these letters.

110
00:05:11,370 --> 00:05:14,250
Again, we're just going to go through and do a few things.

111
00:05:14,250 --> 00:05:17,313
You can go through here, again, delete as needed.

112
00:05:19,080 --> 00:05:21,000
The regular delete key.

113
00:05:21,000 --> 00:05:22,470
Let's see, we have Firefox here twice.

114
00:05:22,470 --> 00:05:24,720
So we just do is control K.

115
00:05:24,720 --> 00:05:27,540
That's another way we can delete entire line.

116
00:05:27,540 --> 00:05:29,970
And with Nano we go immediately into insert mode

117
00:05:29,970 --> 00:05:31,080
so we can start typing.

118
00:05:31,080 --> 00:05:33,663
We're do apache here, tomcat,

119
00:05:36,480 --> 00:05:38,223
give it some type of version.

120
00:05:40,800 --> 00:05:42,090
Okay.

121
00:05:42,090 --> 00:05:44,730
And now in Nano, control O that's what's going to

122
00:05:44,730 --> 00:05:45,603
save the file.

123
00:05:46,793 --> 00:05:48,200
We going to put enter here.

124
00:05:49,050 --> 00:05:51,243
And to exit out we'll simply do control X.

125
00:05:53,640 --> 00:05:56,520
Just like last time, make sure these changes were saved.

126
00:05:56,520 --> 00:05:58,547
So again, a text editor is very basic

127
00:05:58,547 --> 00:06:00,600
so we just went through a few of the shortcuts

128
00:06:00,600 --> 00:06:03,405
of how to quickly navigate through these text files

129
00:06:03,405 --> 00:06:06,755
and make quick changes by deleting entire lines

130
00:06:06,755 --> 00:06:10,440
cutting and pasting and things of that nature.

131
00:06:10,440 --> 00:06:12,240
Now I'll see you in the next lesson.

