-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-interactive installation of vim plugins #2
Comments
There is another problem: if my .vimrc uses a colorscheme that comes from a plugin, vim throws errors when I run it for the first time (because the plugins are not installed yet, so the colorscheme is not available). Worst of all, it asks me to confirm whether I want to continue, which means that non-interactive ansible task will hang on that. |
However, the following seems to behave as desired: - name: Install vim plugins
shell: vim '+PlugInstall --sync' +qall
register: vim_plug_output
changed_when: "'Resolving deltas' in vim_plug_output.stdout" |
re. the colorscheme issue: yep, agreed. I experienced this exact problem also. My solution was to install the desired colours manually, before installing the vim plugins. I settled on something like: - name: Ensure destination exists for vim colours
file:
dest: $HOME/.vim/colors
state: directory
- name: Install snazzy colours for vim
get_url:
url: https://raw.githubusercontent.com/connorholyday/vim-snazzy/master/colors/snazzy.vim
dest: $HOME/.vim/colors
- name: Copy vimrc to $HOME
copy:
src: vimrc
dest: $HOME/.vimrc
- name: Install vim plugins
shell: vim '+PlugInstall --sync' +qall
register: vim_plug_output
changed_when: "'Resolving deltas' in vim_plug_output.stdout" |
I would like to install all vim plugins as part of the
dotfiles
role. However, vim plugin managers (including vim-plug) all seem to be designed for interactive use - in particular, their output is an incomprehensible mess when viewed not through a tty (for example, I didn't find a way to disable color codes).I tried doing something like this, but Ansible didn't manage to parse the output correctly and task status was reported wrongly:
The text was updated successfully, but these errors were encountered: