Skip to content

Instantly share code, notes, and snippets.

@edgarogh
Created August 19, 2023 14:54
Show Gist options
  • Save edgarogh/b6a1cb7e5cdb08c81339fb111be6a2b7 to your computer and use it in GitHub Desktop.
Save edgarogh/b6a1cb7e5cdb08c81339fb111be6a2b7 to your computer and use it in GitHub Desktop.
cdd — run a command from within another directory + fish completion. Install in `~/.config/fish/` and consider underscores as directory separators.
complete -c cdd -n '__fish_is_first_token' -x -a '(__fish_complete_directories)'
complete -c cdd -n 'not __fish_is_first_token' -x -a '(__fish_complete_subcommand --fcs-skip=2)'
function cdd -d "cd à durée déterminée"
pushd $argv[1]
$argv[2..-1]
popd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment