diff --git a/roles/neovim/tasks/main.yml b/roles/neovim/tasks/main.yml index 8f9c348..b515eab 100644 --- a/roles/neovim/tasks/main.yml +++ b/roles/neovim/tasks/main.yml @@ -58,10 +58,12 @@ name: neovim-remote extra_args: --user -- name: Make sure ~/.config/nvim/ directory exists - file: - path: ~/.config/nvim - state: directory +- name: Make sure needed directories exist + file: path={{ item.path }} state=directory mode={{ item.mode }} + with_items: + - {path: '~/.vim', mode: '0755'} + - {path: '~/.vim/autoload', mode: '0750'} + - {path: '~/.config/nvim', mode: '0755'} - name: Check if colors is a symlink stat: @@ -90,7 +92,10 @@ register: vimplug - name: Install vim-plug - command: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + get_url: + url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + dest: ~/.vim/autoload/plug.vim + mode: 0644 when: not vimplug.stat.exists - name: Upgrade vim-plug diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml index 3b606de..7c54650 100644 --- a/roles/vim/tasks/main.yml +++ b/roles/vim/tasks/main.yml @@ -40,6 +40,12 @@ when: ansible_facts['distribution'] == 'Archlinux' changed_when: "'there is nothing to do' not in shellcheck_script.stdout" +- name: Make sure needed directories exist + file: path={{ item.path }} state=directory mode={{ item.mode }} + with_items: + - {path: '~/.vim', mode: '0755'} + - {path: '~/.vim/autoload', mode: '0750'} + - name: Check if colors is a symlink stat: path: ~/.vim/colors @@ -66,7 +72,10 @@ register: vimplug - name: Install vim-plug - command: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + get_url: + url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + dest: ~/.vim/autoload/plug.vim + mode: 0644 when: not vimplug.stat.exists - name: Upgrade vim-plug