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 ;bin_ansible_callbacks=False
# (tmppath) Temporary directory for Ansible to use on the controller. # (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 # (list) List of logger names to filter out of the log file
;log_filter= ;log_filter=
@@ -324,7 +324,7 @@ roles_path={{ ANSIBLE_HOME ~ "~/.local/ansible/roles:/roles:/usr/share/ansible/r
;inject_facts_as_vars=True ;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. # (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 # (boolean) If 'false', invalid attributes for a task will result in warnings instead of errors
;invalid_task_attribute_failed=True ;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. # (path) The directory that stores cached responses from a Galaxy server.
# This is only used by the ``ansible-galaxy collection install`` and ``download`` commands. # 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 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` # (bool) whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`
;collections_path_warning=True ;collections_path_warning=True

View File

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

View File

@@ -110,19 +110,21 @@ return {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true select = true
}, },
["<Tab>"] = cmp.mapping(function(fallback) -- Accept ([y]es) the completions.
if cmp.visible() then ['<C-y'] = cmp.mapping.confirm { select = true },
cmp.select_next_item() -- ["<Tab>"] = cmp.mapping(function(fallback)
-- elseif luasnip.expandable() then -- if cmp.visible() then
-- luasnip.expand() -- cmp.select_next_item()
-- elseif luasnip.expand_or_jumpable() then -- -- elseif luasnip.expandable() then
-- luasnip.expand_or_jump() -- -- luasnip.expand()
elseif has_words_before() then -- -- elseif luasnip.expand_or_jumpable() then
cmp.complete() -- -- luasnip.expand_or_jump()
else -- elseif has_words_before() then
fallback() -- cmp.complete()
end -- else
end, {"i", "s"}), -- fallback()
-- end
-- end, {"i", "s"}),
["<S-Tab>"] = cmp.mapping(function() ["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() 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", "NMAC427/guess-indent.nvim",
opts = { } opts = { }
}, },
{ import = 'user.plugin.todo-comments' },
}) })

View File

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

View File

@@ -75,3 +75,8 @@ export VAULT_ADDR="https://vault.housh.dev"
# Ansible # Ansible
export ANSIBLE_HOME="$XDG_CONFIG_HOME/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"