Code Editor Definition, Sublime Text Tutorial

Sublime text

Almost all programmers have been involved in choosing the suitable code editor at least once. Editors of codes are tools that differentiate the keywords of any language you code in, offer some suggestions, and make programming easy for developers.

Code Editor Definition

Code Editor is one of the essential tools for programmers, designers and even writers. Integrated Development Environments (IDEs) are often cumbersome for small tasks, such as changing a file or doing a small project.

On the other hand, text editors such as Windows Notepad or Mac TextEdit are Too easy to edit codes. These apps lack needful capabilities and make coding complicated.

The solution is to use a code editor. Editing a file or project and managing the contents of a folder are some of the tasks that a code editor is very good at.

Interestingly, even the weakest code editors perform these tasks faster than an advanced IDE.

In the past, the code editors were specific for each platform. But now, most of them are cross-platform, and you can use them on different operating systems in almost the same way. Therefore, programmers can use office computers, personal pcs, or even shared devices and no longer need to be familiar with different environments to get things done.

In addition, you can change the behavior of these editors by changing the configuration settings (e.g., tab length adjustment, line spacing and wrapping, autocompletion, syntax highlighting, etc.). This feature allows the programmer to make the most of the software. On the other hand, the default settings allow the user to have a pleasant experience and use the “ready to use” capabilities.

 

 

How to Choose the Right Code Editor?

Choosing an appropriate code editor is challenging. Meanwhile, the most important thing is what you need. What capabilities are essential to you? Keyboard shortcuts? Appearance? Speed? Sustainability? Being cross-platform? Being open source? Options for highlighting commands?

Consider what you want from the editor. Would you like the program to autocomplete functions or close parentheses (}) and tags automatically? Or do these features bother you? Do you need a quick and easy changing UI feature, or a simple Light or Dark theme is enough? Would you like to execute Git commands directly from the editor?

There is no end to the list of possible features for an editor, and you should decide which features are right for you. What features make coding easier, faster, and more efficient?

Set your priorities first. Then browse through the available options and select the software that has the desired features.

Another important thing to consider is to give yourself time to work with the software. Look for plugins and extensions in the settings.

To get the best user experience, change the settings. By taking the time to change the editor to your liking, you will find out if you like working with it.

In the following, we will introduce code editing software, which is one of the best one available.

Sublime Text

Sublime text is one of the most popular coding editors that make programming enjoyable and speeds up the developer’s work.

In the following, we will introduce this software and teach you how to use it. If you are interested in learning how to code with Sublime text and want to know more about its features and tricks, stay tuned for the rest of this article.

What Is Sublime Text?

As mentioned, Sublime text is a code editor written in the Python and C ++ programming languages and first published in 2008. you can install sublime text on different operating systems (Windows, Mac OS X and Linux). Thus, it is called a cross-platform code editor.

Is Sublime Text an IDE?

IDE is software with complete tools and features that helps programmers in developing software. An IDE typically includes the following:

  • A source code editor: to write code
  • A compiler: for code interpretation
  • A Debugger: To debug the program

However, an IDE may have many other features and capabilities which are specific to each.

On the other hand, the code editor is similar to a text editor with some added features. Still, this software is not an IDE as it doesn’t have many software development tools. The code editor distinguishes the keywords of that language and offers some suggestions. Visual Studio Code, Atom and Sublime Text are the most popular code editors.

Advantages of Using Sublime Text

Using Sublime Text, you can code in many programming languages such as Java, JavaScript, PHP, HTML, CSS, C, Python, Perl, etc. To see the complete list of these languages, you can refer to the Sublime text site. In addition, Sublime Text supports markup languages such as HTML. Developers who use Sublime Text believe that it has impressive programming capabilities. However, some of these features include:

  • Low software size (about 20-40 MB) and its high speed
  • Ability to navigate and move quickly between files, symbols and codes
  • Simultaneous editing of several sections selected by the user
  • Default snippets for each language, as well as the feature of creating personal snippets
  • Custom settings and extensive customization capabilities for each project
  • Handy shortcuts and the feature to define new and dedicated shortcuts
  • Python-based application programming interface (API) for building plugins in Sublime Text

Differences Between Sublime Text Versions

Sublime Text2 was released in 2013. Support for Retina displays and the Quick Skip Next button were among the version changes. Other features added include:

  • New color themes for the editor environment
  • Minimap attribute (gives an overview of the whole file in the right corner of the screen, and by clicking on this section, you will see the contents in the editor)
  • Increase the number of display panels, groups and display modes
  • Ability to edit multiple sections simultaneously
  • Ability to auto-complete code with a snippet and add a new custom snippet
  • Highlight necessary commands and display high contrast
  • Ability to switch between open files
  • Defining shortcuts
  • Package management system and more packages to run different programming languages

