Merge pull request #20502 from geekpi/translating

translated
This commit is contained in:
geekpi 2020-12-22 08:38:57 +08:00 committed by GitHub
commit e067f22a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 113 additions and 115 deletions

View File

@ -1,115 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why Vim users will love the Kakoune text editor)
[#]: via: (https://opensource.com/article/20/12/kakoune)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Why Vim users will love the Kakoune text editor
======
This editor may be reminiscent of Vim, but it offers plenty of its own
unique functions and features.
![Typewriter keys in multicolor][1]
The [Kakoune][2] text editor takes inspiration from Vi. With a minimalistic interface, short keyboard shortcuts, and separate editing and insert modes, it does [look and feel a lot like Vi][3] at first. However, the Kakoune editor has its own unique style both in design and function and is better considered its own editor rather than yet another Vim.
### Install
On Linux and BSD, you can install Kakoune from your distributions software repository or ports tree. For example, on Fedora, CentOS, or RHEL:
```
`$ sudo dnf install kakoune`
```
On Debian, Ubuntu, or similar:
```
`$ sudo apt install kakoune`
```
On macOS, you can use Homebrew:
```
`$ brew install kakoune`
```
Alternatively, you can [build it from source code][4].
The command to start Kakoune is `kak`. You can start Kakoune empty, or you can include a file name for it to open upon launch:
```
`$ kak example.txt`
```
### Using Kakoune
When you launch Kakoune (without a file name), it opens a mostly empty buffer in your terminal, except for a small status bar at the bottom of the windows. Like Vim, Kakoune starts in "normal" mode, which accepts key presses as commands and does not enter text into the buffer. To enter _insert_ mode, you must press either **i** (for **insert**) or **a** (for **append**).
While in insert mode, Kakoune acts mostly like any other editor. You type on your keyboard, and the characters you type show up in the buffer. While in insert mode, you can use the arrow keys to navigate through the buffer.
### Normal mode
In normal mode, you can issue navigation and text editing commands. This is the most obvious borrowed feature from the Vi tradition. Editing commands include functions to copy, cut (or "yank," in traditional Unix editing vernacular), and paste words and lines, undo, transform characters to upper or lower case, and so on. Here are some of the basics:
* **d**: yank and delete current selection ("cut" in modern terminology)
* **c**: yank and delete current selection and enter insert mode
* **Esc+Alt+d**: delete current selection
* **y**: yank selection
* **p**: paste
* **<**: unindent selected lines
* **u**: undo
* **U**: redo
* **`**: transform to lower case
* **~**: transform to upper case
### Selection
In Kakoune, your cursor is a single-character mobile selection. Unless you extend your selection, any commands affecting a selection apply to just your cursor. For instance, if your cursor is hovering over the letter **n**, then the yank command (**c** in normal mode) copies the letter **n** to your clipboard, and the paste command (**p** in normal mode) pastes the letter **n** into the buffer.
The easiest way to extend a selection from a single character is to enter normal mode and press the **Shift** key while moving your cursor with the arrow keys. There are, however, several methods of extending a selection based on certain criteria. For instance, **Alt+l** extends a selection region from your cursor to the end of the current line.
Full documentation is available at <https://github.com/mawww/kakoune/blob/master/README.asciidoc>.
### Functions
In addition to these basic interactions, you can also issue commands to invoke the built-in functions of Kakoune. To access the Kakounes command line, type `:` in normal mode. From the command line, you can issue commands, including the essential **edit** command to open a file, the **write** command to save your buffer to a file, and of course, **quit** to exit the application.
There are many more functions, including special options for specific programming languages and file formats, an option to use the [Ranger file navigator][5] to browse your file system, change your color theme, search and replace text, and much more.
![Kakoune][6]
### Try Kakoune
If youre an experienced Vim user or even someone with just a passing competency, you might find Kakoune disorienting at first. Its just similar enough to Vim to lull you into a false sense of familiarity—everything works exactly like Vim until its drastically different. However, if youre new to Vim-like editors, or youre a Vim user looking for a new challenge, then Kakoune could be an ideal editor for you.
Try it for yourself!
When I started using the vi text editor, I hated it. Now I've been using vi for more than 17 years...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/12/kakoune
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor)
[2]: https://kakoune.org/
[3]: https://opensource.com/article/20/12/vi-text-editor
[4]: https://github.com/mawww/kakoune
[5]: https://opensource.com/article/20/3/ranger-file-navigator
[6]: https://opensource.com/sites/default/files/kakoune-screenshot.png (Kakoune)

View File

@ -0,0 +1,113 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why Vim users will love the Kakoune text editor)
[#]: via: (https://opensource.com/article/20/12/kakoune)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
为什么 Vim 用户会喜欢 Kakoune 文本编辑器?
======
这个编辑器可能会让人联想到 Vim但它也提供了很多自己独特的功能和特性。
![Typewriter keys in multicolor][1]
[Kakoune][2] 文本编辑器的灵感来源于 Vi。它拥有简约的界面、简短的键盘快捷键以及独立的编辑和插入模式乍一看确实[看起来和感觉很像 Vi][3]。然而Kakoune 编辑器在设计和功能上都有自己独特的风格,与其说是另一个 Vim不如说是它是它自己。
### 安装
在 Linux 和 BSD 上,你可以从你的发行版的软件仓库或 port 树上安装 Kakoune。例如在 Fedora、CentOS 或 RHEL 上:
```
`$ sudo dnf install kakoune`
```
在 Debian、Ubuntu 或类似的系统上:
```
`$ sudo apt install kakoune`
```
在 macOS 上,你可以使用 Homebrew
```
`$ brew install kakoune`
```
或者,你也可以[从源码构建][4]。
启动 Kakoune 的命令是 `kak`。你可以空着启动 Kakoune也可以在启动时包含文件名让它打开
```
`$ kak example.txt`
```
### 使用 Kakoune
当你启动 Kakoune不带文件名除了在窗口底部有一个小的状态栏外它在你的终端中打开的大部分是空的缓冲区。像 Vim 一样Kakoune 以“正常”模式启动它把按键作为命令不向缓冲区输入文本。要进入_插入模式你必须按 **i**(代表**插入**)或 **a**(代表**追加**)。
在插入模式下Kakoune 的操作和其他编辑器一样。你在键盘上输入,然后你输入的字符就会显示在缓冲区里。在插入模式下,你可以使用方向键来浏览缓冲区。
### 正常模式
在正常模式下,你可以发出导航和文本编辑命令。这是从 Vi 传统中借用的最明显的功能。编辑命令包括复制、剪切(在传统的 Unix 编辑术语中,称为 “yank”)、粘贴单词和行、撤销、转换字符大小写等功能。下面是一些基础:
* **d**:复制并删除当前选择(现代术语中的“剪切”)
* **c**:复制并删除当前选择,并进入插入模式
* **Esc+Alt+d**:删除当前选择
* **y**:复制选择
* **p**:粘贴
* **&lt;**:取消所选行的缩进
* **u**:撤消
* **U**:重做
* **`**:转为小写
* **~**:转换为大写
### 选择
在 Kakoune 中,你的光标是一个单字符的移动选择。除非你扩展你的选择,否则任何影响选择的命令都只适用当前光标位置。例如,如果你的光标悬停在字母 **n** 上,那么复制命令(正常模式下的 **c**)会将字母 **n** 复制到剪贴板,而粘贴命令(正常模式下的 **p**)则会将字母 **n** 粘贴到缓冲区。
从单个字符扩展选择的最简单方法是进入正常模式,按下 **Shift** 键,同时用方向键移动光标。然而,有几种方法可以根据某些标准来扩展选区。例如,**Alt+l** 将选择区域从光标扩展到当前行的末端。
完整的文档可以在 <https://github.com/mawww/kakoune/blob/master/README.asciidoc> 中找到。
### 函数
除了这些基本的交互,你还可以执行命令来调用 Kakoune 的内置功能。要访问 Kakoune 的命令行,在普通模式下输入 `:`。在命令行中,你可以执行命令,包括打开文件的 **edit** 命令,保存缓冲区到文件的 **write** 命令,当然还有退出应用的 **quit**
还有更多的功能,包括针对特定编程语言和文件格式的特殊选项、使用 [Ranger 文件浏览器][5]浏览文件系统的选项、改变颜色主题、搜索和替换文本等等。
![Kakoune][6]
### 尝试 Kakoune
如果你是一个有经验的 Vim 用户,或者甚至是一个只是略知一二的人,你可能会发现 Kakoune 一开始会让你感到迷惑。它与 Vim 的相似度足以让你陷入一种虚假的熟悉感。一切都与 Vim 一模一样,直到它有了很大的不同。不过,如果你是一个刚接触 Vim 编辑器的新手,或者你是一个正在寻找新挑战的 Vim 用户,那么 Kakoune 可能是你的理想编辑器。
你自己试试吧!
当我刚开始使用 vi 文本编辑器的时候,我很讨厌它。但现在我已经使用 vi 超过17年了。。。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/12/kakoune
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor)
[2]: https://kakoune.org/
[3]: https://opensource.com/article/20/12/vi-text-editor
[4]: https://github.com/mawww/kakoune
[5]: https://opensource.com/article/20/3/ranger-file-navigator
[6]: https://opensource.com/sites/default/files/kakoune-screenshot.png (Kakoune)