Update vim plugin installations
This commit is contained in:
59
user.yml
59
user.yml
@@ -301,27 +301,60 @@
|
||||
src: ~/.vim/autoload/plug.vim
|
||||
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
|
||||
command: /usr/bin/nvim -f -E -s -c "source ~/.vimrc" +PlugInstall +qall
|
||||
register: vim_plugins_stdout
|
||||
check_mode: false
|
||||
changed_when: vim_plugins_stdout.stdout_lines|length != 0
|
||||
command: /usr/bin/nvim --headless +"PlugInstall --sync" +qall
|
||||
changed_when: false
|
||||
|
||||
- name: install go binaries for vim
|
||||
command: /usr/bin/nvim --headless +GoInstallBinaries +qall
|
||||
changed_when: false
|
||||
|
||||
- name: update vim plugins
|
||||
command: /usr/bin/nvim -f -E -s -c "source ~/.vimrc" +PlugUpdate +qall
|
||||
register: vim_plugin_update
|
||||
changed_when: vim_plugin_update.stdout_lines|length != 0
|
||||
command: /usr/bin/nvim --headless +"PlugUpdate --sync" +qall
|
||||
changed_when: false
|
||||
|
||||
- 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
|
||||
# --force-sudo is required, as the script refuses to run
|
||||
# in a sudo environment (i.e. if the SUDO_USER env variable
|
||||
# is set). But of course, ansible uses that to assume the
|
||||
# other user. It's fine.
|
||||
# --force-sudo is required, as the script refuses to run in a sudo
|
||||
# environment (i.e. if the SUDO_USER env variable is set). But of course,
|
||||
# ansible uses that to assume the other user. It's fine.
|
||||
shell: |
|
||||
cd ~/.local/share/nvim/plugged/YouCompleteMe/
|
||||
cd ~/.local/share/nvim/plugged/YouCompleteMe
|
||||
python3 ./install.py --force-sudo
|
||||
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:
|
||||
- name: firefox - create chrome directory
|
||||
|
||||
Reference in New Issue
Block a user