-
Notifications
You must be signed in to change notification settings - Fork 4
/
vim.yml
81 lines (72 loc) · 2.39 KB
/
vim.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
- hosts: all
vars:
vim_dir: "{{ ansible_env.HOME }}/.vim"
vimrc: "{{ ansible_env.HOME }}/.vimrc"
plugins:
- name: vim-airline
url: https://github.com/vim-airline/vim-airline
- name: nerdtree
url: https://github.com/preservim/nerdtree
- name: fzf-vim
url: https://github.com/junegunn/fzf.vim
- name: vim-gitgutter
url: https://github.com/airblade/vim-gitgutter
- name: vim-fugitive
url: https://github.com/tpope/vim-fugitive
- name: vim-floaterm
url: https://github.com/voldikss/vim-floaterm
- name: ctrlpvim
url: https://github.com/ctrlpvim/ctrlp.vim.git
- name: vim-go
url: https://github.com/fatih/vim-go.git
- name: fzf
url: https://github.com/junegunn/fzf.vim.git
tasks:
- name: Create vim directories
file:
path: "{{ item }}"
state: directory
recurse: no
mode: u=rwx
loop:
- "{{ vim_dir }}"
- "{{ vim_dir }}/autoload"
- "{{ vim_dir }}/bundle"
- name: Download pathogen
get_url:
url: "https://tpo.pe/pathogen.vim"
dest: "{{ vim_dir }}/autoload/pathogen.vim"
- name: Deploy plugins
git:
dest: "{{ vim_dir }}/bundle/{{ item.name }}"
repo: "{{ item.url }}"
clone: yes
update: yes
recursive: no
loop: "{{ plugins }}"
- name: Deploy .vimrc
template:
src: .vimrc.j2
dest: "{{ vimrc }}"
- name: Deploy weekly task to update vim plugins
block:
- name: Deploy shell script to update vim plugins
template:
src: "vim-plugin-updater.sh.j2"
dest: "{{ vim_dir }}/bundle/vim-plugin-updater.sh"
mode: "u=rwx,g=,o="
- name: Create LaunchAgents directory
file:
path: "{{ ansible_env.HOME }}/Library/LaunchAgents"
state: directory
recurse: yes
mode: "u=rwx,g=,o="
- name: Deploy launchd plist to update vim plugins
template:
src: "com.github.terala.mac-setup.vim-plugin-updater.plist.j2"
dest: "{{ ansible_env.HOME }}/Library/LaunchAgents/com.github.terala.mac-setup.vim-plugin-updater.plist"
- name: Enable vim-updater
community.general.launchd:
name: com.github.terala.mac-setup.vim-plugin-updater
state: reloaded