如何在 Ubuntu 上安裝 Sublime Text 編輯器


Sublime Text 是一款跨平臺的原始碼編輯器,具有 Python 應用程式程式設計介面 (API)。它原生支援許多程式語言和標記語言,並且其功能可以透過使用者使用外掛進行擴充套件,這些外掛通常由社群構建和維護,並根據自由軟體許可證釋出。

本文介紹了“如何在 Ubuntu 上安裝 Sublime Text 編輯器”。

功能

  • 並排編輯檔案。

  • 它支援所有平臺。

  • 它提供使用正則表示式查詢和替換的功能。

  • 命令面板提供了對功能的快速訪問。

  • “快速跳轉”,快速導航到檔案、符號或行。

  • 基於 Python 的外掛 API。

  • 相容 TextMate 的許多語言語法。

安裝 Sublime

Sublime Text 有兩個版本可供安裝,要安裝 Sublime 2,請使用以下命令 -

$ sudo add-apt-repository ppa:webupd8team/sublime-text-2

示例輸出應如下所示 -

Sublime Text 2 packages - the .deb will automatically download the latest build from http://www.sublimetext.com/dev or beta from http://www.sublimetext.com/2 (Adobe Flash Player installer - style).

More info and feedback:
http://www.webupd8.org/2011/03/sublime-text-2-ubuntu-ppa.html
http://www.webupd8.org/2012/03/sublime-text-2-ppa-separate-development.html
   More info: https://launchpad.net/~webupd8team/+archive/ubuntu/sublime-text-2
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpsv1jnez9/secring.gpg' created
gpg: keyring `/tmp/tmpsv1jnez9/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpsv1jnez9/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:                imported: 1 (RSA: 1)
OK

要更新軟體包索引,請使用以下命令 -

$ sudo apt-get update

示例輸出應如下所示 -

Ign http://dl.google.com stable InRelease
Hit http://dl.google.com stable Release.gpg
Hit http://dl.google.com stable Release
Ign http://extras.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Hit http://dl.google.com stable/main amd64 Packages
Hit http://extras.ubuntu.com trusty Release.gpg
Hit http://extras.ubuntu.com trusty Release
Hit http://extras.ubuntu.com trusty/main Sources
Get:2 http://security.ubuntu.com trusty-security/main Sources [109 kB]
Hit http://extras.ubuntu.com trusty/main amd64 Packages
Get:3 http://ppa.launchpad.net trusty InRelease [15.5 kB]
Hit http://extras.ubuntu.com trusty/main i386 Packages
Get:4 http://security.ubuntu.com trusty-security/restricted Sources [4,035 B]
Hit http://ppa.launchpad.net trusty InRelease
Get:5 http://security.ubuntu.com trusty-security/universe Sources [34.0 kB]
Ign http://ppa.launchpad.net trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Hit http://ppa.launchpad.net trusty InRelease
Get:6 http://security.ubuntu.com trusty-security/multiverse Sources [2,750 B]
Ign http://ppa.launchpad.net trusty InRelease
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [444 kB]
Ign http://ppa.launchpad.net trusty InRelease
Get:8 http://ppa.launchpad.net trusty/main amd64 Packages [739 B]
Get:9 http://ppa.launchpad.net trusty/main i386 Packages [753 B]
Get:10 http://ppa.launchpad.net trusty/main Translation-en [357 B]
Ign http://extras.ubuntu.com trusty/main Translation-en_IN
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Get:11 http://in.archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Ign http://extras.ubuntu.com trusty/main Translation-en
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Get:12 http://security.ubuntu.com trusty-security/restricted amd64 Packages [13.0 kB]
Hit http://ppa.launchpad.net trusty Release.gpg
Get:13 http://security.ubuntu.com trusty-security/universe amd64 Packages [125 kB]
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Get:14 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [4,991 B]
Hit http://ppa.launchpad.net trusty Release.gpg
Get:15 http://security.ubuntu.com trusty-security/main i386 Packages [417 kB]
Get:16 http://ppa.launchpad.net trusty Release.gpg [316 B]
Hit http://ppa.launchpad.net trusty Release
................................................................

要安裝 Sublime Text 編輯器,請使用以下命令 -

$ sudo apt-get install sublime-text

示例輸出應如下所示 -

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
   gtk2-engines-pixbuf libbs2b0 libopusfile0 libpyside1.2 libqmmp-misc
   libqmmpui0 libshiboken1.2 libsidplayfp libtidy-0.99-0 linux-headers-4.2.0-27
   linux-headers-4.2.0-27-generic linux-image-4.2.0-27-generic
   linux-image-extra-4.2.0-27-generic linux-signed-image-4.2.0-27-generic
   php7.0-opcache python-beautifulsoup python-feedparser python-html2text
   python-magic python-oauth2 python-pyside.qtcore python-pyside.qtgui
   python-pyside.qtnetwork python-pyside.qtwebkit python-pysqlite2 python-regex
   python-sqlalchemy python-sqlalchemy-ext python-support python-unity-singlet
   python-utidylib
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
   sublime-text
0 upgraded, 1 newly

要安裝 Sublime 3,請使用以下命令 -

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
$ sudo apt-get update
$ sudo apt-get install sublime-text-installer

要開啟 Sublime,請使用以下命令 -

$ subl

示例輸出應如下所示 -

恭喜!現在,您已經瞭解了“如何在 Ubuntu 上安裝 Sublime Text 編輯器”。我們將在下一篇文章中學習更多關於這些型別命令的知識。繼續關注!

更新於: 2020年1月22日

474 次瀏覽

開啟您的 職業生涯

透過完成課程獲得認證

開始學習
廣告