shfl
(short for "shuffle") lets you easily rearrange lines in a file with
simple keymaps.
I like switching my tmux sessions quickly (using tmux switch-client -t "$session"
, triggered via a shortcut). The session names are stored in a local
file, and I map a key to a session on a specific line number. To easily change
which session is assigned to which line number, I needed a tool that would start
up quickly and have easy keymaps to reorder lines in a file.
shfl-tmux-demo.mp4
homebrew:
brew install dhth/tap/shfl
cargo:
cargo install --git https://github.com/dhth/shfl.git
Or get the binaries directly from a release. Read more about verifying the authenticity of released artifacts here.
K move item one position above
Enter move item/selection to the start of the list
j / Down go down
k / Up go up
[1-9] move current item to index in list
g go to the start of the list
G go to the end of the list
w write to file
space / s select/unselect item
? show/hide help view
Esc / q go back/reset selection/exit
In case you get the shfl
binary directly from a release, you may want to
verify its authenticity. Checksums are applied to all released artifacts, and
the resulting checksum file is signed using
cosign.
Steps to verify (replace A.B.C
in the cshflands listed below with the version
you want):
-
Download the following files from the release:
- shfl_A.B.C_checksums.txt - shfl_A.B.C_checksums.txt.pem - shfl_A.B.C_checksums.txt.sig
-
Verify the signature:
cosign verify-blob shfl_A.B.C_checksums.txt \ --certificate shfl_A.B.C_checksums.txt.pem \ --signature shfl_A.B.C_checksums.txt.sig \ --certificate-identity-regexp 'https://github\.com/dhth/shfl/\.github/workflows/.+' \ --certificate-oidc-issuer "https://token.actions.githubusercontent.com"
-
Download the compressed archive you want, and validate its checksum:
curl -sSLO https://github.com/dhth/shfl/releases/download/vA.B.C/shfl_A.B.C_linux_amd64.tar.gz sha256sum --ignore-missing -c shfl_A.B.C_checksums.txt
-
If checksum validation goes through, uncompress the archive:
tar -xzf shfl_A.B.C_linux_amd64.tar.gz ./shfl
shfl
is built using ratatui.