N
O
I
T
A
V
O
N
N
E

Sublime Text Editor

Blog Author
By Vidya Patil
  • On may 27, 2021
  • 9 min to read
Blog Images

This Tutorial will teach you how to use and configure Sublime Text.

  • How to install packages in sublime text editor
  • How to remove packages in sublime text editor
  • Visual requirements
  • Ftp connection
  • Git
  • Find & replace
  • Bonus
  • Pros & cons

Features of Sublime text editor

1. How to install packages in sublime text editor

Package control: To install package control, follow the instructions below:

Procedure:

  1. Open the command palette
  2. win/Linux:ctrl+shift+p, mac:cmd+shift+p

  3. Type install package control, press enter
  4. When you click on the package control:install package, the package window appears as shown below. You can search for the particular package and press enter.
  5. Preferences > package setting show all your installed packages.
Blog Images

2. How to remove packages in sublime text editor

To remove package control, follow the instructions below:

Procedure:

  1. Open the command palette
  2. win/Linux:ctrl+shift+p, mac:cmd+shift+p

  3. Type remove package control, press enter
Blog Images

3. Basic Requirements

  • Code styling (auto)
  • Code beautification
  • Auto complete tag
  • Commenting options
  • Shortcut keys
  • Error detection
  • Automatic code suggestion
Code styling (auto)
Sublime can automatic complete tag, highlight CSS color codes, easy to understand (install emmet package)
Code beautification
Sublime can beautify html code.(install html beautifier, php beautifier package)
  • https://packagecontrol.io/packages/HTMLBeautify
  • https://packagecontrol.io/packages/PhpBeautifier
Auto complete tags
Sublime can Automatic complete html tags, brackets.
Commenting options
There are two options available in sublime editor for commenting
  • Edit > comment > Toggle comment Toggle comment (Ctrl+/ ) It comments lines like this:
    // Line 1
    // Line 2
  • Edit > comment > Toggle comment Toggle comment (Ctrl+/ )It comments lines like this:
    /* Line 1
    Line 2 */
Blog Images
Shortcut keys
You can create your own custom keymap preferences > key binding There have multiple default shortcut keys available also you can create your own keys in user section as shown below
Blog Images
Error detection
Detect syntax error of php html & css. (install sublimeLinter-php & sublimeLinter-html-tidy package).
  • https://packagecontrol.io/packages/SublimeLinter-php
  • https://packagecontrol.io/packages/SublimeLinter-html-tidy
Blog Images
Automatic code suggestion
Suggest automatic code of html css js & wordpress functions also automatic show file names(install jshint package, wordpress code reference package & auto file name package)
  • https://packagecontrol.io/packages/JSHint
  • https://packagecontrol.io/packages/AutoFileName
Blog Images

3. FTP connection

  • Remote FTP/SFTP with sublime
  • FTP connection within multiple accounts
  • Auto complete on save
  • Commenting options
  • Comparison with remote
  • Error detection
  • Upload & download multiple files
Remote FTP/SFTP with sublime
  • Right click on the folder icon/name and go to sftp/ftp > add alternate remote mapping this will create alternative sftp-config-alt.json file.
  • Set the configuration with another account and save file.
  • Right click on the folder icon/name and go to sftp/ftp > switch remote mapping option show the multiple remote accounts. Select one and right click on the folder & upload file.
Blog Images
Auto complete on save
In the ftp-config.json file "upload_on_save":false, set to true
Comparison with remote
Right click on the folder icon/name and go to sftp/ftp > Diff remote file.this will show the comparison with remote
Blog Images
Upload & download multiple files
  • Right click on the folder icon/name and go to sftp/ftp >Upload file
  • Right click on the folder icon/name and go to sftp/ftp >Upload folder
  • Right click on the folder icon/name and go to sftp/ftp >Download file
  • Right click on the folder icon/name and go to sftp/ftp > Download folder
Blog Images

Git

Git in sublime text
Install git package for git integration. https://packagecontrol.io/packages/Git. Highlight untracked and staged files The sidebar will show the git status of files and folders with a icon like,
  • Untracked
  • Modified
  • Missing
  • Staged addition
  • Staged modification
  • Staged deletion
Git all facilities
  • Install sublime merge package
  • Right click on file > open git repository
Blog Images
  • Tools > command palette >search git status will display status window with tracked and untracked files. We can perform multiple action on it using the short keys given below,
Blog Images

6. Find & Replace

  • Find and replace in particular extensions files inside folder
  • Find and replace in current, selected files
  • Find and replace in folder
  • Find and replace within multiple files
Find and replace in particular extensions files inside folder
Using extensions like .js, .php, /project/*js we can find words and replace.
Find and replace in current, selected files
You can find word in file and replace with another word
Find and replace in folder
Type word which you want to replace & the name of the file or folder and replace word
Find and replace within multiple files
Find>find in files and then type word which you want to replace & the name of the file or folder and word you want to replace with. Blog Images Blog Images
  • Create workspace/project
  • Project > add folder to project >open recent project.
  • Switch between projects
  • Project > switch project > select another project.
Blog Images

Bonus

Code snippet
  • You can create your own snippet in sublime (tools > developer > new snippet).
  • Add / before $.
  • Save snippet with filename.sublime.snippet.
  • Add snippets in other files(tools > snippet >search snippet which you create).
Blog Images Blog Images

Pros & cons

Pros
  • Better find replace feature than others.
  • Accurate syntax suggestions.
  • Color coding:Every element in your code is color coded.this makes it very easy to debug your code.
  • Can easily work with multiple projects without confusion.
  • Easy to use.
  • Ftp connection within multiple accounts.
  • Automatic syntax checking & support for various languages.
Pros
  • Less & complicated plugins.

Conclusion

Sublime is a flexible and fast code editor.

Comments:

Leave a comment:

Recent post

Sublime Text Editor
  • may 27, 2021
  • 9 min to read
Let's work together

Need a successful project?

call us now +1 9188046070