mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
translated
This commit is contained in:
parent
b55e746027
commit
f670913b2b
@ -1,105 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why Vim fans love the Herbstluftwm Linux window manager)
|
||||
[#]: via: (https://opensource.com/article/19/12/herbstluftwm-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Why Vim fans love the Herbstluftwm Linux window manager
|
||||
======
|
||||
This article is part of a special series of 24 days of Linux desktops.
|
||||
If you're a Vim fan, check out herbstluftwm, a tile-based Linux window
|
||||
manager that takes the "Vim way" as inspiration.
|
||||
![OpenStack source code \(Python\) in VIM][1]
|
||||
|
||||
Everybody loves Vim (aside from Dvorak and Emacs users). Vim is so popular that there are entire web browsers dedicated to navigating the web with Vim keybindings, a Vim mode in the wildly popular [Zsh][2] terminal emulator, and even a text editor. There's also a window manager called [herbstluftwm][3] that models itself partly after the "Vim way." Herbstluftwm does away with windows, as such, and replaces them with tiles, or quadrants, into which applications are loaded and used. You use the keyboard (**Alt+h**, **Alt+j**, **Alt+k**, and **Alt+l**) to navigate from one tile to another.
|
||||
|
||||
![Herbstluftwm][4]
|
||||
|
||||
Install herbstluftwm from your distribution's software repository. After installing it, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in.
|
||||
|
||||
With GDM:
|
||||
|
||||
![][5]
|
||||
|
||||
With SDDM:
|
||||
|
||||
![][6]
|
||||
|
||||
### Herbstluftwm desktop tour
|
||||
|
||||
The first time you log into herbstluftwm, you are greeted with nothing but a green screen with a darker green border around the edges. What you're seeing is the initial tile with no application loaded into it. To start the default application, xterm, press **Alt+Return**.
|
||||
|
||||
The documentation emphasizes the **$HOME/.config/herbstluftwm/autostart** configuration file as a way to start important applications when you log in. For applications you don't necessarily want to start every time you log in, you can use xterm as your launch daemon. As usual, placing an ampersand (**&**) symbol after the command returns control of the shell to you. To start Emacs, for instance:
|
||||
|
||||
|
||||
```
|
||||
`% emacs &`
|
||||
```
|
||||
|
||||
This launches an Emacs window in a new tile and returns you to a prompt.
|
||||
|
||||
![Emacs running in Herbstluftwm][7]
|
||||
|
||||
#### Switching tiles
|
||||
|
||||
To move from one tile to another, use the classic Vim navigation combination of **h**, **j**, **k**, or **l**, along with the **Alt** key. For example, to switch from the terminal to an application in a tile below it (i.e., at the bottom of the screen), press **Alt+j**. To navigate back up, **Alt+k**. Left and right navigations are **Alt+h** and **Alt+l**, respectively.
|
||||
|
||||
#### Split screen
|
||||
|
||||
You can manually split a screen vertically with **Alt+o** and horizontally with **Alt+u**.
|
||||
|
||||
To remove an empty tile, navigate into it and press **Alt+r**.
|
||||
|
||||
### Configuring herbstluftwm
|
||||
|
||||
Aside from the **Alt** keybindings, you communicate with herbstluftwm through the **herbstclient** command. This command can be used interactively from a shell, or you can preserve your preferences in a configuration file.
|
||||
|
||||
You can view all attributes available in Herbstluftwm with:
|
||||
|
||||
|
||||
```
|
||||
`$ herbstclient attr`
|
||||
```
|
||||
|
||||
Herbstluftwm's default behavior is defined in the default config file, which you can copy to your home directory and modify. Upon launch, herbstluftwm executes the commands contained in the config file. For instance, if you find it awkward to use keybindings centered around the **Alt** key, which is traditionally a key reserved for in-application shortcuts, you can change the key used to trigger herbstluftwm actions in the config file:
|
||||
|
||||
|
||||
```
|
||||
% mkdir ~/.config/herbstluftwm
|
||||
% cp /usr/xdg/herbstluftwm/autostart \
|
||||
~/.config/herbstluftwm
|
||||
% sed -i 's/Mod=Mod1/Mod=Mod4/' ~/.config/herbstluftwm
|
||||
% herbstclient reload
|
||||
```
|
||||
|
||||
This changes the herbstluftwm modifier to the Super key (the "Windows" or "Tux" key, depending on your keyboard).
|
||||
|
||||
Using the autostart file, you can set custom keybindings, create tags for applications of a specific type so you can tile applications in a consistent way, and do much more.
|
||||
|
||||
### Why you need to try herbstluftwm
|
||||
|
||||
Herbstluftwm is a fine example of a tiling window manager. It tiles windows by default and lets the user define exceptions to global rules. It uses Vim-like navigation but allows for quick and easy overrides. It's very likely the tiling manager you've been looking for, so try it soon.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/herbstluftwm-linux-desktop
|
||||
|
||||
作者:[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/openstack_python_vim_2.jpg?itok=4fza48WU (OpenStack source code (Python) in VIM)
|
||||
[2]: https://opensource.com/article/19/9/getting-started-zsh
|
||||
[3]: https://herbstluftwm.org
|
||||
[4]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm.png (Herbstluftwm)
|
||||
[5]: https://opensource.com/sites/default/files/advent-gdm_1.jpg
|
||||
[6]: https://opensource.com/sites/default/files/advent-kdm_0.jpg
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm-emacs.jpg (Emacs running in Herbstluftwm)
|
@ -0,0 +1,104 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why Vim fans love the Herbstluftwm Linux window manager)
|
||||
[#]: via: (https://opensource.com/article/19/12/herbstluftwm-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
为什么 Vim 爱好者喜欢 Herbstluftwm Linux 窗口管理器
|
||||
======
|
||||
本文是 24 天 Linux 桌面特别系列的一部分。如果你是Vim爱好者,请试试 Herbstluftwm,这是一个受到 ”Vim 方式“启发的基于平铺的 Linux 窗口管理器。
|
||||
![OpenStack source code \(Python\) in VIM][1]
|
||||
|
||||
每个人都喜欢 Vim(除了 Dvorak 和 Emacs 用户)。Vim 非常流行,以至于有整个 Web 浏览器都使用 Vim 键绑定来浏览网页,非常流行的 [Zsh][2] 终端仿真器中的 Vim 模式,甚至是文本编辑器。 还有一个名为 [herbstluftwm][3] 的窗口管理器,它部分模仿了 “Vim 方式”。Herbstluftwm 取消了窗口,在程序载入和使用时使用平铺或者象限代替。 你可以使用键盘(**Alt+h**、**Alt+j**、**Alt+k** 和 **Alt+l**)从一个平铺块移动到另一个平铺块。
|
||||
|
||||
![Herbstluftwm][4]
|
||||
|
||||
从发行版软件仓库安装 Herbstluftwm。安装后,请退出当前桌面会话,以便可以登录到新会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,具体取决于你的设置)将继续登录到以前的桌面,因此在登录之前必须覆盖它。
|
||||
|
||||
在 GDM 中:
|
||||
|
||||
![][5]
|
||||
|
||||
在 SDDM 中:
|
||||
|
||||
![][6]
|
||||
|
||||
### Herbstluftwm 桌面之旅
|
||||
|
||||
第一次登录 Herbstluftwm 时,你只会看到绿屏,边缘有深绿色边框。你所看到的是初始平铺,其中没有加载任何应用程序。要启动默认应用,请按 **Alt+回车**。
|
||||
|
||||
文档中强调使用 **$HOME/.config/herbstluftwm/autostart** 作为登录时启动应用的配置文件。对于不必在每次登录时启动的应用,可以使用 xterm 作为启动守护进程。与往常一样,在命令将 shell 的控制权返回给你后加一个 **amp;** 符号。例如,要启动 Emacs:
|
||||
|
||||
|
||||
|
||||
```
|
||||
`% emacs &`
|
||||
```
|
||||
|
||||
这将在新平铺中启动 Emacs 窗口,然后返回命令行。
|
||||
|
||||
![Emacs running in Herbstluftwm][7]
|
||||
|
||||
#### 切换平铺
|
||||
|
||||
要从一个平铺块移动到另一个平铺块,请使用经典的 **h**、**j**、**k** 或 **l** 与 **Alt** 的 Vim 导航组合键。例如,要从终端切换到其下方平铺中的应用(即屏幕底部),请按 **Alt+j**。要返回,请按 **Alt+k**。左移和右移分别为 **Alt+h** 和 **Alt+l**。
|
||||
|
||||
#### 分割屏幕
|
||||
|
||||
你可以使用 **Alt+o** 垂直分割屏幕,使用 **Alt+u** 水平分割屏幕。
|
||||
|
||||
要删除空白平铺块,请移动到该平铺块,然后按 **Alt+r**。
|
||||
|
||||
### 配置 herbstluftwm
|
||||
|
||||
除了 **Alt** 键绑定外,你还可通过 **herbstclient** 命令与 Herbstluftwm 进行通信。此命令可以在 shell 中交互,或者你可在配置文件中保留你的首选项。
|
||||
|
||||
你可以查看 Herbstluftwm 中的所有可用属性:
|
||||
|
||||
|
||||
```
|
||||
`$ herbstclient attr`
|
||||
```
|
||||
|
||||
Herbstluftwm 的默认行为在默认配置文件中定义,你可以将其复制到家目录并进行修改。启动后,Herbstluftwm 执行配置文件中包含的命令。例如,你觉得使用以 **Alt** 为中心的键绑定很笨拙(它传统上是应用内保留快捷键),那你可以在配置文件中更改触发 Herbstluftwm 操作的键:
|
||||
|
||||
|
||||
```
|
||||
% mkdir ~/.config/herbstluftwm
|
||||
% cp /usr/xdg/herbstluftwm/autostart \
|
||||
~/.config/herbstluftwm
|
||||
% sed -i 's/Mod=Mod1/Mod=Mod4/' ~/.config/herbstluftwm
|
||||
% herbstclient reload
|
||||
```
|
||||
|
||||
这将使 Herbstluftwm 的修饰键更改为 Super 键(”Windows“或 ”Tux“ 键,具体取决于你的键盘)。
|
||||
|
||||
使用自动启动文件,你可以设置自定义键绑定,为特定类型的应用创建标签,以便以一致的方式平铺应用,并执行更多操作。
|
||||
|
||||
### 为何你要尝试 herbstluftwm
|
||||
|
||||
Herbstluftwm 是一个平铺窗口管理器的很好例子。它默认平铺窗口,并允许用户定义全局规则例外。它使用类似 Vim 的导航,但可以快速简单地覆盖它。你可能是你一直在寻找的平铺管理器,所以请尽快尝试一下。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/herbstluftwm-linux-desktop
|
||||
|
||||
作者:[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/openstack_python_vim_2.jpg?itok=4fza48WU (OpenStack source code (Python) in VIM)
|
||||
[2]: https://opensource.com/article/19/9/getting-started-zsh
|
||||
[3]: https://herbstluftwm.org
|
||||
[4]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm.png (Herbstluftwm)
|
||||
[5]: https://opensource.com/sites/default/files/advent-gdm_1.jpg
|
||||
[6]: https://opensource.com/sites/default/files/advent-kdm_0.jpg
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm-emacs.jpg (Emacs running in Herbstluftwm)
|
Loading…
Reference in New Issue
Block a user