linux-config/roles/vim_user/tasks/main.yml

48 lines
1.1 KiB
YAML

- name: Install vim (RHEL based)
become: true
package:
name:
- vim
- the_silver_searcher
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Install vim (Debian based)
become: true
package:
name:
- vim
- silversearcher-ag
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Prepare vim...
file:
path: ~/.vim/autoload
state: directory
mode: '0755'
- name: Install vim Plug
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: ~/.vim/autoload/plug.vim
- name: "Copy vimrc file"
copy:
src: dotfiles/vimrc
dest: "~/.vimrc"
mode: preserve
changed_when: false
- name: "Set vim colorscheme"
ansible.builtin.lineinfile:
path: "~/.vimrc"
regexp: "^colorscheme"
line: "colorscheme base16-{{ theme }}"
changed_when: false
#- name: "Set vim lightline colorscheme"
# ansible.builtin.lineinfile:
# path: "~/.vimrc"
# regexp: "^let g:lightline.colorscheme"
# line: "let g:lightline.colorscheme = '{{theme}}'"