refactor: restructure my Code directory

I recently restructed the contents of my `~/Code` directory so that
repositories are grouped by their provider and organisation.

For example, my `dotfiles` are now located at
`~/Code/github.com/opdavies/dotfiles`.

Likewise, `build-configs` is now located at
`~/Code/github.com/OliverDaviesLtd/build-configs` as it's within the
`OliverDaviesLtd` organisation.

As well as `~/Code/github.com`, I also have `~/Code/bitbucket.org` for
Bitbucket repositories. These are also grouped within subdirectories for
each organisation.

This change means I need to update any reference to the old `dotfiles`
location to the new one and I can update the `t` function to adjust the
min and max depth it uses to find directories.
This commit is contained in:
Oliver Davies 2023-08-07 09:47:03 +01:00
parent f570b44606
commit 624faf959c
4 changed files with 5 additions and 5 deletions

4
bin/t
View file

@ -11,8 +11,8 @@ if [[ $# -eq 1 ]]; then
else
# Get the session name from fuzzy-finding list of directories and generating a
# tmux-safe version.
items=$(find ~/Code -mindepth 1 -maxdepth 2 -type d ! -name .git)
items+="$HOME/Code/dotfiles"
items=$(find ~/Code -mindepth 3 -maxdepth 3 -type d ! -name .git)
items+="$HOME/Code/github.com/opdavies/dotfiles"
selected=$(echo "${items}" | sort | fzf --reverse)
fi

View file

@ -92,4 +92,4 @@ imap {
end,
}
nmap { "<leader><leader>s", "<cmd>source ~/Code/dotfiles/config/neovim/after/plugin/luasnip.lua<CR>" }
nmap { "<leader><leader>s", "<cmd>source ~/Code/github.com/opdavies/dotfiles/config/neovim/after/plugin/luasnip.lua<CR>" }

View file

@ -39,7 +39,7 @@ end
function M.edit_neovim()
local opts = {
cwd = "~/Code/dotfiles/config/neovim",
cwd = "~/Code/github.com/opdavies/dotfiles/config/neovim",
find_command = { "rg", "--no-ignore", "--files", "--follow" },
path_display = { "shorten" },
prompt_title = "~ dotfiles ~",

View file

@ -89,7 +89,7 @@
bind-key -T copy-mode-vi 'C-\' select-pane -l
bind-key -r F new-window t
bind-key -r D run-shell "t ~/Code/dotfiles"
bind-key -r D run-shell "t ~/Code/github.com/opdavies/dotfiles"
set -g @resurrect-strategy-nvim 'session'
'';