tmux-fuzzy-motion 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. package/README.ja.md +141 -0
  2. package/README.md +124 -28
  3. package/dist/cli.js +6151 -0
  4. package/package.json +53 -7
package/README.ja.md ADDED
@@ -0,0 +1,141 @@
1
+ # tmux-fuzzy-motion
2
+
3
+ [English README](./README.md)
4
+
5
+ `tmux-fuzzy-motion` は、`tmux copy-mode` 内で素早くカーソル移動するための
6
+ CLI です。現在の viewport からジャンプ対象を抽出し、fuzzy search で絞り込み、
7
+ 大文字の hint で移動できます。英字のローマ字 query に対しては Migemo による
8
+ 日本語マッチも行います。
9
+
10
+ ## 特徴
11
+
12
+ - `tmux copy-mode` 内で動作
13
+ - 現在の viewport から URL、path、filename、symbol、一般的な単語を抽出
14
+ - `fzf` による fuzzy match
15
+ - `jsmigemo` による英字 query の Migemo マッチ
16
+ - overlay 描画時も pane の色を維持
17
+ - 単一キーの大文字 hint で素早く選択
18
+ - query は対象 pane 内に描画し、終了時に元の pane を復元
19
+
20
+ ## 動作要件
21
+
22
+ - Node.js 22 以上
23
+ - tmux 3.2 以上
24
+
25
+ ## インストール
26
+
27
+ ```bash
28
+ npm install -g tmux-fuzzy-motion@latest
29
+ ```
30
+
31
+ pnpm を使う場合:
32
+
33
+ ```bash
34
+ pnpm add -g tmux-fuzzy-motion@latest
35
+ ```
36
+
37
+ インストール確認:
38
+
39
+ ```bash
40
+ tmux-fuzzy-motion doctor
41
+ ```
42
+
43
+ グローバル install せずにその場で実行する場合:
44
+
45
+ ```bash
46
+ npx tmux-fuzzy-motion@latest doctor
47
+ ```
48
+
49
+ ## tmux 設定
50
+
51
+ `tmux.conf` に次を追加してください。
52
+
53
+ ```tmux
54
+ bind-key -T copy-mode-vi s run-shell -b 'tmux-fuzzy-motion start #{pane_id} #{client_tty}'
55
+ bind-key -T copy-mode s run-shell -b 'tmux-fuzzy-motion start #{pane_id} #{client_tty}'
56
+ ```
57
+
58
+ 設定変更後は tmux を reload します。
59
+
60
+ ```bash
61
+ tmux source-file ~/.tmux.conf
62
+ ```
63
+
64
+ ## 使い方
65
+
66
+ 1. `copy-mode` に入る
67
+ 2. `s` を押す
68
+ 3. 小文字や記号で query を入力する
69
+ 4. fuzzy match で候補を絞り込む
70
+ 5. 英字 query の場合は Migemo による日本語候補も対象になる
71
+ 6. 大文字 hint を押して即座に移動する
72
+ 7. `Esc` または `Ctrl-[` でキャンセルする
73
+
74
+ ## 入力キー
75
+
76
+ - `A-Z`: 表示中の hint を即時選択
77
+ - `Enter`: 現在の先頭候補を選択
78
+ - `Esc`, `Ctrl-[`, `Ctrl-g`: キャンセル
79
+ - `Backspace`, `Ctrl-h`: 1 文字削除
80
+ - `Ctrl-w`: 直前の単語を削除
81
+ - `Ctrl-u`: query をすべて削除
82
+
83
+ ## コマンド
84
+
85
+ ```text
86
+ tmux-fuzzy-motion start <pane-id> <client-tty>
87
+ tmux-fuzzy-motion doctor
88
+ ```
89
+
90
+ `input` は `start` から内部的に使うサブコマンドです。
91
+
92
+ ## Doctor
93
+
94
+ ローカル環境の確認には `doctor` を使います。
95
+
96
+ ```bash
97
+ tmux-fuzzy-motion doctor
98
+ ```
99
+
100
+ 確認内容:
101
+
102
+ - Node.js の version
103
+ - tmux の version
104
+ - Migemo 辞書の読み込み可否
105
+
106
+ ## 開発
107
+
108
+ このリポジトリからローカル開発する場合:
109
+
110
+ ```bash
111
+ pnpm install
112
+ ```
113
+
114
+ この開発フローでは `pnpm` が必要です。
115
+
116
+ 1 回 build:
117
+
118
+ ```bash
119
+ pnpm build
120
+ ```
121
+
122
+ watch build:
123
+
124
+ ```bash
125
+ pnpm run dev
126
+ ```
127
+
128
+ ローカルの一括確認:
129
+
130
+ ```bash
131
+ pnpm check
132
+ ```
133
+
134
+ ## 制約
135
+
136
+ - 対象は現在の viewport のみ
137
+ - `copy-mode` 専用
138
+ - query 入力は ASCII 寄り
139
+ - combining character の完全な扱いは未保証
140
+ - overlay は一時的な tmux pane を swap して表示し、終了時に元へ戻す
141
+ - query は pane 内の最下行右端に描画する
package/README.md CHANGED
@@ -1,45 +1,141 @@
1
1
  # tmux-fuzzy-motion
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ [日本語版はこちら](./README.ja.md)
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ `tmux-fuzzy-motion` is a CLI for quick cursor jumps inside `tmux copy-mode`.
6
+ It scans the current viewport, extracts jump targets, filters them with fuzzy
7
+ search, and lets you jump with uppercase hints. Roman queries can also match
8
+ Japanese text through Migemo.
6
9
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
10
+ ## Features
8
11
 
