Basis for vim configuration
Hyped for neovim 0.5!
This commit is contained in:
parent
256a08f1a7
commit
dd0e5a2189
|
@ -16,6 +16,8 @@
|
||||||
when: encrypt_home_stacked_fs
|
when: encrypt_home_stacked_fs
|
||||||
- role: dotfiles
|
- role: dotfiles
|
||||||
tags: dotfiles
|
tags: dotfiles
|
||||||
|
- role: vim
|
||||||
|
tags: vim
|
||||||
- role: gnupg
|
- role: gnupg
|
||||||
tags: gnupg
|
tags: gnupg
|
||||||
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment
|
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment
|
||||||
|
|
|
@ -28,9 +28,3 @@
|
||||||
pip:
|
pip:
|
||||||
requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt"
|
requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt"
|
||||||
|
|
||||||
- name: Install Neovim plugins
|
|
||||||
command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall"
|
|
||||||
failed_when: no
|
|
||||||
changed_when: yes
|
|
||||||
# TODO Build Neovim configuration better
|
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@
|
||||||
value: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
|
value: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
|
||||||
- key: personal-cipher-preferences
|
- key: personal-cipher-preferences
|
||||||
value: TWOFISH CAMELLIA256 AES 3DES
|
value: TWOFISH CAMELLIA256 AES 3DES
|
||||||
# TODO Set default-key in extensions depending on which ones are available
|
|
||||||
# TODO Add enable-ssh-support to gpg-agent.conf in extensions to signal shenv that we should not use the SSH agent
|
|
||||||
|
|
||||||
- name: Install Geoffrey Frogeye's key
|
- name: Install Geoffrey Frogeye's key
|
||||||
gpg_key:
|
gpg_key:
|
||||||
|
|
5
config/automatrop/roles/vim/handlers/main.yml
Normal file
5
config/automatrop/roles/vim/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
- name: Upgrade Neovim plugins
|
||||||
|
command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall"
|
||||||
|
failed_when: no
|
||||||
|
listen: neovim plugins changed
|
||||||
|
|
14
config/automatrop/roles/vim/tasks/main.yml
Normal file
14
config/automatrop/roles/vim/tasks/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
- name: Create nvim configuration directory
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ ansible_user_dir }}/.config/{{ item }}"
|
||||||
|
mode: "u=rwx,g=rx,o=rx"
|
||||||
|
with_items:
|
||||||
|
- nvim
|
||||||
|
|
||||||
|
- name: Configure nvim
|
||||||
|
template:
|
||||||
|
src: nvim.j2
|
||||||
|
dest: "{{ ansible_user_dir }}/.config/nvim/init.vim"
|
||||||
|
mode: "u=rw,g=r,o=r"
|
||||||
|
tags: g
|
8
config/automatrop/roles/vim/templates/nvim.j2
Normal file
8
config/automatrop/roles/vim/templates/nvim.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
set nocompatible
|
||||||
|
filetype on
|
||||||
|
|
||||||
|
set runtimepath+=~/.config/vim,~/.cache/vim
|
||||||
|
set viminfo+=n~/.cache/vim/viminfo
|
||||||
|
|
||||||
|
{% include 'plugins.j2' %}
|
||||||
|
|
9
config/automatrop/roles/vim/templates/pluginlist.j2
Normal file
9
config/automatrop/roles/vim/templates/pluginlist.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{% macro add_source(link, extra={}) -%}
|
||||||
|
{% set plugins.sources = plugins.sources + [(link, extra)] %}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{% macro use_plugin(name) -%}
|
||||||
|
{% include 'plugins/' + name + '.j2' %}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{{ use_plugin('ale') }}
|
||||||
|
{{ use_plugin('deoplete') }}
|
21
config/automatrop/roles/vim/templates/plugins.j2
Normal file
21
config/automatrop/roles/vim/templates/plugins.j2
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
" Auto-install vim-plug
|
||||||
|
if empty(glob('~/.cache/vim/autoload/plug.vim'))
|
||||||
|
silent !curl -fLo ~/.cache/vim/autoload/plug.vim --create-dirs
|
||||||
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||||
|
endif
|
||||||
|
|
||||||
|
{% set plugins = namespace(sources=[]) %}
|
||||||
|
{% import 'pluginlist.j2' as pluginlist with context %}
|
||||||
|
|
||||||
|
call plug#begin('~/.cache/vim/plugged')
|
||||||
|
{% for link, extra in plugins.sources %}
|
||||||
|
{% if extra %}
|
||||||
|
Plug '{{ link }}', { {% for k, v in extra.items() %}'{{ k }}': '{{ v }}', {% endfor %} }
|
||||||
|
{% else %}
|
||||||
|
Plug '{{ link }}'
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
{% include 'pluginlist.j2' %}
|
9
config/automatrop/roles/vim/templates/plugins/ale.j2
Normal file
9
config/automatrop/roles/vim/templates/plugins/ale.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{{ add_source('dense-analysis/ale') }}
|
||||||
|
|
||||||
|
nmap <F3> :ALEFix<CR>
|
||||||
|
|
||||||
|
let g:ale_sign_error = '×'
|
||||||
|
let g:ale_sign_warning = '!'
|
||||||
|
let g:ale_completion_enabled = 1
|
||||||
|
let g:ale_fixers = ['autopep8', 'shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf']
|
||||||
|
let g:ale_php_phpcs_standard = '/srv/http/machines/ruleset.xml'
|
|
@ -0,0 +1 @@
|
||||||
|
{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) }}
|
1
config/nvim/.gitignore
vendored
1
config/nvim/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.netrwhist
|
|
|
@ -1,3 +0,0 @@
|
||||||
set runtimepath+=~/.config/vim,~/.cache/vim
|
|
||||||
let &packpath = &runtimepath
|
|
||||||
source ~/.config/vimrc
|
|
Loading…
Reference in a new issue