From 624faf959caed373a9dabc61ade54d21944a7508 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 7 Aug 2023 09:47:03 +0100 Subject: [PATCH] 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. --- bin/t | 4 ++-- config/neovim/after/plugin/luasnip.lua | 2 +- config/neovim/lua/opdavies/telescope/init.lua | 2 +- home-manager/modules/tmux.nix | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/t b/bin/t index a8cca94..e300766 100755 --- a/bin/t +++ b/bin/t @@ -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 diff --git a/config/neovim/after/plugin/luasnip.lua b/config/neovim/after/plugin/luasnip.lua index 08b59c6..929714e 100644 --- a/config/neovim/after/plugin/luasnip.lua +++ b/config/neovim/after/plugin/luasnip.lua @@ -92,4 +92,4 @@ imap { end, } -nmap { "s", "source ~/Code/dotfiles/config/neovim/after/plugin/luasnip.lua" } +nmap { "s", "source ~/Code/github.com/opdavies/dotfiles/config/neovim/after/plugin/luasnip.lua" } diff --git a/config/neovim/lua/opdavies/telescope/init.lua b/config/neovim/lua/opdavies/telescope/init.lua index 048779f..147d413 100644 --- a/config/neovim/lua/opdavies/telescope/init.lua +++ b/config/neovim/lua/opdavies/telescope/init.lua @@ -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 ~", diff --git a/home-manager/modules/tmux.nix b/home-manager/modules/tmux.nix index b9425a7..ae6b34e 100644 --- a/home-manager/modules/tmux.nix +++ b/home-manager/modules/tmux.nix @@ -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' '';