The latest version of Sublime text is currently Sublime text 3. In this version, some bugs are fixed. Furthermore, the following two features have been added:

  • Defining symbol indexing to use the go-to feature
  • Switching between display panels with hotkeys

However, you can find details of each version change on the official Sublime text website.

Sublime Text Tutorial

In general, Sublime Text is not free, but you can download it for free and use the evaluation version. Although the evaluation version does not currently have a time limit, you need to purchase a license if you use it regularly. You have to pay $ 80 to buy a license. Otherwise, it is illegal to use it.Ā 

How to Install Sublime Text on Linux

To download and install Sublime Text on Linux, simply enter the following commands in the terminal:

  1. sudo add-apt-repository ppa: webupd8team / sublime-text-3

2. sudo apt-get update

3. sudo apt-get install sublime-text-installer

How to Install Sublime Text on Windows

Step One – Download Sublime Text

First, go to the Sublime Text download page, download the version you need, and install it. You can also examine the license purchase conditions in the buy tab.

Step Two – Install Sublime Text

Open the downloaded file and specify the installation location.

Next, you need to decide whether to activate the Sublime Text option by right-clicking in the Windows environment. If you want to use Sublime text continuously, we recommend that you select this option:

Sublime text

Finally, by clicking the install button, the program will be installed.

Sublime Text Settings

The first time you open Sublime Text, you will see the following page:

Sublime text first page

As you can see, there is no introduction, no help to get acquainted with the screen or anything like that. Your only choice is to code in the Sublime Text editor. To open a project, you need to select the File tab and the OpenFolder option from the top menu and add the project to the Sublime Text. When you do this, the folder structure will appear on the left side as shown below:

Sublime text folder

Selecting files from the right side of the code editor environment helps you to start coding them quickly. Files and folders can also be saved as projects to use the next time. Now let’s take a look at some of the Sublime Text highlights.

Changing Text Color and Auto-Completing Features

In general, the Sublime Text and Atom are very similar. No wonder many people think that Atom is actually based on Sublime Text. That’s because many features of these two popular code editors are the same. For example, both have autocompletion and highlight properties. You can view an example of this feature in the following figure:

Sublime text colors

Sublime Text supports multiple programming languages by default, and for other languages, you must use special plugins. Essential phrases and main commands are appropriately colored, and the code editor even warns you to fix errors in the code when you are coding.

Mini-Map in Sublime Text

Imagine you have an extremely long file to edit. Although the current position is displayed based on the scroll bar movement in the editor code environment, you can directly click on the map to go to a specific location of the code. This map is actually a tiny screen and is really useful. People who already have code over 1000 lines in a file welcome this feature; Because using load scrolling in long files is difficult. As you can see in the figure, the map is to the right of the editor code:

Sublime text map

Also, having this small map allows a new programmer to understand how big the file is.

Arranging panels based on the user demands

One of the most powerful features of Sublime Text is opening and editing multiple files simultaneously. This code editor can display files in rows, columns or full screens. The feature is handy for WordPress developers. For example, in the figure below, four files are open simultaneously and ready to edit:

Arranging panels based on the user demands

Use the ALT-UP-2 key combination to add a panel as a column (set the last number depending on the panel number) and the SHIFT-ALT-UP-2 key combination to add in a row.

Ready templates

Based on the color and layout of the code lines, Sublime Text has various formats, each designed for a specific taste. Boxy, Panda and Material Theme templates are trendy among programmers.

To install these templates, first, search them on google to see if you like their appearance. In the second step, select your desired theme. To install it in the editor code, press Ctrl + Shift + P and type ā€œinstall packageā€ to open the plugin section.

Then type the theme name (for example, panda syntax sublime) to instal it. You can use it immediately after installation. However, this feature is especially handy for people who code at different times and need a light and dark theme at the same time.

Personal settings in Sublime Text

There are many features you may need to customize. For example, the tab character length is four space characters by default. To make the code more readable, you can change it to two characters. All you have to do is select the Settings – User option from the Preferences tab at the top of the page and change it as follows:

{ “draw_white_space”: “all”, “rulers”: [80], “tab_size”: 2, “translate_tabs_to_spaces”: true }

To see more recommended settings, you can read the Sublime Text settings section on the official site.


Leave a Comment

Your email address will not be published. Required fields are marked *