vcstool-cd for fish-shell
sudo apt install fzf fd-find jq
sudo ln -snfv /usr/bin/fdfind /usr/bin/fd
brew install fzf fd jq
fisher install kenji-miyake/vcd.fish
git clone git@github.com:kenji-miyake/vcd.fish.git
cd vcd.fish
./install
This package provides vcd
and ccd
commands for workspaces set up by vcstool
.
vcd
is a command for moving to vcs repositories in a workspace.
cd {vcstool_workspace_dir}
vcd <Tab>
# or use Ctrl-V key bindings
This command reads setting files to find repositories and supports two modes.
-
repos
: use.repos
files to find directories -
workspace
: use.code-workspace
files to find directories
To switch the mode, set $VCD_MODE
.
# To use repos mode (default)
set -U VCD_MODE repos
# To use workspace mode
set -U VCD_MODE code-workspace
# To use gitmodules mode
set -U VCD_MODE gitmodules
# To use path mode
set -U VCD_MODE path
Note
To use
code-workspace
mode, you need to prepare.code-workspace
file. It can be generated from.repos
file usingrepos2workspace.py
.cd vcd.fish wget -P /tmp https://raw.githubusercontent.com/kenji-miyake/vscode-utils/main/repos2workspace.py python3 /tmp/repos2workspace.py {path-to-your-repos-file}
Note
To use
gitmodules
mode, you need to prepare.gitmodules
file. It can be generated from.repos
file usingrepos2gitmodules.py
.cd vcd.fish wget -P /tmp https://raw.githubusercontent.com/kenji-miyake/vscode-utils/main/repos2gitmodules.py python3 /tmp/repos2gitmodules.py {path-to-your-repos-file}
To filter the results, set VCD_IGNORE_PATTERNS
.
set -U VCD_IGNORE_PATTERNS ".*\/vendor\/|.*\/tmp\/"
ccd
is a command for moving to colcon packages in a workspace.
cd {vcstool_workspace_dir}
ccd -s <Tab> # To move under src directory
ccd -i <Tab> # To move under install directory
ccd <Tab> # To move according to the default mode
# or use Ctrl-Alt-V key bindings
To switch the default mode, set $CCD_DEFAULT_MODE
.
# To use src mode (default)
set -U CCD_DEFAULT_MODE src
# To use install mode
set -U CCD_DEFAULT_MODE install
This tool can find workspaces based on $COLCON_PREFIX_PATH
or $CMAKE_PREFIX_PATH
.
If you source setup.bash
, you can use commands from outside of workspaces.
bass source {vcstool_workspace_dir}/install/setup.bash
# use commands from everywhere
If you'd like to disable key bindings, set VCD_DISABLE_KEYBINDINGS
and/or CCD_DISABLE_KEYBINDINGS
.
set -U VCD_DISABLE_KEYBINDINGS
set -U CCD_DISABLE_KEYBINDINGS
To re-enable,
set -e VCD_DISABLE_KEYBINDINGS
set -e CCD_DISABLE_KEYBINDINGS