setup-cockpit/roles/vim/tasks/main.yml

90 lines
2.2 KiB
YAML

---
- name: Install packages (Archlinux)
become: true
pacman:
name:
- gvim
- python-pylint
- python-black
- base-devel
- flake8
- mypy
- shellcheck
- cmake
- clang
- npm # for coc
when: ansible_distribution == 'Archlinux'
- name: Install packages (Debian)
become: true
apt:
name:
- vim-gtk
- pylint3
- build-essential
- python3-dev
- flake8
- mypy
- shellcheck
- cmake
- clang
- npm # for coc
when: ansible_distribution == 'Debian'
# some Arch derivatives don't have the package (arch32, archarm)
- name: Run shellcheck script
script: scripts/shellcheck_binary_fix.sh
when: ansible_distribution == 'Archlinux'
- name: Remove ~/.vim/colors/ directory
file:
path: ~/.vim/colors
state: absent
changed_when: false
- name: Copy configs
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: 'flake8', dest: '~/.flake8' }
- { src: 'pylintrc', dest: '~/.pylintrc' }
- { src: 'vimrc', dest: '~/.vimrc' }
- { src: 'colors/', dest: '~/.vim/colors/' }
- name: Check if vim-plug is installed
stat:
path: ~/.vim/autoload/plug.vim
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
when: not vimplug.stat.exists
- name: Upgrade vim-plug
command:
cmd: vim +PlugUpgrade +qall
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
- name: Install plugins
command:
cmd: vim +PlugInstall +qall
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
- name: Update plugins
command:
cmd: vim +PlugUpdate +qall
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
- name: Update Coc plugins
command:
cmd: vim +CocUpdate +qall
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
- name: Upgrade Black
command:
cmd: vim +BlackUpgrade +qall
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
- name: Install hdl-checker
pip:
name: hdl-checker
extra_args: --user