Basis for vim configuration

Hyped for neovim 0.5!
This commit is contained in:
Geoffrey Frogeye 2021-07-02 22:57:07 +02:00
parent 256a08f1a7
commit dd0e5a2189
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
12 changed files with 69 additions and 12 deletions

View file

@ -16,6 +16,8 @@
when: encrypt_home_stacked_fs
- role: dotfiles
tags: dotfiles
- role: vim
tags: vim
- role: gnupg
tags: gnupg
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment

View file

@ -28,9 +28,3 @@
pip:
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

View file

@ -44,8 +44,6 @@
value: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
- key: personal-cipher-preferences
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
gpg_key:

View file

@ -0,0 +1,5 @@
- name: Upgrade Neovim plugins
command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall"
failed_when: no
listen: neovim plugins changed

View 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

View file

@ -0,0 +1,8 @@
set nocompatible
filetype on
set runtimepath+=~/.config/vim,~/.cache/vim
set viminfo+=n~/.cache/vim/viminfo
{% include 'plugins.j2' %}

View 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') }}

View 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' %}

View 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'

View file

@ -0,0 +1 @@
{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) }}

View file

@ -1 +0,0 @@
.netrwhist

View file

@ -1,3 +0,0 @@
set runtimepath+=~/.config/vim,~/.cache/vim
let &packpath = &runtimepath
source ~/.config/vimrc