0
0
vps-set-up-playbook/roles/neovim/tasks/main.yaml

60 lines
1.2 KiB
YAML
Raw Normal View History

2023-11-14 00:06:09 +08:00
- name: Purge Vim
apt:
name: vim
state: absent
- name: Install Neovim
apt:
name:
- neovim
state: latest
install_recommends: false
- name: Create .config folder
file:
path: "/home/{{ user }}/.config"
state: directory
owner: 1000
group: 1000
mode: "0755"
- name: Create nvim folder
file:
path: "/home/{{ user }}/.config/nvim"
state: directory
owner: 1000
group: 1000
mode: "0755"
become: yes
become_method: sudo
become_user: "{{ user }}"
2023-11-18 21:00:10 +08:00
- name: Copy nvim config
2023-11-14 00:06:09 +08:00
copy:
2023-11-18 21:00:10 +08:00
src: "/home/{{ user }}/.config/nvim/"
dest: "/home/{{ user }}/.config/nvim/"
2023-11-14 00:06:09 +08:00
owner: 1000
group: 1000
mode: "0755"
become: yes
become_method: sudo
become_user: "{{ user }}"
2023-11-18 21:00:10 +08:00
- name: Install Vim Plug
2023-11-14 00:06:09 +08:00
command: >
2023-11-18 21:00:10 +08:00
vim -u /home/{{ user }}/.config/nvim/init.vim +'PlugInstall --sync' +qa
args:
creates: "/home/{{ user }}/.config/nvim/plugged"
2023-11-14 00:06:09 +08:00
become: yes
become_method: sudo
become_user: "{{ user }}"
2023-11-18 21:00:10 +08:00
- name: Uninstall Vim Plug
2023-11-14 00:06:09 +08:00
command: >
2023-11-18 21:00:10 +08:00
vim -u /home/{{ user }}/.config/nvim/init.vim +'PlugClean --sync' +qa
2023-11-14 00:06:09 +08:00
args:
creates: "/home/{{ user }}/.config/nvim/plugged"
become: yes
become_method: sudo
become_user: "{{ user }}"