Updates tmux-sessionator script to use an environment variable for path lookups

This commit is contained in:
2024-03-20 23:18:43 -04:00
parent 0f8e56394d
commit b61004554a
7 changed files with 40 additions and 28 deletions

View File

@@ -161,7 +161,7 @@ home=~/.config/ansible
;bin_ansible_callbacks=False
# (tmppath) Temporary directory for Ansible to use on the controller.
;local_tmp={{ ANSIBLE_HOME ~ "/tmp" }}
local_tmp=~/.local/ansible/tmp
# (list) List of logger names to filter out of the log file
;log_filter=
@@ -324,7 +324,7 @@ roles_path={{ ANSIBLE_HOME ~ "~/.local/ansible/roles:/roles:/usr/share/ansible/r
;inject_facts_as_vars=True
# (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backwards-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present.
;interpreter_python=auto
interpreter_python=auto_silent
# (boolean) If 'false', invalid attributes for a task will result in warnings instead of errors
;invalid_task_attribute_failed=True
@@ -596,7 +596,7 @@ roles_path={{ ANSIBLE_HOME ~ "~/.local/ansible/roles:/roles:/usr/share/ansible/r
# (path) The directory that stores cached responses from a Galaxy server.
# This is only used by the ``ansible-galaxy collection install`` and ``download`` commands.
# Cache files inside this dir will be ignored if they are world writable.
;cache_dir={{ ANSIBLE_HOME ~ "/galaxy_cache" }}
cache_dir=~/.cache/ansible
# (bool) whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`
;collections_path_warning=True

View File

@@ -1,6 +1,5 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
"catppuccin": { "branch": "main", "commit": "045e3499d9ec8d84635fb08877ae44fd33f6a38d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@@ -41,6 +40,7 @@
"swift.nvim": { "branch": "main", "commit": "bbbd2e5eb988920ac35f00e67fbb08cb2ebbe958" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },

View File

@@ -110,19 +110,21 @@ return {
behavior = cmp.ConfirmBehavior.Replace,
select = true
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- elseif luasnip.expandable() then
-- luasnip.expand()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {"i", "s"}),
-- Accept ([y]es) the completions.
['<C-y'] = cmp.mapping.confirm { select = true },
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- -- elseif luasnip.expandable() then
-- -- luasnip.expand()
-- -- elseif luasnip.expand_or_jumpable() then
-- -- luasnip.expand_or_jump()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, {"i", "s"}),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()

View File

@@ -0,0 +1,5 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { }
}

View File

@@ -59,5 +59,6 @@ require("lazy").setup({
"NMAC427/guess-indent.nvim",
opts = { }
},
{ import = 'user.plugin.todo-comments' },
})

View File

@@ -25,19 +25,18 @@ function path_prepend() {
declare arg
for arg in "$@"; do
debug_print "arg: $arg"
# Check that arg is a directory but not a symlink
# Bc on some of my machines ~/projects is a symlink to $REPOS
test -d $arg && ! test -L $arg || continue
paths=($arg $paths)
[ -d $arg ] && debug_print "arg is a directory" && paths=($arg $paths) \
|| debug_print "arg is not a directory"
done
}
function setup_fuzzy_find_paths() {
path_prepend "$HOME" \
"$HOME/projects" \
"$REPOS/local" \
$(find $REPOS/github.com -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null) \
$(find $GHREPOS/ansible -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null)
local path="$TMUX_SESSIONATOR_PATH"
debug_print "path: $path"
for arg in ${(s[:])path}; do
path_prepend "$arg"
done
debug_print "paths: $paths"
}
#################### MAIN ####################
@@ -55,14 +54,14 @@ elif [[ "$#" -eq 1 ]]; then
selected=$1
else
setup_fuzzy_find_paths
debug_print "fuzzy find paths: ${(@)paths}"
debug_print "fuzzy find paths: ${paths}"
if [ -n "$DEBUG" ]; then
debug_print "Exiting because in debug mode."
exit 0
fi
selected=$(find ${(@)paths} -mindepth 1 -maxdepth 1 -type d | fzf)
selected=$(find ${paths} -mindepth 1 -maxdepth 1 -type d | fzf)
fi
if [[ -z $selected ]]; then

View File

@@ -75,3 +75,8 @@ export VAULT_ADDR="https://vault.housh.dev"
# Ansible
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
# Tmux-Sessionator path.
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$HHE_REPOS:$REPOS:$GH_REPOS:"
[ -f "$ZDOTDIR/.zshrc-local" ] && source "$ZDOTDIR/.zshrc-local"