Add neovim role for Debian, macOS, and Windows
This commit is contained in:
commit
8149f5b499
8
main.yaml
Normal file
8
main.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- neovim
|
||||
|
||||
- hosts: windows
|
||||
roles:
|
||||
- neovim
|
23
roles/neovim/tasks/Darwin.yaml
Normal file
23
roles/neovim/tasks/Darwin.yaml
Normal 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
|
53
roles/neovim/tasks/Debian.yaml
Normal file
53
roles/neovim/tasks/Debian.yaml
Normal 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]
|
20
roles/neovim/tasks/Windows.yaml
Normal file
20
roles/neovim/tasks/Windows.yaml
Normal 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:
|
2
roles/neovim/tasks/main.yaml
Normal file
2
roles/neovim/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
8
roles/neovim/vars/main.yaml
Normal file
8
roles/neovim/vars/main.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
neovim_pip_packages:
|
||||
- cmake-language-server
|
||||
- cmakelint
|
||||
- compdb
|
||||
- pynvim
|
||||
- vim-vint
|
||||
- yamllint
|
Loading…
x
Reference in New Issue
Block a user