From 051a8879d42a7da3c42d3aeebce69bf1de44bcf7 Mon Sep 17 00:00:00 2001 From: jdreichmann Date: Fri, 24 May 2019 22:46:04 +0200 Subject: [PATCH] vim: add role --- inventory.yaml | 4 ++++ roles/vim/tasks/main.yml | 23 +++++++++++++++++++ .../{colors/kuroi.vim => kuroi.vim.j2} | 0 roles/vim/templates/{vimrc => vimrc.j2} | 0 vim.yml | 7 ++++++ vim/.netrwhist | 3 +++ 6 files changed, 37 insertions(+) create mode 100644 roles/vim/tasks/main.yml rename roles/vim/templates/{colors/kuroi.vim => kuroi.vim.j2} (100%) rename roles/vim/templates/{vimrc => vimrc.j2} (100%) create mode 100644 vim.yml create mode 100644 vim/.netrwhist diff --git a/inventory.yaml b/inventory.yaml index dcac6a3..99ff4d7 100644 --- a/inventory.yaml +++ b/inventory.yaml @@ -22,3 +22,7 @@ tmux: hosts: xenon: +vim: + hosts: + xenon: + diff --git a/roles/vim/tasks/main.yml b/roles/vim/tasks/main.yml new file mode 100644 index 0000000..f7a2078 --- /dev/null +++ b/roles/vim/tasks/main.yml @@ -0,0 +1,23 @@ +--- + +- name: Ensure vim is installed + package: + name: vim + state: present + +- name.: Ensure ~/.vim/colors folder exists + file: + path: ~/.vim/colors + state: directory + recurse: yes + +- name: Copy kuroi color scheme + copy: + src: kuroi.vim.j2 + dest: ~/.vim/colors/kuroi.vim + +- name: Template vim config + template: + src: vimrc.j2 + dest: ~/.vimrc + diff --git a/roles/vim/templates/colors/kuroi.vim b/roles/vim/templates/kuroi.vim.j2 similarity index 100% rename from roles/vim/templates/colors/kuroi.vim rename to roles/vim/templates/kuroi.vim.j2 diff --git a/roles/vim/templates/vimrc b/roles/vim/templates/vimrc.j2 similarity index 100% rename from roles/vim/templates/vimrc rename to roles/vim/templates/vimrc.j2 diff --git a/vim.yml b/vim.yml new file mode 100644 index 0000000..a339248 --- /dev/null +++ b/vim.yml @@ -0,0 +1,7 @@ +--- + +- name: Install vim and copy color scheme and template its config + hosts: vim + become: true + roles: + - vim diff --git a/vim/.netrwhist b/vim/.netrwhist new file mode 100644 index 0000000..b54aaa8 --- /dev/null +++ b/vim/.netrwhist @@ -0,0 +1,3 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =1 +let g:netrw_dirhist_1='/home/electron/git/critical_infrastructure'