Sublime Text 3 and some plugins on Linux

Sublime Text is a code editor developed in C++ and Python. It supports many programming languages and its functionalities can be extended thanks to its plugins. Cross-platform, it is available on Linux, Mac and Windows.

Sublime Text on your Linux distribution

To know which are the best plugins for sublime text, click HERE

First of all, install the security key that will ensure that the repository is authenticated.

$ wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

Then, to install the stable version, add the repository to your sources.list

$ echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list 

Finally, install Sublime Text

$ sudo apt update && sudo apt install sublime-text

To check the version

$ subl -v

You can now launch Sublime Text

now you can edit your code

For example, you can create a new project under Angular Install the Angular framework on Linux

To edit code, launch sublime text, click on File and Open Folder to open your project.

Sublime text 3

Or you can place yourself on the folder you want to open with the command “cd /TargetFile/” and edit your project with this last command :

$ subl .

Some plugins at your disposal that make your life easier

There are thousands of plugins. Among them, some of them will make your life easier. They quickly become indispensable. They offer you shortcuts that will save you time in development.

Sublime Text is in a way a Swiss Army knife

To install your plugins, enter CTRL + SHIFT + P, select Package controll: install package

Sublime text package install

Enter the name of the plugin you want to install.

Sublime text plugin

Alignement

To realign your lines with CTRL + ALT + A

ERB Snippets

Useful for writing erb templates

er => <% %>

pc => <% # %>

if => <% if %>…<% end %>

ife => <% if %>…<% else %>…<% end %>

else => <% else %>

elsif => <% elsif %>

end => <% end %>

it => <%= link_to …, … %>

Emmet

It saves you time thanks to its abbreviations. For each of them, simply press [TAB] to execute it.

Here are two examples :

! to create the header of an HTML page

 <!DOCTYPE html> 
<html lang="en"> 
<head> 
 <meta charset="UTF-8"> 
 <title>Document</title> 
</head> 
<body> 
</body> 
</html> 

<div>*3 to create several occurrences of a tag

<div></div> 
<div></div> 
<div></div>

To see all the possibilities offered by this plugin, click HERE

GotoDocumentation

It allows you to access the documentation of many languages PHP, JS / CoffeeScript, HTML, CSS/SASS/LESS, Python (via pydoc), Clojure, Go, Ruby, Rails, C / C++, Perl, C#, Lua, Postgres, Erlang, Smarty, Haskell. It is possible to add more.

Sublime text gotodocumentation

Feel free to comment on how you use Sublime Text

signature

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.