Gedit-Text-Editor/C2/Handling-Tabs/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of script: Handling tabs in gedit Text editor

Author: Nirmala Venkat

Keywords: Add tab, Move tab, Reorder tab, Close tab, Side panel, Insert line numbers, Wrap text, Video tutorial

Visual Cue Narration
Slide 1: Welcome to the Spoken Tutorial on Handling tabs in gedit Text editor.
Slide 2:

Learning objectives

In this tutorial, we will learn to:
  • Add, move, re-order and close tabs
  • Use the Side Panel to browse and open files
  • Insert line numbers and
  • Wrap text
Slide 3:

System Requirements

To record this tutorial, I am using:
  • Ubuntu Linux 14.04 operating system
  • gedit 3.10
Slide 4:

Pre-requisites

To follow this tutorial, you should have working knowledge of any operating system.
Let's open the gedit Text editor.
Point to the tab By default, the gedit Text editor has one tab named as Untitled Document 1.
Copy and paste the code Now, pause the tutorial and type the following code as displayed on the screen.
Point to the C program This is a program in C language.
Let us save the program.
Ctrl + S Press Ctrl + S keys simultaneously on the keyboard.
Enter Name >> Sample.c In the Save dialog box, enter the name as sample dot c.

The extension ‘c’ indicates that it is a C language program.

Browse >> Select Desktop

Click Save.

Select the folder where you want to save the file.

I will select Desktop and then click on Save button.

The tab name has changed to sample dot c.

Point to the different colors

Point to the status bar

Did you notice the various colors in the program after you saved the file?

This is because gedit Text editor recognizes the typed code as a C program.

We will learn more about syntax highlighting in later tutorials.

Also, notice the status bar which has changed to 'C'.

Point to the top bar of the window We can see that the window name has also changed to sample dot c.
From the Main menu, click File>>New To add a new tab, from the Main menu, click File and New.
Point to the Untitled Document1 A new tab named Untitled Document 1 is created to the right of the document sample.c.
Point to the top bar of the window Again, the title at the top of the window has changed to Untitled Document 1.

So, the name of the active tab is displayed as the title of the window.

Click >> New icon from the toolbar Now, let’s learn another way to open a new tab.

Click on the New icon in the toolbar.

Point to untitled Document 2 Another tab Untitled Document 2 has been created.

The numbering of tabs begins at 1 and increments by 1 for each new tab that is opened.

That’s why this tab is numbered 2.

Click 'New' icon twice in the toolbar In a similar way, let's create two more new documents.
Point to all tabs Now, we have a total of 5 tabs including sample.c.
How do we navigate through these tabs?
Point to the triangular button on both ends of the tab bar Notice, there is a triangular button on both ends of the tab bar.
You can use these buttons to navigate through the tabs.
Click on the left triangular button Let's click on the left triangular button till the document sample.c is visible.
How do we close the tabs?

This is very simple.

Main Menu >> File >>Close From the Main menu, click File and Close
Point to the X button on the tab Alternately, you can simply click on the X button on the tab.
Close Untitled Document 2 and 3 Let's close the Untitled Document 2 and 3 in this manner.

So, we are left with sample dot c, Untitled Document 1 and Untitled Document 4.

Click New icon twice in the toolbar Now, let's add two more new documents.
Point to Untitled Document 2 and 3 These two new tabs are named as Untitled Document 2 and 3.
The documents are numbered or ordered, as shown here.
The ordering may be different in lower versions of gedit.

Such differences in versions will happen and the learner should be prepared to handle these.

Let's rearrange the tabs now.
Select Untitled Document1. First, select Untitled Document1.
Press the left mouse button and drag it to the left. Press the left mouse button and drop it to the left of the file sample.c.
Release the left mouse button Release the left mouse button.
Point to the tab that is rearranged. The tab is rearranged.
Rearrange the tab 2and 4 In the same manner, let us rearrange the tab 2 and 4.

<<PAUSE>>

Next, let's learn to move a tab to another window.
Select the tab where sample.c is present First, select the tab sample.c which we want to move.
Right click on the tab and select 'Move to New Window'

Point to sample.c that opens in new window

Then, right-click on the tab and select 'Move to New Window'.

sample.c opens in a new window.

Let's switch from sample.c to the other window with the Untitled Documents.
Main menu >> View >> Side Pane Go to the Main menu and click View and Side Panel.
Point to the Side Pane on the left side of the window The Side Panel opens up on the left side of the window.
You can view the names of all the documents in the Side Panel.

