Add neovim role for Debian, macOS, and Windows

This commit is contained in:
Kenneth Benzie 2022-04-30 14:20:26 +01:00
commit 8149f5b499
6 changed files with 114 additions and 0 deletions

8
main.yaml Normal file
View File

@ -0,0 +1,8 @@
---
- hosts: localhost
roles:
- neovim
- hosts: windows
roles:
- neovim

View File

@ -0,0 +1,23 @@
---
- name: install homebrew packages
homebrew:
name:
- neovim
- llvm
- node
- the_silver_searcher
state: latest
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user

View File

@ -0,0 +1,53 @@
---
- name: install apt package
become: true
apt:
name:
- neovim
- clang-format
- clang-tidy
- clangd
- silversearcher-ag
state: latest
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user
- name: nodejs get json containing latest version
uri:
url: https://nodejs.org/dist/index.json
register: latest
- name: nodejs create directory for downloaded package
file:
state: directory
dest: ~/.local/src
- name: nodejs download latest package
get_url:
url: 'https://nodejs.org/dist/{{latest.json[0].version}}/node-{{latest.json[0].version}}-linux-x64.tar.gz'
dest: ~/.local/src/node.tar.gz
- name: nodejs extract downloaded package
unarchive:
src: ~/.local/src/node.tar.gz
dest: ~/.local/src
remote_src: true
- name: nodejs create symlink links
file:
state: link
src: '~/.local/src/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
dest: '~/.local/bin/{{item}}'
with_items: [corepack, node, npm, npx]

View File

@ -0,0 +1,20 @@
---
- name: install choco packages
win_chocolatey:
name:
- neovim
- ag
- llvm
- nodejs
state: latest
- name: clone config repo
win_git:
repo: git@code.infektor.net:config/vim.git
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
version: master
# TODO: - name: neovim set repo email
# win_git_config:
# TODO: - name: neovim install pip packages
# win_pip:

View File

@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@ -0,0 +1,8 @@
---
neovim_pip_packages:
- cmake-language-server
- cmakelint
- compdb
- pynvim
- vim-vint
- yamllint