From 0ced8a28b1b948cbf9b3d329ff1340142a625a2a Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 16 Mar 2021 20:22:26 +0000 Subject: [PATCH] refactor(core): update code structure This is the big re structure to all of the projects. I have decided to go with the `GOPATH` format so all of the code is in one place and organised inherently by code host / group / project --- site-modules/core/files/oh-my-zsh/custom/fzf.zsh | 6 ++++++ site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh | 5 ++--- site-modules/core/files/zshrc | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/site-modules/core/files/oh-my-zsh/custom/fzf.zsh b/site-modules/core/files/oh-my-zsh/custom/fzf.zsh index d5942a1..f02266b 100644 --- a/site-modules/core/files/oh-my-zsh/custom/fzf.zsh +++ b/site-modules/core/files/oh-my-zsh/custom/fzf.zsh @@ -13,6 +13,12 @@ alias fe="e \$(FZF_DEFAULT_COMMAND=\"fd -t f\" fzf --layout=reverse --preview 'bat --style=numbers ---color=always {}')" alias fte="te \$(FZF_DEFAULT_COMMAND=\"fd -t f\" fzf --layout=reverse --preview 'bat --style=numbers ---color=always {}')" +# +# cd in to a porject directory +# +fp() { + cd ~/Code/src/$(cd ~/Code/src && FZF_DEFAULT_COMMAND="fd -t d --exact-depth 3" fzf --layout=reverse --preview 'bat --style=numbers ---color=always {}/README.md') +} # # Searching the git history with diff and show preview support. When selecting a # commit `git show` output is displayed and `CTRL-d` the `git diff` output is diff --git a/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh b/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh index daa615c..a15938e 100644 --- a/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh +++ b/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh @@ -20,6 +20,5 @@ mutt_scripts=~/.mutt/scripts # # Zsh hash # -hash -d s=~/sites -hash -d df=~/.dotfiles -hash -d d=~/development +hash -d code=~/Code +hash -d s=~/Code/src diff --git a/site-modules/core/files/zshrc b/site-modules/core/files/zshrc index fd713b0..24db80f 100644 --- a/site-modules/core/files/zshrc +++ b/site-modules/core/files/zshrc @@ -76,8 +76,8 @@ export PATH=$PATH:$HOME/.config/composer/vendor/bin # # Set up golang # -if [ -d $HOME/go ]; then - export GOPATH=$HOME/go +if [ -d $HOME/Code ]; then + export GOPATH=$HOME/Code export PATH=$PATH:$GOPATH/bin fi