Skip to main content

Keyboard-driven file tree sidebar for tmux

Project description

tree-copy

PyPI version Python versions License Downloads

A keyboard-driven file tree sidebar for tmux, built with Textual.

Browse your project, jump between directories, copy paths, and preview files — without leaving the terminal.

PyPI · GitHub

Features

  • Navigate the file tree with arrow keys
  • Jump between sibling directories with Shift+↑/↓
  • Copy relative or absolute paths to clipboard
  • Preview files with glow (falls back to less)
  • Edit files with $TREE_COPY_EDITOR (falls back to nano → vi)
  • Root folder stays open (non-collapsible)

Requirements

  • Python 3.10+
  • glow (optional, recommended for file preview — falls back to less)

Install

pip install tree-copy

Or from source:

pip install .

Usage

tree-copy [directory]   # defaults to current directory

As a togglable tmux sidebar, add to ~/.tmux.conf:

bind-key e run-shell " \
  PANE=$(tmux show-option -wqv @tree-copy-pane); \
  if [ -n \"$PANE\" ] && tmux list-panes -F '#{pane_id}' | grep -q \"^$PANE\$\"; then \
    tmux kill-pane -t \"$PANE\"; \
    tmux set-option -w @tree-copy-pane ''; \
  else \
    NEW_PANE=$(tmux split-window -hbP -l 35 -F '#{pane_id}' \"tree-copy '#{pane_current_path}'\"); \
    tmux set-option -w @tree-copy-pane \"$NEW_PANE\"; \
  fi"

prefix + e opens the sidebar; pressing it again closes it. State (expanded folders, cursor position) is saved automatically and restored on next open.

Keybindings

Key Action
/ Navigate
Shift+↑ / Shift+↓ Jump between sibling directories; moves to parent at bounds
Enter / Space Toggle directory open/close
o Preview file (glow if available, else less)
e Edit file ($TREE_COPY_EDITOR, else nano, else vi)
c Copy relative path to clipboard
C Copy absolute path to clipboard
q / Esc Quit

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_copy-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tree_copy-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file tree_copy-0.1.1.tar.gz.

File metadata

  • Download URL: tree_copy-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for tree_copy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 910c625ac960cb1502d178016f5db132bac7ca39bd17d8977b5d51211e00f2f6
MD5 0314a1f9645718b876a483ddbf1d7ea1
BLAKE2b-256 5bbb7bd4cf1fc01523a22e758dc11447acb494cd4560e269d5675ccba0d25cc3

See more details on using hashes here.

File details

Details for the file tree_copy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tree_copy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for tree_copy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f40e0d534ab1de2a46cf0755d8d666930c8bff71ae4bdf2a1b67916fa59a121
MD5 b5ce7585712c45c820c123a50554b289
BLAKE2b-256 2d5a89f0e83d545bf4c57e9f9cad933a0d2e419cba93c76019a2d549142072f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page