「Lf」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版から転載)
 
(一部翻訳)
10行目: 10行目:
 
{{Related articles end}}
 
{{Related articles end}}
   
  +
[https://github.com/gokcehan/lf lf] (''リストファイル'') は、[[ranger]] から大きなインスピレーションを受けて Go で書かれたターミナルファイルマネージャーです。優れた機能は、高速起動と低メモリ使用量、サーバー/クライアントアーキテクチャ、高度なカスタマイズです。ranger とは異なり、タブやウィンドウなどの一部の機能は意図的に含まれておらず、代わりにウィンドウマネージャーまたはターミナルマルチプレクサによって処理されます。
[https://github.com/gokcehan/lf lf] (as in "list files") is a terminal file manager written in Go with a heavy inspiration from [[ranger]]. Outstanding features are a fast startup and low memory footprint, a server/client architecture and high customization. Unlike ranger, some features like tabs or windows are intentionally not included and instead left to be handled by window manager or terminal multiplexer.
 
   
== Installation ==
+
== インストール ==
   
  +
{{Pkg|lf}} パッケージを [[インストール]] します。
[[Install]] the {{Pkg|lf}} package.
 
   
== Usage ==
+
== 使い方 ==
   
  +
アプリケーションを起動するには、[[アプリケーション一覧#ターミナルエミュレータ|ターミナル]] を起動し、{{ic|lf}} を実行します。
To start the application, launch a [[List of applications#Terminal emulators|terminal]] and run {{ic|lf}}.
 
  +
デフォルトのキーバインドは vim のキーバインドに似ていますが、ranger のデフォルトとはいくつかの違いがあります。
The default keybindings are similar to those of vim with some difference from rangers default.
 
   
== Configuration ==
+
== 設定 ==
   
 
Copy the default configuration at {{ic|/usr/share/doc/lf/lfrc.example}} to {{ic|~/.config/lf/lfrc}} to use as a template for further customization. Some common features are already included as comments in the configuration example. For more extensive configurations see the [https://pkg.go.dev/github.com/gokcehan/lf documentation]. Useful configuration examples from the community can also be found on [https://github.com/gokcehan/lf/wiki/ GitHub].
 
Copy the default configuration at {{ic|/usr/share/doc/lf/lfrc.example}} to {{ic|~/.config/lf/lfrc}} to use as a template for further customization. Some common features are already included as comments in the configuration example. For more extensive configurations see the [https://pkg.go.dev/github.com/gokcehan/lf documentation]. Useful configuration examples from the community can also be found on [https://github.com/gokcehan/lf/wiki/ GitHub].

2023年7月20日 (木) 21:02時点における版

関連記事

lf (リストファイル) は、ranger から大きなインスピレーションを受けて Go で書かれたターミナルファイルマネージャーです。優れた機能は、高速起動と低メモリ使用量、サーバー/クライアントアーキテクチャ、高度なカスタマイズです。ranger とは異なり、タブやウィンドウなどの一部の機能は意図的に含まれておらず、代わりにウィンドウマネージャーまたはターミナルマルチプレクサによって処理されます。

インストール

lf パッケージを インストール します。

使い方

アプリケーションを起動するには、ターミナル を起動し、lf を実行します。 デフォルトのキーバインドは vim のキーバインドに似ていますが、ranger のデフォルトとはいくつかの違いがあります。

設定

Copy the default configuration at /usr/share/doc/lf/lfrc.example to ~/.config/lf/lfrc to use as a template for further customization. Some common features are already included as comments in the configuration example. For more extensive configurations see the documentation. Useful configuration examples from the community can also be found on GitHub.

Tips and tricks

Using rifle file opener

lf can use the file opener rifle which is included in the ranger package.

Set an environment variable to automatically use rifle to open files in the related applications.

export OPENER='rifle' 

For editing file, you can also set your default editor:

export EDITOR='vim'

Previewing files

To automatically preview contents from currently selected files, set a custom previewer script in lfrc. It is possible to simple use the scope.sh script from ranger which serves as a good template for customization.

set previewer "~/.config/ranger/scope.sh"

Sandboxing previews

While the default lf configuration only previews text files, using more complex preview parsers is somewhat dangerous. In case there is a vulnerability in a preview parser like pdftotext, it is possible to use this simple script to sandbox the previewer using bubblewrap :

~/.config/lf/previewSandbox.sh
#!/bin/bash
set -euo pipefail
(
    exec bwrap \
     --ro-bind /usr/bin /usr/bin \
     --ro-bind /usr/share/ /usr/share/ \
     --ro-bind /usr/lib /usr/lib \
     --ro-bind /usr/lib64 /usr/lib64 \
     --symlink /usr/bin /bin \
     --symlink /usr/bin /sbin \
     --symlink /usr/lib /lib \
     --symlink /usr/lib64 /lib64 \
     --proc /proc \
     --dev /dev  \
     --ro-bind /etc /etc \
     --ro-bind ~/.config ~/.config \
     --ro-bind ~/.cache ~/.cache \
     --ro-bind "$PWD" "$PWD" \
     --unshare-all \
     --new-session \
     bash ~/.config/lf/preview.sh "$@"
)

Set your previewer to the sandbox script and have your real preview script at ~/.config/lf/preview.sh:

set previewer ~/.config/lf/previewSandbox.sh

See also