@aymanbagabas/drift 0.0.8 → 0.0.10

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 (2) hide show
  1. package/README.md +45 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -104,6 +104,31 @@ the `drift` binary on your `PATH`.
104
104
 
105
105
  Every method installs a `drift` binary.
106
106
 
107
+ ### Shell completions
108
+
109
+ drift completes its flags and option values, paths after `--`, and git
110
+ revisions: refs, commit hashes, `HEAD~2` ancestors, `HEAD@{1}` reflog entries,
111
+ `@{upstream}`, `HEAD:src/` paths, and both ends of a range like
112
+ `main..feature`.
113
+
114
+ The Homebrew, deb, rpm, apk, AUR, and Nix packages set this up for bash, zsh,
115
+ and fish. Otherwise, add the line for your shell to its startup file:
116
+
117
+ ```sh
118
+ eval "$(drift --completions bash)" # bash: ~/.bashrc
119
+ source <(drift --completions zsh) # zsh: ~/.zshrc, after compinit
120
+ drift --completions fish | source # fish: ~/.config/fish/completions/drift.fish
121
+ ```
122
+
123
+ For PowerShell, add `drift --completions powershell | Out-String | Invoke-Expression`
124
+ to `$PROFILE`. For Elvish, add `eval (drift --completions elvish | slurp)` to
125
+ `rc.elv`.
126
+
127
+ zsh and fish treat an unmatched `{` as brace expansion, and PowerShell treats
128
+ it as the start of a script block. To complete a reflog entry in these shells,
129
+ quote the word (`'HEAD@{`). In zsh and fish, you can also escape the brace
130
+ (`HEAD@\{`).
131
+
107
132
  ## Use it
108
133
 
109
134
  ```sh
@@ -117,7 +142,7 @@ git diff | drift # pager mode: read a diff from stdin
117
142
  ```
118
143
 
119
144
  > [!TIP]
120
- > Pair it with an AI agent. Leave `drift -w` open in a split while an agent (Copilot, Claude, etc.) works, every edit lands on screen instantly. Press <kbd>w</kbd> to freeze the view when you want to read, and again to resume.
145
+ > Pair it with an AI agent. Leave `drift -w` open in a split while an agent (Copilot, Claude, etc.) works, every edit lands on screen instantly. Press <kbd>F</kbd> to freeze the view when you want to read, and again to resume.
121
146
 
122
147
  Make it your default git diff pager:
123
148
 
@@ -141,6 +166,8 @@ Some flags worth knowing:
141
166
  | `-C`, `--directory DIR` | Run as if started in `DIR` (worktrees, bare repos) |
142
167
  | `-c`, `--config FILE` | Use a specific config file |
143
168
  | `--no-syntax` | Turn off syntax highlighting for this run |
169
+ | `--no-commit-meta` | Collapse the commit metadata to just the commit line |
170
+ | `--wrap` / `--no-wrap` | Wrap long lines instead of scrolling horizontally |
144
171
  | `-U`, `--context N` | Lines of context around each change |
145
172
  | `--ignore-whitespace` | Ignore whitespace-only changes |
146
173
  | `--diff-algorithm ALGO` | `myers`, `minimal`, `patience`, or `histogram` |
@@ -155,7 +182,7 @@ Some flags worth knowing:
155
182
  | `0` `$` | Scroll to line start / end |
156
183
  | `d` `u` / `^d` `^u` | Half page down / up |
157
184
  | `space` `f` `^f` / `b` `^b` | Full page down / up |
158
- | `^e` `^y` | Scroll one line down / up |
185
+ | `e` `y` / `^e` `^y` | Scroll one line down / up |
159
186
  | `g` `G` | Top / bottom |
160
187
  | `H` `M` `L` | Cursor to screen top / middle / bottom |
161
188
  | `{` `}` | Previous / next hunk |
@@ -163,14 +190,16 @@ Some flags worth knowing:
163
190
  | `/` | Search the current file (regex, smart-case) |
164
191
  | `n` `N` | Next / previous match |
165
192
  | `s` | Toggle split view |
166
- | `F` | File list modal |
193
+ | `w` | Toggle line wrapping (long lines wrap instead of scrolling horizontally) |
194
+ | `S` | File stats modal |
167
195
  | `B` | Toggle the file sidebar |
168
- | `w` | Toggle watch mode |
196
+ | `F` | Toggle watch mode (follow changes, like `less`) |
197
+ | `a` | Toggle untracked files (worktree view) |
169
198
  | `V` | Start / cancel a line selection; any motion key extends it |
170
- | `y` | Copy the selection, or the cursor line when nothing is selected |
171
- | `Y` | Copy the whole current file |
172
- | `enter` | Expand folded context, or open the file at the cursor |
173
- | `v` | Open the current file in `$EDITOR` |
199
+ | `c` | Copy the selection, or the cursor line when nothing is selected |
200
+ | `C` | Copy the whole current file |
201
+ | `enter` | On a hunk header, expand folded context; on the commit line, expand / collapse the commit metadata |
202
+ | `o` | Open the current file in `$EDITOR` |
174
203
  | `r` | Refresh |
175
204
  | `?` | Toggle the help footer |
176
205
  | `q` | Quit |
@@ -185,6 +214,8 @@ drift is fully mouse-driven too:
185
214
  - Drag the sidebar's divider to resize it, live.
186
215
  - In split view, drag the divider between the two panes to rebalance them.
187
216
  - Click the `? help` badge in the status bar to toggle the help footer.
217
+ - Double-click the commit line to expand or collapse the commit metadata; on a
218
+ hunk header, double-click expands the folded context.
188
219
  - Drag across the diff to select text; it lands on your system clipboard (over
189
220
  SSH too, via OSC 52). In split view the selection stays within one pane, so
190
221
  you copy just the old or just the new side.
@@ -241,6 +272,12 @@ theme = "onedark" # any built-in or syntect theme name
241
272
  syntax = true # highlight diff content
242
273
  intraline = true # word-level change emphasis
243
274
  line-numbers = true # old/new line-number gutter
275
+ commit-meta = true # expand author/date/message; the commit line always shows for a single commit
276
+ wrap = false # wrap long lines instead of scrolling horizontally (toggle with w)
277
+ wrap-symbol = "↪" # symbol shown at the start of each wrapped continuation line
278
+ expand-symbol = "›" # gutter symbol on the collapsed commit line (expand to show metadata)
279
+ collapse-symbol = "⌄" # gutter symbol on the expanded commit line (collapse to hide metadata)
280
+ context-symbol = "⋯" # gutter symbol on a hunk header (reveal more context)
244
281
  tab-width = 4
245
282
  editor = "" # falls back to $VISUAL, then $EDITOR, then vi
246
283
  sidebar = "auto" # "auto" (opens at width >= 150), "always", or "never"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aymanbagabas/drift",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "A standalone git diff pager for the terminal.",
5
5
  "bin": {
6
6
  "drift": "bin/drift.js"