Add completions integration to workstation env

This commit is contained in:
Ethan Paul 2022-05-20 16:55:44 -04:00
parent cd1910c2bd
commit a822fe0915
Signed by: enpaul
GPG Key ID: 9B6D99E4CFA31867
2 changed files with 20 additions and 2 deletions

View File

@ -6,10 +6,11 @@ if [ -f `which powerline-daemon` ]; then
fi
export NVM_DIR="$HOME/.nvm"
export PROJECTS_DIR="$HOME/Documents/projects"
function gg() {
cd ~/Git/$1;
if [ -f ~/Git/$1/pyproject.toml ]; then
cd "$PROJECTS_DIR/$1";
if [ -f "$PROJECTS_DIR/$1/pyproject.toml" ]; then
poetry shell;
fi
}

View File

@ -17,6 +17,23 @@
state: present
loop: "{{ _local_human_users }}"
- name: Configure bash completions
become: true
ansible.builtin.blockinfile:
path: ~{{ item.0 }}/.config/bash_completions
create: true
block: >-
function _gg_completion() {
local cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=( $(compgen -W "$(command ls $PROJECT_DIR)" -- $cur) );
}
complete -F _gg_completion gg
owner: "{{ ansible_user }}"
group: "{{ item.0 }}"
mode: 0664
loop: "{{ _local_human_users }}"
- name: Enforce ownership of the SSH keys
become: true
ansible.builtin.file: