This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-machine-setup/roles/neovim/tasks/main.yaml

60 lines
1.5 KiB
YAML
Raw Normal View History

2020-05-31 10:17:10 +00:00
---
2020-11-11 14:40:20 +00:00
- name: install prerequisites
2020-05-31 10:17:10 +00:00
package:
name:
2020-11-11 14:40:20 +00:00
- nodejs
- npm
- python-neovim
2020-11-11 14:40:20 +00:00
- python3
2020-05-31 10:17:10 +00:00
- ripgrep
state: latest
2020-11-11 14:40:20 +00:00
- name: download neovim appimage
get_url:
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
dest: /tmp
mode: "0755"
- name: extract neovim appimage
shell: |
rm -rf /usr/local/bin/nvim.appimage
/tmp/nvim.appimage --appimage-extract
mv squashfs-root /usr/local/bin/nvim.appimage
chmod -R 4755 /usr/local/bin/nvim.appimage
chmod -R -s /usr/local/bin/nvim.appimage
rm -f /tmp/nvim.appimage
args:
chdir: /tmp
- name: install neovim link
alternatives:
name: nvim
path: /usr/local/bin/nvim.appimage/usr/bin/nvim
link: /usr/bin/nvim
2020-05-31 10:17:10 +00:00
- name: create nvim plugin directory
become_user: "{{ account.name }}"
file:
path: "{{ account.home }}/.local/share/nvim/site/autoload/"
state: directory
- name: install vim-plug
become_user: "{{ account.name }}"
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: "{{ account.home }}/.local/share/nvim/site/autoload/plug.vim"
- name: install nvim config
become_user: "{{ account.name }}"
shell:
2020-05-31 10:52:20 +00:00
chdir: "{{ dotfiles }}/nvim"
2020-05-31 10:17:10 +00:00
cmd: ./install.sh
creates: "{{ account.home }}/.config/nvim/init.vim"
- name: install nvim plugins
become_user: "{{ account.name }}"
shell:
cmd: nvim +PlugInstall +PlugUpdate +qall