From d50482639cc1a51948bad40714fcf7effa8fb600 Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Sat, 12 Dec 2020 18:36:02 -0700 Subject: [PATCH] change proj functions for new dir structure --- fish.configlink/config.fish | 3 +-- fish.configlink/functions/projects.fish | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fish.configlink/config.fish b/fish.configlink/config.fish index 5d9e95e..bc23ff9 100644 --- a/fish.configlink/config.fish +++ b/fish.configlink/config.fish @@ -5,9 +5,8 @@ if status --is-interactive # Set $PATH for finding programs set FISH_DIR (readlink ~/.config/fish) set DOTS (dirname $FISH_DIR) - set PROJ (dirname $DOTS) set PATH $PATH /usr/local/bin ~/.local/bin $DOTS/bin ~/.cargo/bin - set CDPATH . $HOME $PROJ + set CDPATH . $HOME set EDITOR nvim # Use `vi` in the shell with cursor shapes diff --git a/fish.configlink/functions/projects.fish b/fish.configlink/functions/projects.fish index 9a22d17..9ab9d5e 100644 --- a/fish.configlink/functions/projects.fish +++ b/fish.configlink/functions/projects.fish @@ -2,15 +2,12 @@ function projects --description "Projects tools" + set PROJ $HOME/dev/work alias proj='cd $PROJ' function prj --description "cd to a project" set projdir (ls $PROJ | fzf) - if [ $status -eq 0 ] - cd $projdir - else - return 1 - end + and cd $PROJ/$projdir end end