9
- ## Purpose
12
+ - Works inside `tmux copy-mode`
13
+ - Extracts URLs, paths, filenames, symbols, and general words from the current viewport
14
+ - Supports fuzzy matching with `fzf`
15
+ - Supports Migemo matching for alphabetic queries via `jsmigemo`
16
+ - Preserves pane colors while drawing the overlay
17
+ - Uses single-key uppercase hints for fast selection
18
+ - Renders the query inside the target pane and restores the original pane after finishing
10
19
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `tmux-fuzzy-motion`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
20
+ ## Requirements
15
21
 
16
- ## What is OIDC Trusted Publishing?
22
+ - Node.js 22 or later
23
+ - tmux 3.2 or later
17
24
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
25
+ ## Install
19
26
 
20
- ## Setup Instructions
27
+ ```bash
28
+ npm install -g tmux-fuzzy-motion@latest
29
+ ```
21
30
 
22
- To properly configure OIDC trusted publishing for this package:
31
+ If you prefer pnpm:
23
32
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
33
+ ```bash
34
+ pnpm add -g tmux-fuzzy-motion@latest
35
+ ```
28
36
 
29
- ## DO NOT USE THIS PACKAGE
37
+ Verify the installation:
30
38
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
39
+ ```bash
40
+ tmux-fuzzy-motion doctor
41
+ ```
36
42
 
37
- ## More Information
43
+ You can also run it without a global install:
38
44
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
45
+ ```bash
46
+ npx tmux-fuzzy-motion@latest doctor
47
+ ```
42
48
 
43
- ---
49
+ ## tmux Configuration
44
50
 
45
- **Maintained for OIDC setup purposes only**
51
+ Add these bindings to your `tmux.conf`:
52
+
53
+ ```tmux
54
+ bind-key -T copy-mode-vi s run-shell -b 'tmux-fuzzy-motion start #{pane_id} #{client_tty}'
55
+ bind-key -T copy-mode s run-shell -b 'tmux-fuzzy-motion start #{pane_id} #{client_tty}'
56
+ ```
57
+
58
+ Reload tmux after editing the config:
59
+
60
+ ```bash
61
+ tmux source-file ~/.tmux.conf
62
+ ```
63
+
64
+ ## Usage
65
+
66
+ 1. Enter `copy-mode`.
67
+ 2. Press `s`.
68
+ 3. Type a query in lowercase or symbols.
69
+ 4. Narrow the candidates with fuzzy matching.
70
+ 5. For alphabetic queries, Migemo also expands roman input to Japanese matches.
71
+ 6. Press an uppercase hint to jump immediately.
72
+ 7. Press `Esc` or `Ctrl-[` to cancel.
73
+
74
+ ## Input Keys
75
+
76
+ - `A-Z`: select a visible hint immediately
77
+ - `Enter`: select the first visible match
78
+ - `Esc`, `Ctrl-[`, `Ctrl-g`: cancel
79
+ - `Backspace`, `Ctrl-h`: delete one character
80
+ - `Ctrl-w`: delete the previous word
81
+ - `Ctrl-u`: clear the whole query
82
+
83
+ ## Commands
84
+
85
+ ```text
86
+ tmux-fuzzy-motion start <pane-id> <client-tty>
87
+ tmux-fuzzy-motion doctor
88
+ ```
89
+
90
+ `input` is an internal subcommand used by `start`.
91
+
92
+ ## Doctor
93
+
94
+ Use `doctor` to verify the local environment:
95
+
96
+ ```bash
97
+ tmux-fuzzy-motion doctor
98
+ ```
99
+
100
+ It checks:
101
+
102
+ - Node.js version
103
+ - tmux version
104
+ - Migemo dictionary loading
105
+
106
+ ## Development
107
+
108
+ For local development from this repository:
109
+
110
+ ```bash
111
+ pnpm install
112
+ ```
113
+
114
+ You will need `pnpm` for the development workflow above.
115
+
116
+ Build once:
117
+
118
+ ```bash
119
+ pnpm build
120
+ ```
121
+
122
+ Watch mode:
123
+
124
+ ```bash
125
+ pnpm run dev
126
+ ```
127
+
128
+ Run the full local check:
129
+
130
+ ```bash
131
+ pnpm check
132
+ ```
133
+
134
+ ## Limitations
135
+
136
+ - Targets are limited to the current viewport
137
+ - Designed for `copy-mode` only
138
+ - Query input is ASCII-oriented
139
+ - Exact behavior for combining characters is not fully guaranteed
140
+ - The overlay swaps in a temporary tmux pane and restores the original pane when it exits
141
+ - The query is drawn on the bottom row inside the pane, aligned to the right edge