rufio 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +26 -368
- data/README_ja.md +24 -330
- data/docs/guide.md +410 -0
- data/docs/guide_ja.md +410 -0
- data/info/help.md +52 -17
- data/info/keybindings.md +48 -22
- data/info/welcome.md +13 -4
- data/lib/rufio/command_completion.rb +22 -1
- data/lib/rufio/command_mode.rb +20 -0
- data/lib/rufio/config_loader.rb +1 -0
- data/lib/rufio/dialog_renderer.rb +26 -0
- data/lib/rufio/file_operations.rb +28 -6
- data/lib/rufio/global_search.rb +4 -4
- data/lib/rufio/help_menu.rb +11 -5
- data/lib/rufio/keybind_handler.rb +2 -1
- data/lib/rufio/navigation_controller.rb +2 -6
- data/lib/rufio/path_jump.rb +55 -0
- data/lib/rufio/terminal_ui.rb +29 -4
- data/lib/rufio/ui_renderer.rb +10 -5
- data/lib/rufio/version.rb +1 -1
- data/lib/rufio.rb +1 -0
- metadata +5 -2
data/docs/guide_ja.md
ADDED
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
# rufio 操作ガイド
|
|
2
|
+
|
|
3
|
+
**日本語** | [English](./guide.md)
|
|
4
|
+
|
|
5
|
+
rufio 1.3 以降の操作をまとめたガイドです。インストールと概要は [README](../README_ja.md) を参照してください。
|
|
6
|
+
rufio の中ではいつでも `?` でヘルプメニューを開けます。
|
|
7
|
+
|
|
8
|
+
## 目次
|
|
9
|
+
|
|
10
|
+
- [画面とモード](#画面とモード)
|
|
11
|
+
- [移動](#移動)
|
|
12
|
+
- [プレビュー](#プレビュー)
|
|
13
|
+
- [ファイル操作](#ファイル操作)
|
|
14
|
+
- [ZIP の展開・圧縮](#zip-の展開圧縮)
|
|
15
|
+
- [フィルターと検索](#フィルターと検索)
|
|
16
|
+
- [横断検索(G モード)](#横断検索g-モード)
|
|
17
|
+
- [ブックマークと履歴](#ブックマークと履歴)
|
|
18
|
+
- [コマンドモード](#コマンドモード)
|
|
19
|
+
- [スクリプト](#スクリプト)
|
|
20
|
+
- [DSL コマンド](#dsl-コマンド)
|
|
21
|
+
- [ジョブとログ](#ジョブとログ)
|
|
22
|
+
- [Config モード](#config-モード)
|
|
23
|
+
- [シェル連携](#シェル連携)
|
|
24
|
+
- [設定](#設定)
|
|
25
|
+
- [外部ツール](#外部ツール)
|
|
26
|
+
- [コマンドラインオプション](#コマンドラインオプション)
|
|
27
|
+
- [ネイティブエンジン](#ネイティブエンジン)
|
|
28
|
+
|
|
29
|
+
## 画面とモード
|
|
30
|
+
|
|
31
|
+
Files モードでは、最上段に現在のパス、その下にブックマーク一覧、左にファイル一覧、右にプレビューを表示します。最下段はモードのタブです。
|
|
32
|
+
|
|
33
|
+
| キー | モード |
|
|
34
|
+
|------|--------|
|
|
35
|
+
| (起動時) | **Files** – ファイルの閲覧と操作 |
|
|
36
|
+
| `C` | **Config** – `~/.config/rufio/` を Files と同じ操作で閲覧 |
|
|
37
|
+
| `G` | **Search** – 全ブックマーク配下のファイル名・内容を横断検索 |
|
|
38
|
+
| `L` | **Logs** – コマンド実行ログの閲覧 |
|
|
39
|
+
| `J` | **Jobs** – バックグラウンドのコマンド・スクリプト・ZIP 処理 |
|
|
40
|
+
| `?` | **Help** – 現在の画面の上に開くヘルプメニュー |
|
|
41
|
+
|
|
42
|
+
`ESC` で現在のモードを抜けます。Files・Config 以外のモードでは、`Shift+Tab` で前のモードに切り替わります。
|
|
43
|
+
|
|
44
|
+
## 移動
|
|
45
|
+
|
|
46
|
+
| キー | 操作 |
|
|
47
|
+
|------|------|
|
|
48
|
+
| `j` / `↓` | 下へ |
|
|
49
|
+
| `k` / `↑` | 上へ |
|
|
50
|
+
| `h` / `←` | 親ディレクトリへ |
|
|
51
|
+
| `l` / `→` / `Enter` | ディレクトリに入る |
|
|
52
|
+
| `g` | 先頭へ |
|
|
53
|
+
| `}` | 末尾へ |
|
|
54
|
+
| `R` | 再読み込み |
|
|
55
|
+
| `0` | 起動したディレクトリへ戻る |
|
|
56
|
+
| `q` | 終了(確認あり) |
|
|
57
|
+
| `T` | 終了して、シェルを現在のディレクトリへ移動([シェル連携](#シェル連携)) |
|
|
58
|
+
|
|
59
|
+
マウスでも、クリックで選択、ホイールで一覧やプレビューをスクロールできます。
|
|
60
|
+
|
|
61
|
+
## プレビュー
|
|
62
|
+
|
|
63
|
+
右側のペインに選択中のファイルを表示します。`bat` があればコードをハイライトします。`.zip` は展開せずにエントリ一覧(サイズ・圧縮方式・更新日時・名前)を表示します。
|
|
64
|
+
|
|
65
|
+
| キー | 操作 |
|
|
66
|
+
|------|------|
|
|
67
|
+
| `P` | 全画面プレビュー(ファイル一覧を隠す) |
|
|
68
|
+
| `j` / `k` | スクロール |
|
|
69
|
+
| `Ctrl+D` / `Ctrl+U` | 1 ページ下 / 上 |
|
|
70
|
+
| `ESC` | ファイル一覧に戻る |
|
|
71
|
+
|
|
72
|
+
## ファイル操作
|
|
73
|
+
|
|
74
|
+
| キー | 操作 |
|
|
75
|
+
|------|------|
|
|
76
|
+
| `o` | ファイルを対応するアプリで開く([設定](#設定) の `APPLICATIONS`) |
|
|
77
|
+
| `e` | 現在のディレクトリを OS のファイルエクスプローラーで開く |
|
|
78
|
+
| `a` | ファイル作成 |
|
|
79
|
+
| `A` | ディレクトリ作成 |
|
|
80
|
+
| `r` | リネーム |
|
|
81
|
+
| `d` | 削除(確認あり) |
|
|
82
|
+
| `Space` | 選択 / 選択解除 |
|
|
83
|
+
| `m` | 選択したアイテムを現在のディレクトリへ移動 |
|
|
84
|
+
| `c` | 選択したアイテムを現在のディレクトリへコピー |
|
|
85
|
+
| `x` | 選択したアイテムを削除(確認あり) |
|
|
86
|
+
|
|
87
|
+
移動・コピーは、`Space` で選択してから移動先のディレクトリへ行き、`m` または `c` を押します。
|
|
88
|
+
コピー先に同じ名前がある場合は連番を付けてコピーします(`name_1.txt`、`dir_1`)。移動先に同じ名前がある場合はエラーになります。
|
|
89
|
+
|
|
90
|
+
## ZIP の展開・圧縮
|
|
91
|
+
|
|
92
|
+
`Space` でアイテムを選択して `z` を押します。
|
|
93
|
+
|
|
94
|
+
- **選択がすべて `.zip` の場合**: それぞれを現在のディレクトリの `<名前>/` に展開します(同名があれば `<名前> 2/`、`<名前> 3/` …)
|
|
95
|
+
- **それ以外の場合**: アーカイブ名を尋ねたうえで、選択したアイテムを現在のディレクトリに 1 つの `.zip` として圧縮します。`Enter` で提案された名前(1 件なら `<アイテム名>.zip`、複数なら `Archive.zip`)を使います
|
|
96
|
+
|
|
97
|
+
処理はジョブとして実行されます。進捗の確認とキャンセルは Jobs モードで行います(`J` → `x`)。展開に失敗・キャンセルした場合は途中まで展開したフォルダを削除し、完了するとファイル一覧を更新します。
|
|
98
|
+
|
|
99
|
+
展開時は書き込み前にアーカイブ全体を検証します。パストラバーサル・絶対パス・データ範囲が重なるエントリ、合計 16 GiB・10 万エントリ・圧縮率 1000:1(1 MiB 超のエントリ)を超えるアーカイブを拒否します。シンボリックリンクと暗号化エントリはスキップし、CRC-32 を検証し、既存ファイルは上書きしません。対応する圧縮方式は Stored と Deflate です。
|
|
100
|
+
|
|
101
|
+
何も選択していないときの `z` は zoxide 履歴を開きます。
|
|
102
|
+
|
|
103
|
+
## フィルターと検索
|
|
104
|
+
|
|
105
|
+
| キー | 操作 |
|
|
106
|
+
|------|------|
|
|
107
|
+
| `f` | 入力に合わせて一覧を絞り込む(`Enter` で確定、`ESC` で解除) |
|
|
108
|
+
| `s` または `/` | fzf でファイル名検索 |
|
|
109
|
+
| `F` | rga でファイル内容検索 |
|
|
110
|
+
| `G` | 全ブックマークを横断検索(外部ツール不要) |
|
|
111
|
+
|
|
112
|
+
## 横断検索(G モード)
|
|
113
|
+
|
|
114
|
+
`G` で、ブックマークした全ディレクトリの配下を再帰的に検索します。先に `b` でブックマークを登録してください。
|
|
115
|
+
|
|
116
|
+
| キー | 操作 |
|
|
117
|
+
|------|------|
|
|
118
|
+
| 文字入力 | 大文字・小文字を区別しない部分一致検索 |
|
|
119
|
+
| `Tab` | **File names(ファイル名)** と **Content(内容)** を切り替え |
|
|
120
|
+
| `↑` / `↓`、`Ctrl+J` / `Ctrl+K`、`Ctrl+N` / `Ctrl+P` | 結果を選択 |
|
|
121
|
+
| `Enter` | Files モードでそのファイルの場所へ移動 |
|
|
122
|
+
| `Ctrl+U` | 検索語をクリア |
|
|
123
|
+
| `ESC` | 元のモードに戻る |
|
|
124
|
+
|
|
125
|
+
- 一致箇所はハイライトされます。内容検索ではファイル・行番号・一致した行を表示します。
|
|
126
|
+
- 検索中は黄色の `Searching...` が動き、完了すると緑の `Search complete` に変わります。
|
|
127
|
+
- アクセスできないディレクトリとディレクトリのシンボリックリンクはスキップします。通常のテキストは UTF-8 として読み、先頭 8 KB に NUL バイトがあるファイルはバイナリとして扱います。
|
|
128
|
+
|
|
129
|
+
### 文書の内容検索
|
|
130
|
+
|
|
131
|
+
Python・Microsoft Office・変換ツールなしで文書の中も検索できます。
|
|
132
|
+
|
|
133
|
+
| ファイル | 検索する内容 | 結果の位置 |
|
|
134
|
+
|----------|--------------|------------|
|
|
135
|
+
| `.pdf` | 抽出できる文字列 | ページ |
|
|
136
|
+
| `.xlsx` | セルの文字列と保存済みの値 | シートとセル |
|
|
137
|
+
| `.pptx` | スライドの図形・表内の文字列 | スライド |
|
|
138
|
+
|
|
139
|
+
抽出した文字列はメモリにキャッシュし(最大 64 文書・約 16 MiB)、ファイルが変わると再抽出します。画像だけの PDF には OCR が必要で、これは含みません。旧形式の `.xls` / `.ppt` とスライドノートは対象外です。
|
|
140
|
+
|
|
141
|
+
### 拡張子の除外
|
|
142
|
+
|
|
143
|
+
`~/.config/rufio/config.rb` に次を追加して rufio を再起動します。ファイル名・内容の両方に適用されます。
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
GLOBAL_SEARCH_EXCLUDED_EXTENSIONS = %w[.png .jpg .zip .tar.gz .log].freeze
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
大文字・小文字は区別せず、先頭のドットは省略できます。デフォルトの `[]` は何も除外しません。
|
|
150
|
+
|
|
151
|
+
## ブックマークと履歴
|
|
152
|
+
|
|
153
|
+
| キー | 操作 |
|
|
154
|
+
|------|------|
|
|
155
|
+
| `b` | 現在のディレクトリをブックマーク |
|
|
156
|
+
| `B` | ブックマークメニュー |
|
|
157
|
+
| `1`〜`9` | ブックマーク 1〜9 へ移動 |
|
|
158
|
+
| `Tab` / `Shift+Tab` | 次 / 前のブックマークへ(Files・Config モード) |
|
|
159
|
+
| `z` | zoxide 履歴(何も選択していないとき) |
|
|
160
|
+
|
|
161
|
+
`B` のメニュー:
|
|
162
|
+
|
|
163
|
+
1. 現在のディレクトリをブックマークに追加
|
|
164
|
+
2. 現在のディレクトリをスクリプトパスに追加
|
|
165
|
+
3. スクリプトパスの管理(`d` で削除、`Enter` で移動、`ESC` で閉じる)
|
|
166
|
+
4. ブックマーク一覧
|
|
167
|
+
|
|
168
|
+
## コマンドモード
|
|
169
|
+
|
|
170
|
+
`:` でコマンドモードを開きます。`Tab` で補完、`↑` / `↓` で履歴、`Enter` で実行、`ESC` でキャンセルです。
|
|
171
|
+
|
|
172
|
+
| 入力 | 動作 |
|
|
173
|
+
|------|------|
|
|
174
|
+
| `@名前` | スクリプトパスまたは現在のディレクトリのスクリプトを実行 |
|
|
175
|
+
| `rake:タスク` | 現在のディレクトリの `Rakefile` のタスクを実行 |
|
|
176
|
+
| `!コマンド` | シェルコマンドをバックグラウンドで実行 |
|
|
177
|
+
| `cd <パス>` | ディレクトリへ移動 |
|
|
178
|
+
| `名前` | 組み込みコマンド・DSL コマンドを実行 |
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
:@build # スクリプト(Tab で名前を補完)
|
|
182
|
+
:rake:test # Rake タスク(Rakefile・rakefile・Rakefile.rb に対応)
|
|
183
|
+
:!git status # シェルコマンド
|
|
184
|
+
:hello # 組み込みのサンプルコマンド
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### パスへ移動
|
|
188
|
+
|
|
189
|
+
`:cd` の後ろにパスを貼り付けると、その場所へ移動します。
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
:cd ~/projects/app # ディレクトリ
|
|
193
|
+
:cd '/path/with space/a.txt' # ファイル: フォルダへ移動してそのファイルを選択
|
|
194
|
+
:cd sub # 現在のディレクトリからの相対パス
|
|
195
|
+
:cd - # 直前のディレクトリへ戻る
|
|
196
|
+
:cd # ホームディレクトリ
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
コピー時に付く両端の引用符・末尾の改行・`\ ` エスケープ・`file://` URL はそのまま受け付けます。`Tab` でディレクトリ名を補完できます。パスが存在しない場合は移動せずにエラーを表示します。
|
|
200
|
+
|
|
201
|
+
## スクリプト
|
|
202
|
+
|
|
203
|
+
登録したスクリプトパスと、いま開いているディレクトリにあるスクリプトを `:@名前` で実行できます。実行時の作業ディレクトリは、いま開いているディレクトリです。
|
|
204
|
+
|
|
205
|
+
| 拡張子 | 実行に使うもの |
|
|
206
|
+
|--------|----------------|
|
|
207
|
+
| `.rb` | Ruby |
|
|
208
|
+
| `.py` | Python 3 |
|
|
209
|
+
| `.sh` | シェル |
|
|
210
|
+
| `.js` | Node.js |
|
|
211
|
+
| `.ts` | ts-node |
|
|
212
|
+
| `.pl` | Perl |
|
|
213
|
+
| `.ps1` | PowerShell |
|
|
214
|
+
|
|
215
|
+
スクリプトパスは次の順に探し、最初に名前が一致したものを使います。
|
|
216
|
+
|
|
217
|
+
1. プロジェクトの `./rufio.yml`
|
|
218
|
+
2. `~/.config/rufio/script_paths.yml`
|
|
219
|
+
3. `/etc/rufio/script_paths.yml`
|
|
220
|
+
|
|
221
|
+
ディレクトリを登録するには、rufio でそのディレクトリを開いて `B` → `2` を押します。
|
|
222
|
+
|
|
223
|
+
## DSL コマンド
|
|
224
|
+
|
|
225
|
+
`~/.config/rufio/commands.rb`(`~/.rufio/commands.rb` も可)に独自コマンドを定義し、`:名前` で実行します。
|
|
226
|
+
|
|
227
|
+
```ruby
|
|
228
|
+
command "hello" do
|
|
229
|
+
ruby { "Hello from rufio!" }
|
|
230
|
+
description "挨拶コマンド"
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
command "status" do
|
|
234
|
+
shell "git status"
|
|
235
|
+
description "Gitステータス"
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
command "build" do
|
|
239
|
+
script "~/.config/rufio/scripts/build.rb"
|
|
240
|
+
description "ビルド実行"
|
|
241
|
+
end
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## ジョブとログ
|
|
245
|
+
|
|
246
|
+
シェルコマンド・スクリプト・ZIP 処理はバックグラウンドで実行され、その間もファイル操作を続けられます。ジョブが終わると通知が出ます。
|
|
247
|
+
|
|
248
|
+
**Jobs モード(`J`)**
|
|
249
|
+
|
|
250
|
+
| キー | 操作 |
|
|
251
|
+
|------|------|
|
|
252
|
+
| `j` / `k` | ジョブを選択 |
|
|
253
|
+
| `g` / `G` | 先頭 / 末尾のジョブ |
|
|
254
|
+
| `Space` | ジョブのログを表示 |
|
|
255
|
+
| `x` | 選択したジョブをキャンセル |
|
|
256
|
+
| `ESC` | 戻る |
|
|
257
|
+
|
|
258
|
+
**Logs モード(`L`)** は `~/.config/rufio/logs/` の実行ログを一覧表示します。`P` でログをプレビューし、`ESC` でプレビューを閉じ、もう一度 `ESC` で Files に戻ります。
|
|
259
|
+
|
|
260
|
+
## Config モード
|
|
261
|
+
|
|
262
|
+
`C` で `~/.config/rufio/` を開きます(なければ作成します)。移動・プレビュー・ファイル操作は Files モードと同じなので、設定やスクリプトを直接編集できます。設定ディレクトリの外へ移動すると Files モードに戻ります。
|
|
263
|
+
|
|
264
|
+
## シェル連携
|
|
265
|
+
|
|
266
|
+
`rufio --shell-init` は `rf` というシェル関数を出力します。`rf` で rufio を起動して `T` を押すと、終了してシェルが表示中のディレクトリへ移動します。`q` で終了した場合は移動しません。
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# bash / zsh(~/.bashrc または ~/.zshrc)
|
|
270
|
+
eval "$(rufio --shell-init)"
|
|
271
|
+
|
|
272
|
+
# fish(~/.config/fish/config.fish)
|
|
273
|
+
rufio --shell-init fish | source
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
```powershell
|
|
277
|
+
# PowerShell($PROFILE)
|
|
278
|
+
Invoke-Expression (& rufio --shell-init powershell | Out-String)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
引数を省略すると、Windows では PowerShell 用、それ以外ではログインシェル(`bash`・`zsh`・`fish`)用を出力します。シェル起動のたびに Ruby を起動したくない場合は、`rufio --shell-init >> ~/.bashrc` のように一度だけ出力を追記してください。
|
|
282
|
+
|
|
283
|
+
## 設定
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
~/.config/rufio/
|
|
287
|
+
├── config.rb # メイン設定(Ruby の定数)
|
|
288
|
+
├── script_paths.yml # スクリプトパス
|
|
289
|
+
├── bookmarks.yml # ブックマーク
|
|
290
|
+
├── commands.rb # DSL コマンド
|
|
291
|
+
├── scripts/ # 個人スクリプト
|
|
292
|
+
└── logs/ # 実行ログ
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### config.rb
|
|
296
|
+
|
|
297
|
+
```ruby
|
|
298
|
+
# ~/.config/rufio/config.rb
|
|
299
|
+
|
|
300
|
+
# 'en' または 'ja'(環境変数 RUFIO_LANG でも指定可)
|
|
301
|
+
LANGUAGE = 'ja'
|
|
302
|
+
|
|
303
|
+
# 色(HSL)
|
|
304
|
+
COLORS = {
|
|
305
|
+
directory: { hsl: [220, 80, 60] },
|
|
306
|
+
file: { hsl: [0, 0, 90] },
|
|
307
|
+
executable: { hsl: [120, 70, 50] },
|
|
308
|
+
selected: { hsl: [50, 90, 70] },
|
|
309
|
+
preview: { hsl: [180, 60, 65] }
|
|
310
|
+
}.freeze
|
|
311
|
+
|
|
312
|
+
# キーの変更はアクション名で指定する。値は 1 キーの文字列
|
|
313
|
+
KEYBINDS = {
|
|
314
|
+
bottom: 'G',
|
|
315
|
+
global_search: 'S'
|
|
316
|
+
}.freeze
|
|
317
|
+
|
|
318
|
+
# `o` で使うアプリ(拡張子ごと)
|
|
319
|
+
APPLICATIONS = {
|
|
320
|
+
%w[txt md rb py js json yml] => 'code',
|
|
321
|
+
:default => 'open'
|
|
322
|
+
}.freeze
|
|
323
|
+
|
|
324
|
+
# G モードの検索から除外する拡張子
|
|
325
|
+
GLOBAL_SEARCH_EXCLUDED_EXTENSIONS = %w[.log].freeze
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
`KEYBINDS` で使えるアクション名:
|
|
329
|
+
|
|
330
|
+
| 分類 | アクション(デフォルトキー) |
|
|
331
|
+
|------|------------------------------|
|
|
332
|
+
| 移動 | `move_up` (k), `move_down` (j), `navigate_parent` (h), `navigate_enter` (l), `top` (g), `bottom` (}), `refresh` (R) |
|
|
333
|
+
| ファイル | `open_file` (o), `preview` (P), `rename` (r), `delete` (d), `create_file` (a), `create_dir` (A), `move_selected` (m), `copy_selected` (c), `delete_selected` (x), `open_explorer` (e) |
|
|
334
|
+
| 選択・検索 | `select` (Space), `filter` (f), `fzf_search` (s), `fzf_search_alt` (/), `rga_search` (F) |
|
|
335
|
+
| ブックマーク | `add_bookmark` (b), `bookmark_menu` (B), `zoxide` (z), `start_dir` (0) |
|
|
336
|
+
| モード | `job_mode` (J), `global_search` (G), `config_mode` (C), `help` (?), `log_viewer` (L), `command_mode` (:), `quit` (q), `quit_cd` (T) |
|
|
337
|
+
|
|
338
|
+
### script_paths.yml と bookmarks.yml
|
|
339
|
+
|
|
340
|
+
```yaml
|
|
341
|
+
# ~/.config/rufio/script_paths.yml
|
|
342
|
+
- ~/.config/rufio/scripts
|
|
343
|
+
- ~/bin
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
```yaml
|
|
347
|
+
# ~/.config/rufio/bookmarks.yml
|
|
348
|
+
- path: ~/Documents
|
|
349
|
+
name: Documents
|
|
350
|
+
- path: ~/projects
|
|
351
|
+
name: Projects
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### プロジェクト設定
|
|
355
|
+
|
|
356
|
+
プロジェクトのルートに `rufio.yml` を置くと、そのプロジェクト用のスクリプトパスを追加できます。
|
|
357
|
+
|
|
358
|
+
```yaml
|
|
359
|
+
# ./rufio.yml
|
|
360
|
+
script_paths:
|
|
361
|
+
- ./scripts
|
|
362
|
+
- ./bin
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## 外部ツール
|
|
366
|
+
|
|
367
|
+
すべて任意です。インストールしていなければ、その機能を無効にするか組み込みの動作に切り替えます。`rufio -c` で検出状況を確認できます。
|
|
368
|
+
|
|
369
|
+
| ツール | 用途 | キー |
|
|
370
|
+
|--------|------|------|
|
|
371
|
+
| fzf | ファイル名検索 | `s`、`/` |
|
|
372
|
+
| rga | ファイル内容検索 | `F` |
|
|
373
|
+
| zoxide | ディレクトリ履歴 | `z` |
|
|
374
|
+
| bat | プレビューのシンタックスハイライト | — |
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# macOS
|
|
378
|
+
brew install fzf bat rga zoxide
|
|
379
|
+
|
|
380
|
+
# Ubuntu/Debian
|
|
381
|
+
apt install fzf bat zoxide
|
|
382
|
+
# rga: https://github.com/phiresky/ripgrep-all
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## コマンドラインオプション
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
rufio [DIRECTORY] # DIRECTORY で起動(省略時はカレントディレクトリ)
|
|
389
|
+
rufio -c # 依存関係をチェック(--check-health)
|
|
390
|
+
rufio --shell-init [SHELL] # rf シェル関数を出力
|
|
391
|
+
rufio --yjit # YJIT を有効化(Ruby 3.1+)
|
|
392
|
+
rufio --zjit # ZJIT を有効化(Ruby 3.4+)
|
|
393
|
+
rufio --native # 実験的なネイティブディレクトリスキャナー
|
|
394
|
+
rufio --test # FPS カウンターを表示
|
|
395
|
+
rufio -h # ヘルプ
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## ネイティブエンジン
|
|
399
|
+
|
|
400
|
+
gem には macOS(arm64/x86_64)、Linux(x86_64/aarch64、glibc 2.17 以降または musl)、Windows(x64/arm64)向けの Zig ライブラリが同梱されています。その他のプラットフォームでは自動的に Ruby 実装を使います。
|
|
401
|
+
|
|
402
|
+
- **G モードの内容検索**: 並列スキャンとメモリ上のファイルキャッシュで、再検索は `rg` の約 10 倍速くなります。大文字・小文字のある非 ASCII 文字を含む検索語は Ruby で検索します。`RUFIO_NATIVE_SEARCH=0` で無効化できます。
|
|
403
|
+
- **ZIP**: エントリの伸長と 1 MiB 以上のファイルの圧縮を並列に行います(4 CPU・64 MB × 8 ファイルの計測で、Ruby より圧縮が約 4.6 倍、展開が約 3.2 倍高速)。アーカイブの検証は常に Ruby 側で行います。`RUFIO_NATIVE_ZIP=0` で無効化できます。
|
|
404
|
+
|
|
405
|
+
同梱バイナリの再ビルド(Zig 0.17 が必要):
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
bundle exec rake native:build # 全プラットフォーム
|
|
409
|
+
bundle exec rake native:check # 同梱バイナリの検証
|
|
410
|
+
```
|
data/info/help.md
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
- [Bookmarks & Navigation](#bookmarks--navigation)
|
|
12
12
|
- [Command Mode](#command-mode)
|
|
13
13
|
- [Tool Runtime](#tool-runtime)
|
|
14
|
-
- [Mode
|
|
14
|
+
- [Global Search & Config Mode](#global-search--config-mode)
|
|
15
|
+
- [Modes & Help Menu](#modes--help-menu)
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
@@ -24,22 +25,26 @@
|
|
|
24
25
|
| `j` or `Down` | Move down one item |
|
|
25
26
|
| `k` or `Up` | Move up one item |
|
|
26
27
|
| `h` or `Left` | Go to parent directory |
|
|
27
|
-
| `l`, `Enter`, or `Right` | Enter directory
|
|
28
|
+
| `l`, `Enter`, or `Right` | Enter directory |
|
|
29
|
+
| `P` | Fullscreen file preview (`Esc` returns to the file list) |
|
|
28
30
|
| `g` | Jump to top of list |
|
|
29
|
-
| `
|
|
31
|
+
| `}` | Jump to bottom of list |
|
|
30
32
|
|
|
31
33
|
### File Operations
|
|
32
34
|
|
|
33
35
|
| Key | Action |
|
|
34
36
|
|-----|--------|
|
|
35
37
|
| `o` | Open file with external editor |
|
|
36
|
-
| `e` | Open in file explorer |
|
|
38
|
+
| `e` | Open current directory in file explorer |
|
|
37
39
|
| `R` | Refresh directory contents |
|
|
38
40
|
| `r` | Rename file or directory |
|
|
39
41
|
| `d` | Delete file or directory (with confirmation) |
|
|
40
42
|
| `a` | Create new file |
|
|
41
43
|
| `A` | Create new directory |
|
|
42
44
|
|
|
45
|
+
In a preview, `j/k` scroll, `Ctrl+D/U` page down/up and `ESC` returns to the file list.
|
|
46
|
+
`.zip` previews list the archive entries (size, method, modified time, name) without extracting them.
|
|
47
|
+
|
|
43
48
|
### File Selection & Bulk Operations
|
|
44
49
|
|
|
45
50
|
| Key | Action |
|
|
@@ -50,13 +55,17 @@
|
|
|
50
55
|
| `x` | Delete selected items |
|
|
51
56
|
| `z` | With selected items: extract when all are `.zip` files (each into `<name>/`), otherwise compress them into one `.zip` (runs as a job). Without a selection, `z` opens zoxide history |
|
|
52
57
|
|
|
58
|
+
ZIP jobs show progress in Jobs mode (`J`). `x`: Cancel the selected job there; a partially extracted folder is removed.
|
|
59
|
+
|
|
53
60
|
### Filtering & Search
|
|
54
61
|
|
|
55
62
|
| Key | Action |
|
|
56
63
|
|-----|--------|
|
|
57
64
|
| `f` | Start filter mode |
|
|
58
65
|
| `s` | Search file names with fzf |
|
|
66
|
+
| `/` | Search file names with fzf (same as `s`) |
|
|
59
67
|
| `F` | Search file contents with rga (ripgrep-all) |
|
|
68
|
+
| `G` | Global search: file names or contents across all bookmarks |
|
|
60
69
|
|
|
61
70
|
**Filter Mode:**
|
|
62
71
|
- Type characters to filter files in real-time
|
|
@@ -71,7 +80,9 @@
|
|
|
71
80
|
| `B` | Bookmark menu (view/add/remove/script paths) |
|
|
72
81
|
| `0` | Jump to startup directory |
|
|
73
82
|
| `1-9` | Jump to bookmark 1-9 |
|
|
74
|
-
| `
|
|
83
|
+
| `Tab` | Cycle to next bookmark (Files mode) |
|
|
84
|
+
| `Shift+Tab` | Cycle to previous bookmark (Files mode) |
|
|
85
|
+
| `z` | Navigate using zoxide history (when nothing is selected) |
|
|
75
86
|
|
|
76
87
|
---
|
|
77
88
|
|
|
@@ -84,6 +95,7 @@ Press `:` to enter command mode. Available prefixes:
|
|
|
84
95
|
| `@` | Execute script | `:@build.sh` |
|
|
85
96
|
| `rake:` | Execute rake task | `:rake:test` |
|
|
86
97
|
| `!` | Shell command | `:!git status` |
|
|
98
|
+
| `cd` | Go to a pasted path (file paths select the file, `cd -` goes back) | `:cd ~/projects/app` |
|
|
87
99
|
| (none) | Built-in command | `:hello` |
|
|
88
100
|
|
|
89
101
|
### Features
|
|
@@ -124,25 +136,47 @@ Press `B` then select script path management to:
|
|
|
124
136
|
|
|
125
137
|
---
|
|
126
138
|
|
|
127
|
-
## Mode
|
|
139
|
+
## Global Search & Config Mode
|
|
140
|
+
|
|
141
|
+
### Global Search (`G`)
|
|
142
|
+
|
|
143
|
+
Search file names or text inside every bookmarked directory.
|
|
144
|
+
|
|
145
|
+
- `Tab`: Switch between file names and content (literal, case insensitive)
|
|
146
|
+
- Content search also reads `.pdf` (page), `.xlsx` (sheet/cell) and `.pptx` (slide)
|
|
147
|
+
- `Up/Down` or `Ctrl+J/K or Ctrl+N/P`: Select a result | `Enter`: Go to the file in Files mode
|
|
148
|
+
- `Ctrl+U`: Clear the query | `ESC`: Return to the previous mode
|
|
149
|
+
- Exclude extensions with `GLOBAL_SEARCH_EXCLUDED_EXTENSIONS` in `~/.config/rufio/config.rb`
|
|
150
|
+
|
|
151
|
+
### Config Mode (`C`)
|
|
152
|
+
|
|
153
|
+
Opens `~/.config/rufio/` (created if missing) with the same navigation, preview
|
|
154
|
+
and file operations as Files mode. Leaving the directory returns to Files mode.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Modes & Help Menu
|
|
128
159
|
|
|
129
160
|
| Key | Action |
|
|
130
161
|
|-----|--------|
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
|
|
|
162
|
+
| `G` | Global search mode |
|
|
163
|
+
| `C` | Config mode: open `~/.config/rufio/` |
|
|
164
|
+
| `J` | Job mode |
|
|
165
|
+
| `L` | Execution logs |
|
|
166
|
+
| `?` | Open the floating help menu |
|
|
134
167
|
| `ESC` | Exit current mode |
|
|
135
|
-
| `q` | Quit rufio |
|
|
168
|
+
| `q` | Quit rufio (with confirmation) |
|
|
136
169
|
| `T` | Quit rufio and cd the shell to the current directory (requires `rufio --shell-init`) |
|
|
137
170
|
|
|
138
|
-
|
|
171
|
+
In Files mode, `Tab` / `Shift+Tab` cycle bookmarks. In other modes, `Shift+Tab` switches to the previous mode.
|
|
172
|
+
|
|
173
|
+
### Help Menu
|
|
139
174
|
|
|
140
|
-
|
|
175
|
+
`?` opens a floating menu over the current screen; your mode and directory are kept.
|
|
141
176
|
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
- Press `ESC` to exit help mode and return to your previous directory
|
|
177
|
+
- `1/2/3` or `Tab/Shift+Tab`: Switch section (Controls / Modes / Scripts)
|
|
178
|
+
- `j/k`: Scroll | `Ctrl+D/U`: Page down/up | `g/G`: Top / bottom
|
|
179
|
+
- `ESC`, `q` or `?`: Close
|
|
146
180
|
|
|
147
181
|
---
|
|
148
182
|
|
|
@@ -153,7 +187,8 @@ You are currently in **Help Mode**. In this mode:
|
|
|
153
187
|
3. **Filter + Search**: Use `f` for real-time filtering, `s` for fuzzy search
|
|
154
188
|
4. **Bookmarks**: Save frequently used directories with `b`, access with `1-9`
|
|
155
189
|
5. **Rake tasks**: If your project has a Rakefile, use `:rake:` with Tab completion
|
|
156
|
-
6. **Background jobs**: Long-running commands execute in background, view with `J`
|
|
190
|
+
6. **Background jobs**: Long-running commands and ZIP jobs execute in background, view with `J`
|
|
191
|
+
7. **Global search**: Press `G` to search names or contents across all bookmarks
|
|
157
192
|
|
|
158
193
|
---
|
|
159
194
|
|