Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # NVM version shortcut
- # change title name of tab in terminal
- function title {
- echo -ne "\033]0;"$*"\007"
- }
- cd() {
- builtin cd "$@" || return
- #echo $PREV_PWD
- if [ "$PWD" != "$PREV_PWD" ]; then
- PREV_PWD="$PWD";
- title $(echo ${PWD##*/}) $(node -v);
- if [ -e ".nvmrc" ]; then
- nvm use;
- # set tab terminal name to be cwd and node version
- title $(echo ${PWD##*/}) $(node -v);
- else
- nvm use default;
- fi
- fi
- }
Add Comment
Please, Sign In to add comment