Skip to content
MnlPhlpPublic

About

terminal workspace picker

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

wspick

terminal workspace picker

If you hate typing out all your long project paths in the terminal just to cd there or open them in an editor, this is for you.

❯ wspick
? select project:
> test1
  test2
  project
  [new project]
  [new dir]
  [edit]
[↑↓ to move, enter to select, tab to complete, type to filter]
❯ wspick
? select project: tes 
> test1
  test2
[↑↓ to move, enter to select, tab to complete, type to filter]

Installation

cargo install wspick

or just download a binary from the releases section


Usage

Calling wspick opens a selector with projects that can be opened in a configured editor. New projects can be added by selecting new project and specifing path and name or by selecting edit and editing the config directly. With new dir you can add a path and wspick will show all directories in that path as project.

Tab completion

While filtering, Tab completes the input up to the first character where the remaining options differ. With the options backend-api and backend-worker, typing back and pressing Tab gives backend-. If only one option is left, Tab completes it fully.

Sub menus

Directories found inside a configured dir are shown as a sub menu instead of a project if they only contain other directories. Such entries are marked with a trailing /. Selecting one opens a new selection with the projects inside that directory. This works for arbitrarily deep nesting. Choose [..] or press Esc to go back one level.

A directory is treated as a project (and not as sub menu) if it

  • is a git repository (contains .git), or
  • contains any non-hidden file, or
  • is empty.
❯ wspick
? select project:
> group/
  repo
  [new project]
  [new dir]
  [edit]

? select project in group:
> alpha
  beta
  [..]
wspick
? select project  
> [new project]
  [new dir]
  [edit]
[↑↓ to move, enter to select, tab to complete, type to filter]

Parameters

  • -p print the selected path instead of opening it. Useful for usage in scripts.

CD to projects

To use it on linux to cd to projects create the following alias:

alias cdws='cd $(wspick -p)'

Config

On first start a new configfile wspick.toml is generated and stored in an appropriate location. On linux this is ~/.config/wspick

dirs = []
open_cmd = ""
editor = "/usr/bin/helix"
sort = true
exclude_proj_dirs = true

[paths]
exercism-rust = "/home/manuel/programming/exercism/rust"
  • dirs: list of directories. All subdirectories will be shown as projects
  • open_cmd: command that is executed on selection. Empty means printing the selected path
  • editor: editor used when you select edit
  • sort: sort prjects alphabetically
  • paths: list of project names and paths
  • exclude_proj_dirs : exclude directories containing any already defined project from the autogenerated list

About

terminal workspace picker

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages