Update vim plugin installations

This commit is contained in:
2021-10-03 14:24:46 +02:00
parent f59558f29f
commit ba5aa49a0f

View File

@@ -301,27 +301,60 @@
src: ~/.vim/autoload/plug.vim src: ~/.vim/autoload/plug.vim
force: true force: true
- name: get ycm version before update
shell: |
if ! [[ -d ~/.local/share/nvim/plugged/YouCompleteMe ]] ; then
exit 200
fi
cd ~/.local/share/nvim/plugged/YouCompleteMe
git rev-parse HEAD
args:
executable: /bin/bash
register: ycm_before_update
changed_when: false
failed_when: ycm_before_update.rc not in (0, 200)
- name: install vim plugins - name: install vim plugins
command: /usr/bin/nvim -f -E -s -c "source ~/.vimrc" +PlugInstall +qall command: /usr/bin/nvim --headless +"PlugInstall --sync" +qall
register: vim_plugins_stdout changed_when: false
check_mode: false
changed_when: vim_plugins_stdout.stdout_lines|length != 0 - name: install go binaries for vim
command: /usr/bin/nvim --headless +GoInstallBinaries +qall
changed_when: false
- name: update vim plugins - name: update vim plugins
command: /usr/bin/nvim -f -E -s -c "source ~/.vimrc" +PlugUpdate +qall command: /usr/bin/nvim --headless +"PlugUpdate --sync" +qall
register: vim_plugin_update changed_when: false
changed_when: vim_plugin_update.stdout_lines|length != 0
- name: update go binaries for vim
command: /usr/bin/nvim --headless +GoUpdateBinaries +qall
changed_when: false
- name: get ycm version after update
shell: |
cd ~/.local/share/nvim/plugged/YouCompleteMe
git rev-parse HEAD
args:
executable: /bin/bash
register: ycm_after_update
changed_when: false
- name: compile youcompleteme - name: compile youcompleteme
# --force-sudo is required, as the script refuses to run # --force-sudo is required, as the script refuses to run in a sudo
# in a sudo environment (i.e. if the SUDO_USER env variable # environment (i.e. if the SUDO_USER env variable is set). But of course,
# is set). But of course, ansible uses that to assume the # ansible uses that to assume the other user. It's fine.
# other user. It's fine.
shell: | shell: |
cd ~/.local/share/nvim/plugged/YouCompleteMe/ cd ~/.local/share/nvim/plugged/YouCompleteMe
python3 ./install.py --force-sudo python3 ./install.py --force-sudo
args: args:
creates: '~/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/ycm_core.cpython-38-x86_64-linux-gnu.so' executable: /bin/bash
register: ycm_compile_output
failed_when: ycm_compile_output.rc not in (0, 200)
when: >
(ycm_before_update.rc == 200)
or
(ycm_before_update.stdout != ycm_after_update.stdout)
tags: [vim-plugins]
- block: - block:
- name: firefox - create chrome directory - name: firefox - create chrome directory