sublime-text

 Tìm hiểu sublime-text trên ubuntu 20.04

1. Cài đặt subline-text

- Install the dependencies necessary to add a new repository over HTTPS

$sudo apt update

$sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

Import the repository’s GPG key and the Sublime APT repository to your system’s software repository list by typing

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

$sudo add-apt-repository "deb https://download.sublimetext.com/ apt/stable/"

- Once the repository is enabled, install the Sublime Text 3 by typing

$sudo apt install sublime-text

- Cài đặt gói curl nếu ubuntu chưa cài

$sudo apt  install curl

Nguồn: sư tầm

2. Sử dụng Subline-text

2.1 Cài đặt plugin alignment

Install the Sublime Alignment package in Sublime Text

Follow these steps:

1. Command-Shift-P to open Command Palette.

2. Type Install until you see Package Control: Install Package.

3. When the list of packages appears, type Alignment until you find it.

4. Press Enter to install Sublime Alignment.

Configuring Sublime Alignment 

Follow these steps:

1. Open the preferences file for Sublime Alignment:

Windows: Preferences > Package Settings > Alignment > Settings - User

Linux: Preferences > Package Settings > Alignment > Settings - User

Mac OS X: Sublime Text 2 > Preferences > Package Settings > Alignment > Settings - User

2. The file should be empty. Put the following in it:

{

    // The mid-line characters to align in a multi-line selection, changing

    // this to an empty array will disable mid-line alignment

    "alignment_chars": [

        "=", ":"

    ]

}

3. Save & close the preference file. By default, Sublime Alignment works with =. Now it works with = and with :.

Using Sublime Alignment

Simple:

1. Select the lines you wish to align.

2 Press Ctrl+Alt+A (Windows & Linux) or Command+Ctrl+A (Mac OS X)

Nguồn tham khảo: https://granneman.com/webdev/editors/sublime-text/packages/how-to-install-and-use-sublime-alignment

https://maheshwaghmare.com/alignment-package-in-sublime-text-3/

- Ví dụ:

+, Mở file và chọn nội dung cần căn


+, Nhấn tổ hợp phím Crtl + Alt + A


2.2 Cài đặt plugin alignTab

- Cài đặt gói tương tự alignment

+, không cần bỏ sung thêm script

- Sử dụng:

+, Mở file, chọn nội dung cần căn và nhấn tổ hợp phím (Crtl + SHIFT + P)

+, Chọn "Live Preview Mode" theo hình dưới


+, Nhập ký tự căn là "=" hoặc "=>",...nội dung phần bôi đen sẽ được căn chỉnh


Nguồn tham khảo thêm: https://blog.ssanj.net/posts/2016-03-30-align-tab-sublime-text-plugin.html

https://github.com/randy3k/AlignTab



Nhận xét