toansible: Add vim installation
This commit is contained in:
parent
2af5d18879
commit
feb2c05a1d
9 changed files with 84 additions and 54 deletions
54
configs.yml
54
configs.yml
|
@ -391,60 +391,6 @@ java:
|
||||||
- install:
|
- install:
|
||||||
- jdk-openjdk
|
- jdk-openjdk
|
||||||
|
|
||||||
vim:
|
|
||||||
- install:
|
|
||||||
arch:
|
|
||||||
- gvim
|
|
||||||
- python-pylint
|
|
||||||
- python-black
|
|
||||||
- base-devel
|
|
||||||
debian:
|
|
||||||
- vim-gtk
|
|
||||||
- pylint3
|
|
||||||
- build-essential
|
|
||||||
- python3-dev
|
|
||||||
both:
|
|
||||||
- flake8
|
|
||||||
- mypy
|
|
||||||
- shellcheck
|
|
||||||
- cmake
|
|
||||||
- clang
|
|
||||||
- npm # for coc
|
|
||||||
- run:
|
|
||||||
command: /bin/bash ./shellcheck_binary_fix.sh
|
|
||||||
condition: arch # some Arch derivatives have this problem (arch32, archarm)
|
|
||||||
- symlink:
|
|
||||||
- dotfiles/flake8
|
|
||||||
- ~/.flake8
|
|
||||||
- symlink:
|
|
||||||
- dotfiles/pylintrc
|
|
||||||
- ~/.pylintrc
|
|
||||||
- symlink:
|
|
||||||
- dotfiles/vim/vimrc
|
|
||||||
- ~/.vimrc
|
|
||||||
- symlink:
|
|
||||||
- dotfiles/vim/colors
|
|
||||||
- ~/.vim/colors
|
|
||||||
- run:
|
|
||||||
command: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
condition: "[ ! -e ~/.vim/autoload/plug.vim ]"
|
|
||||||
- run:
|
|
||||||
- vim +PlugInstall +qall # run this without conditions so it includes added stuff
|
|
||||||
- run:
|
|
||||||
command: vim +PlugUpgrade +qall
|
|
||||||
condition: update
|
|
||||||
- run:
|
|
||||||
command: vim +PlugUpdate +qall
|
|
||||||
condition: update
|
|
||||||
- run:
|
|
||||||
command: vim +CocUpdate +qall
|
|
||||||
condition: update
|
|
||||||
- run:
|
|
||||||
command: vim +BlackUpgrade +qall
|
|
||||||
condition: update
|
|
||||||
- run:
|
|
||||||
- pip install -U hdl-checker --user
|
|
||||||
|
|
||||||
zsh:
|
zsh:
|
||||||
- install:
|
- install:
|
||||||
arch:
|
arch:
|
||||||
|
|
84
roles/vim/tasks/main.yml
Normal file
84
roles/vim/tasks/main.yml
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Install packages (Arch)
|
||||||
|
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)
|
||||||
|
- script: scripts/shellcheck_binary_fix.sh
|
||||||
|
when: ansible_distribution == 'Archlinux'
|
||||||
|
|
||||||
|
- 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
|
Loading…
Add table
Reference in a new issue