It is in the same order in which they appear on the window panel.

In the Side Pane, click on Untitled Document 2. In the Side Panel, click on the Untitled Document 2.

That document becomes active now.

Let us rearrange the document in the gedit Text editor window, as we did before.
Click on the tab Untitled Document 4.

Press the left mouse button and drag and drop the file after the last tab.

Let’s click on the tab Untitled Document 4.

Click, drag and drop the file after the last tab.

Point to the changes in the Side Pane. Notice that the document order has now changed in the Side Panel, too.
To close the Side Pane, simply click the X button on the top right. To close the Side Panel, simply click the X button on the top right.

<<PAUSE>>

Let's learn how to go to a specific line number in the gedit Text editor file.
Switch to sample.c file. Switch to sample.c file.
Click Search >> Go to line From the Main menu, click Search and Go to Line.
Point to the Go to Line dialog box The Go to Line dialog-box appears on the top right corner of the gedit Text editor window.
Enter 8 in the box In the dialog box, enter the number 8 and press the Enter key.
Point to the cursor

Point to the status bar

The cursor jumps to line 8.

We can also see the line number as 8 in the status bar.

But, it will be easy to locate the cursor if the line number is displayed along with the text.
Click Edit >> Preferences To display the line numbers of the code, from the Main menu, select Edit and Preferences.
Point to gedit Preferences dialog box gedit Preferences dialog box appears.
Click View tab Click the View tab.
Check the Display line numbers box. Put a checkmark on Display line numbers option.
Check the Highlight current line box.

Click Close.

Put a checkmark on Highlight current line option.

Click on the Close button.

Point to the line numbers


Point to the current line number in bold.

Notice that the line numbers are displayed to the left of the code.

Also, the line on which your cursor is displayed is in bold.

<<PAUSE>>

Slide 5:

Text Wrapping

Next we will learn about text wrapping.
  • A line of code in a program may exceed the length of the gedit Text editor window.
  • So, it becomes difficult to read the entire line of the text.
  • Text wrapping helps to wrap the text within the size of the window.
Switch back to the sample.c program. Switch back to the sample.c program.
Click Edit >> Preferences From the Main menu, click Edit and then Preferences.
Point to the check box Enable text wrapping Notice that the option Enable text wrapping is checked by default.
Uncheck the box. Click Close. Uncheck this box.

Click on the Close button.

Type the below code at the end of the program

printf ("This is a sample program in C which explains the working of if else statement");

Let me add a line of code at the end of the program.
Point to the line where it exceeds the window length. Notice that the length of the text has exceeded the size of the window.
Click Edit>> Preferences

Click on the View tab.

Check the option Enable text wrapping

Click Close.

Now, let's check the option Enable text wrapping.
Point to the text to show text wrapping. The text has been neatly wrapped to fit the window.

<<PAUSE>>

This brings us to the end of this tutorial. Let us summarise.
Slide 8:
Summary
In this tutorial, we learnt to:
  • Add, move, re-order and close tabs
  • Use the Side Panel to browse and open files
  • Insert line numbers and
  • Wrap text
Slide 9:
Assignment
Here is an assignment for you.
  • Create 5 new tabs in the gedit Text Editor
  • Save them as One, Two,Three, Four and Five
  • Now re-order the tabs as Three, Two, One, Five and Four
  • Open the Side Panel
  • Click the file Five in the Side Panel and enter some text
Slide 11:

About Spoken Tutorial project

The video at the following link summarises the Spoken Tutorial project.

Please download and watch it.

Slide 12:

Spoken Tutorial workshops

The Spoken Tutorial Project Team:
  • conducts workshops using spoken tutorials and
  • gives certificates on passing online tests.

For more details, please write to us.

Slide 13:

Forum for specific questions

Do you have questions in THIS Spoken Tutorial?
  • Please visit this site.
  • Choose the minute and second where you have the question.
  • Explain your question briefly.
  • Someone from our team will answer them.
Slide 14:

Acknowledgement

Spoken Tutorial project is funded by NMEICT, MHRD, Government of India.

More information on this mission is available at this link.

This is Nirmala Venkat from IIT Bombay, signing off. Thanks for watching.

Contributors and Content Editors

Nancyvarkey, Nirmala Venkat