translated

This commit is contained in:
geekpi 2023-03-30 08:49:34 +08:00
parent c57ee6cddd
commit c3d821f058
2 changed files with 150 additions and 150 deletions

View File

@ -1,150 +0,0 @@
[#]: subject: "How to Install and Use Neovim on Ubuntu and other Linux Distributions"
[#]: via: "https://itsfoss.com/install-neovim/"
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install and Use Neovim on Ubuntu and other Linux Distributions
======
![][1]
You must have heard about the famous Vim text editor already. However, this article is about its fork, Neovim.
Vim is also a fork of vi which makes Neovim fork of a fork. So, you can end up using anything for some of its unique traits.
If you decide to use Neovim, let me help you get started with it on Ubuntu and other Linux distributions.
### Neovim: Overview
![][2]
[Neovim][3] is a project known for its simple maintenance and community contributions. Moreover, the development effort is distributed well between multiple developers.
For end-users, Neovim is much more extensible than one would expect. The aim of Neovim is to provide better applications of it without compromising the traditional capabilities of Vim.
With a [GUI for Neovim,][4] you can get an enhanced editing experience.
### Features of Neovim
While you can explore all about it on its official website and its [GitHub page][5]. Let me highlight some features:
- Modern Graphical Interfaces
- API access from many language including (C/C++, C#, Go, Haskell, Java/Kotlin, JavaScript/Node.js, Lua, Perl, Python, Ruby, Rust to name a few)
- Embedded, scriptable terminal emulator
- Asynchronous job control
- Shared data among multiple instances
- XDG base directories support
- Compatible with most Vim plugins, including Ruby and Python plugins
💡
We advise you to learn the usage of Vim and Neovim before you start using it.
### Installing Neovim on Ubuntu and Linux
Installing Neovim is simple due to its popularity. As Neovim is available in official repos of any distribution you pick.
We also have a guide to [install Vim on Linux][6], in case you want that.
To install Neovim on Ubuntu, just click on the Ubuntu Software icon in the dock. Then, search for Neovim. You can select the snap or the deb version as per your preference. However, the deb package version will be an outdated version of Neovim.
![neovim listed on ubuntu software center][7]
And, if you do not want the snap version, you can grab the latest deb file from the [Github releases page for Neovim][8]. If you look closer in the releases page, there is an Appimage file as well.
If you want to utilize the terminal instead of the GUI, here's what you can do:
For **Ubuntu and Debian** based distributions, enter the following command to install
```
sudo apt install neovim
```
For **Manjaro and Arch Linux**, use the below command to update your system and install Neovim
```
sudo pacman -Syu neovim
```
For **Fedora**, use the following command
```
sudo dnf install -y neovim
```
To install the **Flatpak**, you can use this command
```
flatpak install flathub io.neovim.nvim
```
Lastly, to install the **snap package** use the below command
```
sudo snap install nvim --classic
```
If you prefer building software from source, follow [the steps given on the project's Github page][9].
### How to use Neovim
To use Neovim after installation is complete, just launch it from the application menu by pressing the super key and typing the name "neovim" without quotes. This will open a terminal window with Neovim open.
![][10]
Or you can just open any Terminal Emulator of your choice and enter the following command
```
nvim
```
Yes, not "neovim" but just "**nvim**". For example, to edit _/etc/fstab_ enter the following command.
```
sudo nvim /etc/fstab
```
Now the fstab file will open as shown in the screenshot below.
![][11]
Don't worry if you cannot exit the editor; press **Shift+Z+Z**. For example, if this shortcut key confuses, use the keys you need to type "ZZ" (uppercase) without quotes in any text editor.
On that note, I should re-iterate that you need to learn Vim or Neovim and go through the documentation to efficiently make use of all its features.
### Conclusion
Installing and launching Neovim is pretty straightforward but learning it will require some keyboard grinding for sure.
This was just an overview of the editor. I am not an expert on this, but I hope this serves well for all the beginners out there!
💬 _Do you use Neovim? Share your experience on it in the comments below._
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-neovim/
作者:[Anuj Sharma][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/anuj/
[b]: https://github.com/lkxed/
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
[2]: https://itsfoss.com/content/images/2023/03/goneovim.png
[3]: https://neovim.io/?ref=itsfoss.com
[4]: https://itsfoss.com/neovim-gui-editors/
[5]: https://github.com/neovim/neovim?ref=itsfoss.com
[6]: https://itsfoss.com/install-latest-vim-ubuntu/
[7]: https://itsfoss.com/content/images/2023/01/software-center-neovim-snap.png
[8]: https://github.com/neovim/neovim/releases/tag/stable?ref=itsfoss.com
[9]: https://github.com/neovim/neovim/wiki/Installing-Neovim?ref=itsfoss.com#install-from-source
[10]: https://itsfoss.com/content/images/2023/01/neovim-default-screen.png
[11]: https://itsfoss.com/content/images/2023/01/neovim-fstab.png

View File

@ -0,0 +1,150 @@
[#]: subject: "How to Install and Use Neovim on Ubuntu and other Linux Distributions"
[#]: via: "https://itsfoss.com/install-neovim/"
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Ubuntu 和其他 Linux 发行版上安装和使用 Neovim
======
![][1]
你一定已经听说过著名的 Vim 文本编辑器。然而,这篇文章是关于它的分支 Neovim。
Vim 也是 vi 的一个分叉,这使得 Neovim 成为分叉的分叉。所以,你最终可以使用任何东西,因为它有一些独特的特征。
如果你决定使用 Neovim让我帮助你在 Ubuntu 和其他 Linux 发行版上开始使用它。
### Neovim概述
![][2]
[Neovim][3] 是一个以其简单的维护和社区贡献而闻名的项目。此外,开发工作在多个开发人员之间很好地分配。
对于最终用户而言Neovim 的可扩展性远超人们的预期。Neovim 的目标是在不损害 Vim 传统功能的情况下提供更好的应用。
使用 [Neovim 的 GUI][4],你可以获得增强的编辑体验。
### Neovim 的特点
虽然你可以在其官方网站及其 [GitHub 页面][5]上探索所有相关信息。让我强调一些特点:
- 现代图形界面
- 从多种语言访问 API包括C/C++、C#、Go、Haskell、Java/Kotlin、JavaScript/Node.js、Lua、Perl、Python、Ruby、Rust 等等)
- 嵌入式、可编写脚本的终端仿真器
- 异步作业控制
- 多个实例之间的共享数据
- XDG 基本目录支持
- 与大多数 Vim 插件兼容,包括 Ruby 和 Python 插件
💡
我们建议你在开始使用 Vim 和 Neovim 之前了解其用法。
### 在 Ubuntu 和 Linux 上安装 Neovim
由于 Neovim 的流行,安装它很简单。因为 Neovim 在你选择的任何发行版的官方仓库中都可用。
如果你需要,我们还有一个[在 Linux 上安装 Vim][6] 的指南。
要在 Ubuntu 上安装 Neovim只需单击 Dock 中的 Ubuntu 软件图标。然后,搜索 Neovim。你可以根据自己的喜好选择 snap 或 deb 版本。但是deb 包版本将是 Neovim 的过时版本。
![neovim listed on ubuntu software center][7]
而且,如果你不想要 snap 版本,你可以从 [Neovim 的 Github 发布页][8]获取最新的 deb 文件。如果你仔细查看发布页面,还有一个 Appimage 文件。
如果你想使用终端而不是 GUI你可以执行以下操作
对于基于 **Ubuntu 和 Debian** 的发行版,输入以下命令进行安装:
```
sudo apt install neovim
```
对于 **Manjaro 和 Arch Linux**,使用以下命令更新你的系统并安装 Neovim
```
sudo pacman -Syu neovim
```
对于 **Fedora**,使用以下命令:
```
sudo dnf install -y neovim
```
要安装 **Flatpak**,你可以使用此命令:
```
flatpak install flathub io.neovim.nvim
```
最后,要安装 **snap 包**,请使用以下命令:
```
sudo snap install nvim --classic
```
如果你更喜欢从源代码构建软件,请遵循[项目 Github 页面上给出的步骤][9]。
### 如何使用 Neovim
要在安装完成后使用 Neovim只需从应用菜单启动它方法是按超级键并输入不带引号的 “neovim”。这将打开一个带有 Neovim 的终端窗口。
![][10]
或者你可以打开你选择的任何终端仿真器并输入以下命令:
```
nvim
```
是的,不是 “neovim”而是 “**nvim**”。例如,要编辑 _/etc/fstab_,请输入以下命令。
```
sudo nvim /etc/fstab
```
现在 fstab 文件将打开,如下面的截图所示。
![][11]
如果你无法退出编辑器,请不要担心,按下 **Shift+Z+Z**。例如如果此快捷键令人困惑请使用你需要的键在任何文本编辑器中输入不带引号的“ZZ”大写
关于这一点,我应该重申,你需要学习 Vim 或 Neovim 并阅读文档才能有效地利用其所有功能。
### 总结
安装和启动 Neovim 非常简单,但学习它肯定需要一些键盘操作。
这只是编辑器的概述。我不是这方面的专家,但我希望这对所有初学者都有好处!
💬 _你使用 Neovim 吗? 在下面的评论中分享你的经验。_
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-neovim/
作者:[Anuj Sharma][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/anuj/
[b]: https://github.com/lkxed/
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
[2]: https://itsfoss.com/content/images/2023/03/goneovim.png
[3]: https://neovim.io/?ref=itsfoss.com
[4]: https://itsfoss.com/neovim-gui-editors/
[5]: https://github.com/neovim/neovim?ref=itsfoss.com
[6]: https://itsfoss.com/install-latest-vim-ubuntu/
[7]: https://itsfoss.com/content/images/2023/01/software-center-neovim-snap.png
[8]: https://github.com/neovim/neovim/releases/tag/stable?ref=itsfoss.com
[9]: https://github.com/neovim/neovim/wiki/Installing-Neovim?ref=itsfoss.com#install-from-source
[10]: https://itsfoss.com/content/images/2023/01/neovim-default-screen.png
[11]: https://itsfoss.com/content/images/2023/01/neovim-fstab.png